hooks: pylint: pre-commit failure
See original GitHub issue.pre-commit-config.yaml states that the pylint hook is defined locally, yet .pre-commit-hooks.yaml fails to define it. As a result, attempting to commit will result in an error:
~/gits/dvc (master)$ git commit
black....................................................................Passed
seed isort known_third_party.............................................Passed
isort....................................................................Passed
flake8...................................................................Passed
pylint...................................................................Failed
- hook id: pylint
- exit code: 1
Executable `pylint` not found
beautysh.............................................(no files to check)Skipped
DVC pre-commit...........................................................Passed
- hook id: dvc-pre-commit
- duration: 0.5s
Data and pipelines are up to date.
Defining the hook’s language as system and asking devs to manually run pip install .[tests] goes against fundamental principles of pre-commit hooks. None of the other hooks require this.
In any case pylint itself defines .pre-commit-hooks.yaml so we should just use theirs.
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (15 by maintainers)
Top Results From Across the Web
pylint and pre-commit hook unable to import - Stack Overflow
pre-commit runs pylint from an isolated virtualenv. Many of pylint's checks perform dynamic analysis which will fail there.
Read more >Pre-commit integration - Pylint 2.16.0-dev documentation
pylint can be used as a pre-commit hook. Since pylint needs to import modules and dependencies to work correctly, the hook only works...
Read more >Setup Pylint pre-commit hook - Moserei
A short guide on the Pylint hook for pre-commit. ... When you try to commit this, pylint will fail and stop you from...
Read more >Supported hooks - pre-commit
python -import-sorter - This hook sorts python imports. ... puppet-lint - Check Puppet manifests for stylistic problems; puppet-validate - Validate syntax of ...
Read more >Keep your code clean using Black & Pylint & Git Hooks & Pre ...
Create the file pre-commit in the folder .git/hooks/. You should not include any ... help='score threshold to fail pylint runner | '
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, so looks like “do nothing” is the choice for now. Closing.
I don’t like that approach/hack, it’s far easier to pre-activate virtualenv. And, it does not solve the issue, it still needs all of the tests dependencies to be installed.
The possible ways to solve this are:
pylintfrom pre-commit altogether. Add a guide to how-to runpylintin contributing docs.pylintis not installed.pre-pushhooks?I don’t have any strong opinions on either of the above. If we cannot commit to anything, I’d suggest we close the issue and defer it for later.
cc @casperdcl @efiop