pretty-format-json fails with '--indent' argument
See original GitHub issue# .pre-commit-config.yaml
...
- id: pretty-format-json
args:
- --indent 4
- --autofix
- --no-sort-keys
...
# Error:
Pretty format JSON.................................................................Failed
hookid: pretty-format-json
usage: pretty-format-json [-h] [--autofix] [--indent INDENT] [--no-sort-keys]
[filenames [filenames ...]]
pretty-format-json: error: unrecognized arguments: package.json composer.json
Setting the argument to adjust the indentation level causes the script to break. Formatting of the argument doesn’t seem to matter (E.g. ‘4’, “4”, 4). The only way to get it to work is to remove the argument.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Python PrettyPrint JSON Data
The json.dump() method provides the following parameters to pretty-print JSON data. The indent parameter specifies the spaces that are used at ...
Read more >Pretty-Print JSON Data to a File using Python
json or modifying existing josn file the use "indent" parameter for pretty view json format. import json responseData = json.loads(output) with open(' ...
Read more >Python Pretty Print JSON
The indent parameter is used to define the indent level for the formatted string. 2. Python Pretty Print JSON File. Let's see what...
Read more >Pretty Print a JSON File in Python (6 Methods)
Learn how to use Python to pretty print a JSON object, including from a file, from an API, and how to save the...
Read more >JSON Pretty Print using Python
This method has the parameter indent to specify the number of spaces and a separator parameter to specify the separator between key and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/pre-commit/pre-commit-hooks/pull/138
It would be handy to add it to the README. The Indent flag isn’t even mentioned.