scripts to be used as git hooks
Inside a python virtual environment, to Install or update hooks, just run:
curl -S https://raw.githubusercontent.com/fgriberi/git-hooks/master/hook-me.py | python
The hook-me
copy the .flake8
config file in $HOME
. So, you can change the config parameters editing this file.
Flake8 is run per each file that was updated in the current commit. To change this options, and configure the source and test folders of your project for example, just edit the pre-commit.
This hook runs two verifications.
- Checks that you commit has not ipdb or pdb statements. If were the case, you'll see on the bash the specific line and position where the statement was not deleted and the commit will be declined.
- Checks that you commit pass the
flake8
rules. If the execution fails, then the errors will be shown in the bash and the commit will be declined.
As you can see in the picture, the prefix branch pattern name XXX-1
is added as a prefix commit message.