Don't fail files with pylint: skip-file#66
Merged
sebdah merged 1 commit intosebdah:developfrom Jul 27, 2018
Merged
Conversation
When pylint completely skips a file (e.g. with `# pylint: skip-file`), there is no score output for that file because there is no output from pylint at all. The previous code considered this to be a failure because _parse_score returns 0.0 if the score regex is not matched. This code checks for cases where pylint produces no output and its return code is 0, indicating that it intentionally skipped the file. This commit introduces a new status of 'SKIPPED', which does not cause the commit to be stopped.
sebdah
approved these changes
Jul 27, 2018
Owner
sebdah
left a comment
There was a problem hiding this comment.
@petergaultney Thanks for the contribution, looks 💯. I'll ship it in a bit.
Owner
|
This was shipped with 2.5.0 just now. 🙇♂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When pylint completely skips a file (e.g. with
# pylint: skip-file),there is no score output for that file because there is no output from
pylint at all.
The previous code considered this to be a failure because _parse_score
returns 0.0 if the score regex is not matched.
This code checks for cases where pylint produces no output and its
return code is 0, indicating that it intentionally skipped the
file. This commit introduces a new status of 'SKIPPED', which does not
cause the commit to be stopped.
The overall effect of this change is to make it less necessary to rely on the --ignore command line option, since pylint itself provides a syntax for situations where it isn't necessary to check a file.
I also fixed a very small indentation style issue which pylint itself was complaining to me about. :)