Skip to content

Commit 96fb7fa

Browse files
committed
Document pretty-format-json. Resolves #156
1 parent 5258286 commit 96fb7fa

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ Add this to your `.pre-commit-config.yaml`
5252
- `name-tests-test` - Assert that files in tests/ end in `_test.py`.
5353
- Use `args: ['--django']` to match `test*.py` instead.
5454
- `pyflakes` - Run pyflakes on your python files.
55-
- `pretty-format-json` - Checks that all your JSON files are pretty
55+
- `pretty-format-json` - Checks that all your JSON files are pretty. "Pretty"
56+
here means that keys are sorted and indented. You can configure this with
57+
the following commandline options:
5658
- `--autofix` - automatically format json files
59+
- `--indent ...` - Control the indentation (either a number for a number of spaces or a string of whitespace). Defaults to 4 spaces.
5760
- `--no-sort-keys` - when autofixing, retain the original key ordering (instead of sorting the keys)
58-
- `--indent ...` - Control the indentation (either a number for a number of spaces or a string of whitespace).
61+
- `--top-keys comma,separated,keys` - Keys to keep at the top of mappings.
5962
- `requirements-txt-fixer` - Sorts entries in requirements.txt
6063
- `trailing-whitespace` - Trims trailing whitespace.
6164
- Markdown linebreak trailing spaces preserved for `.md` and`.markdown`;

0 commit comments

Comments
 (0)