You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the user.json file is generated from the interactive mode --interactive the field for line numbers is named line_numbers, and is set to false by default. However, this field should be named show_line_numbers as that is what is parsed by the utility.
To Reproduce
Overview: Complete the interactive form on a test file to generate a default user.json config file. Modify the line_numbers field of this config file, and observe the changes in the output.
Create a test file to freeze
echo'{"test": true}'> testfile.json
Freeze the file using interactive mode, naming the file testfile_default.png. Keep this file for comparison.
# Select the testfile.json, and name the output testfile_default.png# Keep defaults otherwise
freeze --interactive
Open the user.json config. There will be a line_numbers field in the output, which is set to false.
# Output should read "false"
cat ~/.config/freeze/user.json | jq '.line_numbers'
N.b. the default line_numbers field here is the problem, but we continue testing for completeness
Change the line_numbers field value from false to true
# Set the value to true and verify. Output should read "true"
sed -i 's/"line_numbers":false/"line_numbers":true/'~/.config/freeze/user.json \
&& jq '.line_numbers'~/.config/freeze/user.json
Freeze the test file again, using this user config, naming it testfile_line_numbers.png
freeze -c user testfile.json --output testfile_line_numbers.png
You will notice that the output file does not contain line numbers, although we changed the line_numbers value from false to true; it is no different than the testfile_default.png file.
Rename the line_numbers field to show_line_numbers
# Output should read "true"
sed -i 's/"line_numbers"/"show_line_numbers"/g'~/.config/freeze/user.json \
∙ && jq '.show_line_numbers'~/.config/freeze/user.json
Repeat step 5, naming the output testfile_show_line_numbers.png
freeze -c user testfile.json --output testfile_show_line_numbers.png
You will notice that the line numbers now show, as compared to the other outputs.
Expected behavior
Changing the line_numbers field to true or false should result in line numbers being shown or hidden in the output, respectively. Alternatively, this field should be named show_line_numbers as is consistent with the command-line flag, and is what actually fixes the issue.
Screenshots testfile_default.png
Default output after running interactive mode
testfile_line_numbers.png
Output after setting line_numbers to true
testfile_show_line_numbers.png
Output after changing line_numbers to show_line_numbers
Desktop
OS: Arch Linux x86_64
Version: 0.1.6
The text was updated successfully, but these errors were encountered:
Describe the bug
When the
user.json
file is generated from the interactive mode--interactive
the field for line numbers is namedline_numbers
, and is set to false by default. However, this field should be namedshow_line_numbers
as that is what is parsed by the utility.To Reproduce
Overview: Complete the interactive form on a test file to generate a default
user.json
config file. Modify theline_numbers
field of this config file, and observe the changes in the output.testfile_default.png
. Keep this file for comparison.line_numbers
field in the output, which is set tofalse
.N.b. the default
line_numbers
field here is the problem, but we continue testing for completenessline_numbers
field value fromfalse
totrue
testfile_line_numbers.png
You will notice that the output file does not contain line numbers, although we changed the
line_numbers
value fromfalse
totrue
; it is no different than thetestfile_default.png
file.line_numbers
field toshow_line_numbers
testfile_show_line_numbers.png
You will notice that the line numbers now show, as compared to the other outputs.
Expected behavior
Changing the
line_numbers
field totrue
orfalse
should result in line numbers being shown or hidden in the output, respectively. Alternatively, this field should be namedshow_line_numbers
as is consistent with the command-line flag, and is what actually fixes the issue.Screenshots
testfile_default.png
Default output after running interactive mode
testfile_line_numbers.png
Output after setting
line_numbers
totrue
testfile_show_line_numbers.png
Output after changing
line_numbers
toshow_line_numbers
Desktop
The text was updated successfully, but these errors were encountered: