I am trying to set up pylint to work with pre-commit. I have looked into the docs, but still I am confused. I do not know how to setup .pre-commit-config.yaml properly.
Could you provide the most basic possible template?
- repo: myrepo
rev: '' # Don't know that to type here
hooks:
- id: pylint
The most basic possible template would be this:
- repo: https://github.com/pycqa/pylint
rev: pylint-2.6.0
hooks:
- id: pylint
You can also pass arguments to pylint:
- repo: https://github.com/pycqa/pylint
rev: pylint-2.6.0
hooks:
- id: pylint
args:
- --max-line-length=80
- --ignore-imports=yes
- -d duplicate-code
Notes about compatibility:
Here is a pre-commit config fragment that works for me using regular pylint
instead of mirrors-pylint
:
- repo: https://github.com/pycqa/pylint
rev: pylint-2.5.3
hooks:
- id: pylint
args:
- --errors-only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With