Add a no commit to specific branch hook. (#185)

* add no commit code and config

* add the code

* remove version tweak

* fix logic, remove newline

* add Tests and cleanup testing issues

* remove extraneous modules

* cleanup some pep8 and flake issues

* reorder imports

* more fixes for syntax checking

* code cleanup based off asottile comments

* Use Contractions Properly, alphabatize new hook.

* Adding support for branches with a slash in them.
This commit is contained in:
Evan Felix 2017-03-20 10:36:51 -07:00 committed by Anthony Sottile
parent b95dcad616
commit a8592669d9
6 changed files with 87 additions and 0 deletions

View file

@ -56,6 +56,8 @@ Add this to your `.pre-commit-config.yaml`
- `forbid-new-submodules` - Prevent addition of new git submodules.
- `name-tests-test` - Assert that files in tests/ end in `_test.py`.
- Use `args: ['--django']` to match `test*.py` instead.
- `no-commit-to-branch` - Protect specific branches from direct checkins.
- Use `args: -b <branch> ` to set the branch. `master` is the default if no argument is set.
- `pyflakes` - Run pyflakes on your python files.
- `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