I'm using pre-commit for most of my Python projects, and in many of them, I need to use pylint as a local repo. When I want to commit, I always have to activate python venv and then commit; otherwise, I'll get the following error:
black....................................................................Passed
pylint...................................................................Failed
- hook id: pylint
- exit code: 1
Executable `pylint` not found
When I use vscode version control to commit, I get the same error; I searched about the problem and didn't find any solution to avoid the error in VSCode.
This is my typical .pre-commit-config.yaml:
repos:
- repo: https://github.com/ambv/black
rev: 21.9b0
hooks:
- id: black
language_version: python3.8
exclude: admin_web/urls\.py
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: python
types: [python]
args:
- --rcfile=.pylintrc