Add new hook pretty-format-json

This new hook allows to standardize one's JSON files (sorted key/4
spaces indent).
By default it just fails if any file is not complying with the standard,
but you can also pass the arg `--autofix` and the hook will
pretty-format the file itself.

Good in use combined with the `check-json` hook.
This commit is contained in:
Léo Cavaillé 2015-06-10 17:08:48 -04:00
parent cf550fcab3
commit 55bf22dc4a
7 changed files with 134 additions and 2 deletions

View file

@ -31,6 +31,12 @@
entry: check-json
language: python
files: \.json$
- id: pretty-format-json
name: Pretty format JSON
description: This hook sets a standard for formatting JSON files.
entry: pretty-format-json
language: python
files: \.json$
- id: check-merge-conflict
name: Check for merge conflicts
description: Check for files that contain merge conflict strings.