Skip to content

pretty-format-json fails with '--indent' argument #137

@chriswgerber

Description

@chriswgerber
# .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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions