sebdah/git-pylint-commit-hook

Do not add --rcfile

erikgunther opened this issue · 2 comments

Hi Sebastian

I have a .pylintrc file in the root directory of git. I have to manual add in .git/hook/pre-commit for pylint to pick it up.

In pre-commit I now have:

#/usr/bin/env bash
git-pylint-commit-hook --pylint-params='--rcfile=/path/to/git-repo/.pylintrc'

If i read the documentation it should pick up that file by it self. I think its related to if --pylint-params is given at all or not.

For version 2.0.1

$> git-pylint-commit-hook --version
Traceback (most recent call last):
  File "/usr/local/bin/git-pylint-commit-hook", line 71, in <module>
    main()
  File "/usr/local/bin/git-pylint-commit-hook", line 60, in main
    settings.get('general', 'version')))
  File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'general'

eeehmm...

$> cat settings.conf
[general]
version: 2.0.1

Thanks for the report Erik!

I have fixed both the version thing and I believe that you other problem should be resolved to. In my repo I have a .pylintrc in my root dir. This is the content I have in that file:

[pre-commit-hook]
limit=8.0

You can also add custom parameters and a custom pylint command in that file if you'd like to.

This has been released in version 2.0.2.

pip install -U git-pylint-commit-hook