diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..6c7a4dccf --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v1.4.0 + hooks: + - id: flake8 + diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 9fb2fc2de..6badca980 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -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.