Pylint errors does not allow pre_push_hook to fail
See original GitHub issueIn case of a Pylint error the pre_push_hook
should fail. This is not observed currently as the error code returned from the pre_commit_linter
in case of a Pylint error is zero (should be non-zero).
Following is an example:
> python2 scripts/pre_commit_linter.py; echo $?
Starting directive scope check
----------------------------------------
SUCCESS Directive scope check passed
----------------------------------------
Starting controller dependency line break check
----------------------------------------
SUCCESS Controller dependency line break check passed
----------------------------------------
Starting HTML directive name check
----------------------------------------
----------------------------------------
There are no files to be checked.
Starting import-order checks
----------------------------------------
----------------------------------------
Starting newline-at-EOF checks
----------------------------------------
----------------------------------------
(1 files checked, 0 errors found)
SUCCESS Newline character checks passed
Starting docstring checks
----------------------------------------
----------------------------------------
SUCCESS Docstring check passed
Starting comment checks
----------------------------------------
----------------------------------------
SUCCESS Comments check passed
Starting HTML tag and attribute check
----------------------------------------
SUCCESS HTML tag and attribute check passed
----------------------------------------
Starting HTML linter...
----------------------------------------
----------------------------------------
SUCCESS HTML linting passed
HTML linting finished.
Starting linter...
Starting CSS, Javascript and Python Linting
----------------------------------------
There are no CSS files to lint.
There are no CSS files to lint.
There are no JavaScript files to lint.
Linting 1 Python files
Linting Python files 1 to 1...
Using config file /home/jude/foss/oppia/.pylintrc
Python linting finished.
Summary of Errors:
----------------------------------------
************* Module oppia.scripts.pre_commit_linter
W:467, 4: Unused variable 'temp' (unused-variable)
------------------------------------------------------------------
Your code has been rated at 9.99/10 (previous run: 9.99/10, +0.00)
Starting Pattern Checks
----------------------------------------
----------------------------------------
There are no files to be checked.
Starting copyright notice check
----------------------------------------
SUCCESS Copyright notice check passed
----------------------------------------
0
The last line denotes the status code which should be non-zero.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
pylint precommit - only fail on specific categories (errors/fatals ...
My objective: I want pylint (in combination with pre-commit hooks) not to fail with warnings of the category C,R,W, but on E,F (Errors...
Read more >hooks: pylint: pre-commit failure #4145 - iterative/dvc - GitHub
pre-commit-config.yaml states that the pylint hook is defined locally, yet .pre-commit-hooks.yaml fails to define it.
Read more >A curated list of pylint errors with explanation and examples
A curated list of pylint errors with explanation and examples.
Read more >Use pre-commit, commit-msg, and pre-push git hooks to fix ...
If the pre-commit hook exits with a non-zero status, the commit will be aborted. This behavior can be bypassed git commit --no-verify ....
Read more >Tree - rpms/anaconda - CentOS Git server
Fix a pylint error in the source switch handler mixin (mkolman). Related: rhbz#1275771. - Don't crash when selecting the same hdd ISO again...
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 FreeTop 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
Top GitHub Comments
@lilithxxx, please let this issue remain open. We’ll close it when the PR goes in. Thanks for the issue 😃
@apb7 Ah the PR does seem to fix this. Should I close this issue then?