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

use-symbolic-message-instead should be case-insensitive for numerical IDs #5000

Closed
Igetin opened this issue Sep 14, 2021 · 2 comments · Fixed by #5001
Closed

use-symbolic-message-instead should be case-insensitive for numerical IDs #5000

Igetin opened this issue Sep 14, 2021 · 2 comments · Fixed by #5001
Labels
Bug 🪲 False Negative 🦋 No message is emitted but something is wrong with the code
Milestone

Comments

@Igetin
Copy link

Igetin commented Sep 14, 2021

Bug description

When use-symbolic-message-instead is enabled, Pylint will correctly warn about the usage of non-symbolic ID in pragmas, like here.

# pylint: disable=W0223

This will output I0023: 'W0223' is cryptic: use '# pylint: disable=abstract-method' instead (use-symbolic-message-instead).

But if the category letter of the ID is written in lower case, like here:

# pylint: disable=w0223

Pylint will not output the warning about not using a symbolic message.

Configuration

[MASTER]
enable=use-symbolic-message-instead

Command used

pylint test.py

Pylint output

No output.

Expected behavior

Since Pylint does allow lower case in the pragmas that use a numeric ID (e.g. w0223), having use-symbolic-message-instead enabled should also output a message regardless of the case of the ID used in the disable pragma.

Pylint version

pylint 2.10.2
astroid 2.7.3
Python 3.8.10 (default, May  4 2021, 00:00:00) 
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)]

OS / Environment

No response

Additional dependencies

No response

@Igetin Igetin added Bug 🪲 Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Sep 14, 2021
@Pierre-Sassoulas Pierre-Sassoulas added False Negative 🦋 No message is emitted but something is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Sep 14, 2021
@Pierre-Sassoulas
Copy link
Member

Thank you for opening the issue, I can reproduce that. Strangely c0111 works but not w0223. Might be harder to troubleshoot than I thought.

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.11.0 milestone Sep 14, 2021
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this issue Sep 14, 2021
@Pierre-Sassoulas
Copy link
Member

It was due to C0111 being correctly capitalized once in the functional test I was using. It should be fixed in 2.11 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 False Negative 🦋 No message is emitted but something is wrong with the code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants