Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Not working for me #2

Closed
papb opened this issue Jul 14, 2021 · 4 comments
Closed

Not working for me #2

papb opened this issue Jul 14, 2021 · 4 comments

Comments

@papb
Copy link

papb commented Jul 14, 2021

I am using pylint 2.9.3, the exit code is still zero.

@papb
Copy link
Author

papb commented Jul 15, 2021

Workaround:

find .venv/lib -path '*/pylint/constants.py' -exec sed -r -i -e 's@(^MSG_TYPES_STATUS = .*):\s*0,(.*)@\1: 4,\2  # monkey-patched, waiting for pylint#3363@g' {} ';'

@MarkCBell
Copy link

The reason that this no longer works is commit pylint-dev/pylint@ab094ae. This changed the default behaviour of pylint so that a run will automatically be marked as succeeding if its score is >= config.fail_under (where as previously it only required score > config.fail_under).

Since informational alerts do not affect the score, runs with (only) them finish with a perfect 10.0 / 10.0 score and so this shortcut is applied and an exit(0) is immediately triggered. You can prevent this shortcut from triggering by also setting the fail_under value to be something larger than 10, for example by adding --fail-under=11 to your usage of pylint.

@xavfernandez
Copy link
Collaborator

xavfernandez commented Jul 15, 2021

--fail-on=useless-suppression should also work (if you've got a precise list of interesting Informational code)

@papb
Copy link
Author

papb commented Sep 15, 2022

I ended up solving my problem by updating pylint and adding the following to my .pylintrc (without need for this package):

evaluation=10.0 - ((float(5 * error + warning + refactor + convention + info) / statement) * 10)

@papb papb closed this as completed Sep 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants