From 96fb7fa10f2f4c11ed33482a9ad7474251e5e97f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 7 Dec 2016 10:44:07 -0800 Subject: [PATCH] Document pretty-format-json. Resolves #156 --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 860d50b..603e08c 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,13 @@ Add this to your `.pre-commit-config.yaml` - `name-tests-test` - Assert that files in tests/ end in `_test.py`. - Use `args: ['--django']` to match `test*.py` instead. - `pyflakes` - Run pyflakes on your python files. -- `pretty-format-json` - Checks that all your JSON files are pretty +- `pretty-format-json` - Checks that all your JSON files are pretty. "Pretty" + here means that keys are sorted and indented. You can configure this with + the following commandline options: - `--autofix` - automatically format json files + - `--indent ...` - Control the indentation (either a number for a number of spaces or a string of whitespace). Defaults to 4 spaces. - `--no-sort-keys` - when autofixing, retain the original key ordering (instead of sorting the keys) - - `--indent ...` - Control the indentation (either a number for a number of spaces or a string of whitespace). + - `--top-keys comma,separated,keys` - Keys to keep at the top of mappings. - `requirements-txt-fixer` - Sorts entries in requirements.txt - `trailing-whitespace` - Trims trailing whitespace. - Markdown linebreak trailing spaces preserved for `.md` and`.markdown`;