Fix #5451: Produce a score of 0 for fatal errors#5521
Conversation
|
I'm not sure if emitting non-perfect scores for all statement-less modules is correct, but I think we should emit a score for this error. |
I think this makes more sense. We won't have to add a special case and the corresponding tests this way. The score should be 10 if there isn't any error or 0 if there is at least an error/warning/convention/info. |
|
Sure, happy to go in the other direction.
Just to be clear, the case was when the user has not changed from the default 10. We were emitting 10 anyway. |
Pull Request Test Coverage Report for Build 1579479507
💛 - Coveralls |
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
I was wondering where the actual code change was, then I realized that the changed default value is valid python code. That's pretty clever !
DanielNoord
left a comment
There was a problem hiding this comment.
Small changes, mostly because I forgot to do stuff in #5318 😅
Note to self: copy pylintrc to examples/pylintrc in a follow-up PR.
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
DanielNoord
left a comment
There was a problem hiding this comment.
Thanks for the quick work @jacobtylerwalls!
I'll try and think of the pylintrc move tomorrow.
Type of Changes
Description
Before
Modules without statements (such as typo'd paths) don't generate scores. When a linter is run over both valid and invalid paths, this can lead to a perfect score. Scores meeting the
--fail-underthreshold exit with a 0 code (passing), which is counterintuitive for the case just described.Now
As long as--fail-underis 10.0, this PR fails runs with perfect scores if they had any non-zero exit codes.Of course, the other approach would be to start emitting non-perfect scores for modules without statements, but this seemed less invasive.Update: new approach is to simply produce a score of 0 for fatal errors.
Closes #5451