1

I have a pre-commit set up on a python repo. I have a .pre-commit-config.yaml file where I specify my pylint settings/arguments. Previously my pylint hook worked.

Pylint config in .pre-commit-config.yaml:

  - repo: local
    hooks:
     - id: pylint
       name: pylint
       entry: pylint
       language: system
       types: [python]
       args:
        [
          "-rn",
          "--rcfile=./polestar.rc",
          "--fail-under=6"
        ]

This config previously worked. Now I get the following error.

pylint: error: no such option: --fail-under

I can't think of anything that has changed to cause this issue.

Any advice would be great or suggestions as to what could fix it.

anthony sottile
  • 61,815
  • 15
  • 148
  • 207
Harvey
  • 668
  • 2
  • 7
  • 15
  • Same question, but unanswered: [fail-under flag does not work with pylint](https://stackoverflow.com/q/67456882/1256452) – torek Jul 27 '22 at 09:49
  • See also [this closed issue](https://github.com/PyCQA/pylint/issues/2242) which implies that pylint never has and never will have `--fail-under`. Yet [this question](https://stackoverflow.com/q/50944575/1256452) says that it's there in 2.5.0 and later. Presumably there are multiple different programs called "pylint" at this point. (In any case this has nothing to do with Git.) – torek Jul 27 '22 at 09:52

1 Answers1

1

Found issue: the python environment I was in had a old version of pylint installed. I updated the pylint version to latest and the option to set --fail-under became available again.

Harvey
  • 668
  • 2
  • 7
  • 15