Add support for pre-commit-hooks

This will help forgetful developers like me not to miss running tox -e
pep8 before commiting.

Change-Id: Ied40f0daa59d9de34867c7b0cc4897a9332a7413
Signed-off-by: Antoni Segura Puimedon <celebdor@gmail.com>
This commit is contained in:
Antoni Segura Puimedon 2018-09-27 13:01:45 +02:00
parent d712d65f5a
commit 402a041b13
2 changed files with 15 additions and 0 deletions

6
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.4.0
hooks:
- id: flake8

View File

@ -15,3 +15,12 @@ Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub: Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/kuryr-kubernetes https://bugs.launchpad.net/kuryr-kubernetes
If you want to have your code checked for pep8 automatically before commiting
changes, you can just do::
pip install pre-commit
pre-commit install
From that moment on, every time you run *git commit* it will first check your
diff for pep8 compliance and refuse to commit if it doesn't pass.