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

[BUG] Message id 'W1601' cannot have both 'apply-builtin' and 'using-f-string-in-unsupported-version' as symbolic name #481

Closed
DanielNoord opened this issue Jan 26, 2022 · 10 comments
Labels

Comments

@DanielNoord
Copy link

DanielNoord commented Jan 26, 2022

Describe the bug
pylint-dev/pylint#5723 was opened against pylint. We don't define the apply-builtin message ourselves and I couldn't find it in the prospector repository as well.
I'll gladly help resolve this, but I don't really want to start going through various repositories in search for who defines the message.
So, does anybody know which plugin defines apply-builtin?

To Reproduce
See original issue. Apparently they just load prospector and it crashes.

Expected behavior
No crash.

Environment (please complete the following information):
From original issue:
pylint 2.12.2
astroid 2.9.3
Python 3.7.6 (default, Jan 8 2020, 13:42:34)
[Clang 4.0.1 (tags/RELEASE_401/final)]


As a sidenote, I saw that prospector defines W0313 and W0314. Note that we consider prefixes 00 to 50 as reserved for pylint messages, while 51-99 are reserved for extensions. See: https://github.com/PyCQA/pylint/blob/0fb6a120c6f0fbc94e305542fe29e790274be096/pylint/checkers/__init__.py#L52
We're currently emitting E0313 so we won't use 0313, but 0314 is still unused so we might start emitting it as a warning for a new message as well..
I could open a different issue for this if you want me to, but I just wanted to put this on your radar.

@carlio
Copy link
Member

carlio commented Jan 26, 2022

The only place I can find apply-builtin is from docs for pylint version 1.8 - https://docs.pylint.org/en/1.8/technical_reference/features.html

Prospector doesn't define any pylint messages (it's not a pylint plugin). It will auto-load pylint-django and pylint-celery (and therefore pylint-plugin-utils) but of those, only pylint-django defines new message types and uses a message prefix of 51 specifically to be in the plugin range for pylint messages.

Therefore I have no idea what's going on to be honest except possibly the reporter had an older pylint? I can't find apply-builtin defined anywhere in prospector or related pylint plugins that I maintain.

Edit: never mind I found the indent checker in prospector that I had forgotten about! Those messages should be renamed I agree.

@DanielNoord
Copy link
Author

DanielNoord commented Jan 26, 2022

The only place I can find apply-builtin is from docs for pylint version 1.8 - https://docs.pylint.org/en/1.8/technical_reference/features.html

@renardeinside Tagging you as you were the one who actually reported this. Could it be that you updated your prospector version locally but not your pylint version? Could you do pip install --upgrade pylint and see if the bug persists?

Prospector doesn't define any pylint messages (it's not a pylint plugin). It will auto-load pylint-django and pylint-celery (and therefore pylint-plugin-utils) but of those, only pylint-django defines new message types and uses a message prefix of 51 specifically to be in the plugin range for pylint messages.

Are you sure? IndentChecker seems to define them and it gets loaded in the __init__ of PylintTool.

Edit: @carlio I just saw your edit after posting. Want me to open a new issue for this?

@carlio
Copy link
Member

carlio commented Jan 26, 2022

@DanielNoord Sure, please add a new issue.

@Pierre-Sassoulas
Copy link
Collaborator

Wow, I just realized the problem. We removed a whole set of message when removing the py3k+ checker. But the whole X16YZ block should be considered already used which is not checked in pylint at all. So when we added using-f-string-in-unsupported-version we used a msgid that was already used.

@DanielNoord
Copy link
Author

@Pierre-Sassoulas But do you understand why this is raising issues then? If pylint 2.12.2 no longer defines apply-builtin how can its symbol then still be occupied?

@Pierre-Sassoulas
Copy link
Collaborator

Pierre-Sassoulas commented Jan 26, 2022

As Carlio said:

possibly the reporter had an older pylint?

We did not remove the python 3 checker that long ago, it would not need to be a very old pylint. Maybe even the default debian one would be problematic. I have no idea how it could mix with a new pylint plugin though ? Maybe recovering the plugin code in a new pylint and loading it in the old pylint with load-plugin ?

Although it seem you would need to do something a little exotic for that to happen. we should probably forbid to use the removed legacy name somewhere in pylint. There's also mixed-indentation, bad-whitespace, bad-continuation... Searching for the error code on the net will start to be problematic and confusing if it happens often.

@carlio
Copy link
Member

carlio commented Mar 1, 2022

I'm going to close this because it seems like this is some pylint versioning issue rather than a problem with prospector, and there hasn't been any update about what versions were being run.

(I'm also on a mission to close the backlog of issues :-) )

The related issue which was raised #482 has been fixed and released now.

@Pierre-Sassoulas @DanielNoord if you think this is still an issue with prospector please let me know and I'll re-open and dig further.

@carlio carlio closed this as completed Mar 1, 2022
@DanielNoord
Copy link
Author

@carlio We have implemented some additional checks to make sure we don't reuse deprecated message ids in the future so that should help as well.

A version was disclosed here though pylint-dev/pylint#5723 (comment). Did you see that?

@carlio
Copy link
Member

carlio commented Mar 1, 2022

@DanielNoord actually I do remember seeing that but then I had forgotten after a few weeks of not looking at code! Thanks for reminding me. I think "it works now I updated my env" is enough for me to consider the matter closed unless it happens again and keeps happening.

@DanielNoord
Copy link
Author

@carlio Agreed! I'm going to close the issue as well. Thanks for your help again 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants