[FIXED] Pylint and pre-commit python 3.7

Issue

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

Solution

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:

  • Python >=3.7 requires pylint >= 2.0
  • Python 2 requires pylint < 2.0 (Python 2 support was dropped in Pylint 2)


Answered By - KevinG
Answer Checked By - Willingham (Python.Easybugfix Volunteer)

Related Posts

Post a Comment