Browse Source

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>
changes/49/605649/1
Antoni Segura Puimedon 3 years ago
parent
commit
402a041b13
2 changed files with 15 additions and 0 deletions
  1. +6
    -0
      .pre-commit-config.yaml
  2. +9
    -0
      CONTRIBUTING.rst

+ 6
- 0
.pre-commit-config.yaml View File

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

+ 9
- 0
CONTRIBUTING.rst View File

@ -15,3 +15,12 @@ Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub:
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.

Loading…
Cancel
Save