From ca6955ff24287b65ea927333a1882e16a319ef1a Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Tue, 19 Apr 2016 21:50:29 -0400 Subject: [PATCH] Suggest the flake8 git commit hook (#408) Given the number of PRs that require style cleanups, it seems like it might be helpful to suggest users add the flake8 commit hook, to catch issues before they get committed to the repo. --- source/developers/development_environment.markdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/developers/development_environment.markdown b/source/developers/development_environment.markdown index ca34842238b..045449d8521 100644 --- a/source/developers/development_environment.markdown +++ b/source/developers/development_environment.markdown @@ -39,6 +39,15 @@ $ pip3 install tox After following these steps, running `hass` will invoke your local installation. +### {% linkable_title Prevent Linter Errors %} + +Home Assistant enforces strict [PEP8 style](https://www.python.org/dev/peps/pep-0008/) compliance on all code submitted. You can save yourself the hassle of extra commits just to fix style errors by enabling the flake8 git commit hook. It will check your code when you attempt to commit to the repo. It will block the commit if there are any style issues, giving you a chance to fix it. + +```bash +$ pip install flake8 +$ flake8 --install-hook +``` + ### {% linkable_title Submitting improvements %} Improvements to Home Assistant should be submitted one feature at a time using GitHub [pull requests](https://help.github.com/articles/using-pull-requests).