question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
chriswgerbercommented, Aug 22, 2016

It would be handy to add it to the README. The Indent flag isn’t even mentioned.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found