From 402a041b133251962bdfe71010fbd24b66028c9c Mon Sep 17 00:00:00 2001 From: Antoni Segura Puimedon Date: Thu, 27 Sep 2018 13:01:45 +0200 Subject: [PATCH] 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 --- .pre-commit-config.yaml | 6 ++++++ CONTRIBUTING.rst | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 .pre-commit-config.yaml 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.