Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save diegopacheco/79cd260253bcb5a2cfbdad007df5c913 to your computer and use it in GitHub Desktop.
Save diegopacheco/79cd260253bcb5a2cfbdad007df5c913 to your computer and use it in GitHub Desktop.

Install git-pylint-commit-hook

$ pip install git-pylint-commit-hook

Add git pylint to a git repo as a hook

$ cd my_git_repo/.git/hooks
$ echo '#!/bin/sh
git-pylint-commit-hook
' > pre-commit

Make the script runnable

chmod 755 my_git_repo/.git/hooks
  1. Test committing a python script
git commit -m 'Update my_file.py format to comply with PEP8'
// Running pylint on my_file.py (file 1/1)..     9.8/10.00       PASSED
// [master 3296b3d] Update my_file.py format to comply with PEP8
// file changed, 15 insertions(+), 4 deletions(-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment