Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint 2.5 does not allow ignoring checkers whose names have numbers in them #3666

Closed
jfly opened this issue Jun 5, 2020 · 0 comments · Fixed by #3667
Closed

Pylint 2.5 does not allow ignoring checkers whose names have numbers in them #3666

jfly opened this issue Jun 5, 2020 · 0 comments · Fixed by #3667

Comments

@jfly
Copy link
Contributor

jfly commented Jun 5, 2020

Steps to reproduce

Using a version of Pylint 2.5, it's impossible to ignore warnings about checkers whose names contain numbers.

Reproducing this requires writing custom checker, which is a bit complicated to describe in a single issue. I've put together a simple reproduction here: https://github.com/jfly/pylint-demo#pylint-checker-naming-issue

Current behavior

In the demo above, a line like this should pass pylint, but instead I get a Bad option value '-no-jfly' (bad-option-value) message. Note that the option value is actually j3-no-jfly, not -no-jfly:

pylint: disable=j3-no-jfly

Expected behavior

I suppose it's possible that Pylint intentionally does not want to support checkers with numbers in their names. That used to be supported, though, so I'd prefer that Pylint support this (as it did in 2.4 and before).

If it is intentional to not support numbers in checker names, then I think it would be nice for this to be explicitly called out in a release note, and I also think the error could be clearer about what's going on.

pylint --version output

(see readme for more information)

$ pylint --version
pylint 2.5.0
astroid 2.4.1
Python 3.8.3 (default, May 17 2020, 18:15:42)
[GCC 10.1.0]

Some digging into how this broke between pylint 2.4.4 and 2.5

As demonstrated here, this worked on Pylint 2.4.4, and started breaking with Pylint 2.5.0. I did some code spelunking, and it looks like this commit 9bdae8b broke support for checkers with numbers in the name. Specifically, it defines MESSAGE_STRING's regex in a way such that numbers are not allowed. One fix may be to just tweak that regex so it allows numbers.

jfly added a commit to jfly/pylint that referenced this issue Jun 5, 2020
jfly added a commit to jfly/pylint-demo that referenced this issue Jun 5, 2020
jfly added a commit to jfly/pylint that referenced this issue Jun 5, 2020
PCManticore pushed a commit that referenced this issue Jun 8, 2020
PCManticore pushed a commit that referenced this issue Jun 8, 2020
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 a pull request may close this issue.

1 participant