Skip to content

Don't fail files with pylint: skip-file#66

Merged
sebdah merged 1 commit intosebdah:developfrom
petergaultney:master
Jul 27, 2018
Merged

Don't fail files with pylint: skip-file#66
sebdah merged 1 commit intosebdah:developfrom
petergaultney:master

Conversation

@petergaultney
Copy link
Contributor

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. :)

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.
Copy link
Owner

@sebdah sebdah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petergaultney Thanks for the contribution, looks 💯. I'll ship it in a bit.

@sebdah sebdah self-assigned this Jul 27, 2018
@sebdah sebdah changed the base branch from master to develop July 27, 2018 07:22
@sebdah sebdah merged commit 7b9fe58 into sebdah:develop Jul 27, 2018
@sebdah
Copy link
Owner

sebdah commented Jul 27, 2018

This was shipped with 2.5.0 just now. 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants