question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pylint errors does not allow pre_push_hook to fail

See original GitHub issue

In 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:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
apb7commented, Dec 30, 2018

@lilithxxx, please let this issue remain open. We’ll close it when the PR goes in. Thanks for the issue 😃

0reactions
lilithxxxcommented, Dec 30, 2018

@apb7 Ah the PR does seem to fix this. Should I close this issue then?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found