https://github.com/whtsky/pre-commit-pretty-format-json5
A pre-commit hook that checks that all your JSON5 files are pretty.
https://github.com/whtsky/pre-commit-pretty-format-json5
json5 json5-format pre-commit pre-commit-hook
Last synced: 10 months ago
JSON representation
A pre-commit hook that checks that all your JSON5 files are pretty.
- Host: GitHub
- URL: https://github.com/whtsky/pre-commit-pretty-format-json5
- Owner: whtsky
- License: mit
- Created: 2021-06-07T09:15:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-03T23:39:16.000Z (about 1 year ago)
- Last Synced: 2025-03-28T06:02:32.978Z (11 months ago)
- Topics: json5, json5-format, pre-commit, pre-commit-hook
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pre-commit-pretty-format-json5
A pre-commit hook that checks that all your JSON5 files are pretty.
## Usage
```yaml
- repo: https://github.com/whtsky/pre-commit-pretty-format-json5
rev: "1.0.0"
hooks:
- id: pretty-format-json5
```
commandline options:
- `--no-autofix` - Don't automatically format json files
- `--indent ...` - Control the indentation (either a number for a number of spaces or a string of whitespace). Defaults to 2 spaces.
- `--ensure-ascii` converte unicode characters to escape sequences
- `--no-sort-keys` - when autofixing, retain the original key ordering (instead of sorting the keys)
- `--top-keys comma,separated,keys` - Keys to keep at the top of mappings.