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.
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
Make
consider-iterating-dictionary
consider memb. check #4997Make
consider-iterating-dictionary
consider memb. check #4997Changes from 3 commits
400f8d7
82cd6dc
0b40b49
556d627
5a3b8e9
46ade44
6a77424
aae8afc
d8bf54c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to change the name than add an additional disable here.
However, I don't see
var
inbad-names
in./pylintrc
.Furthermore, this doesn't explain why this is only being thrown in the CI. The tests pass locally for me (and I think also for @cdce8p). Probably should try and investigate what is exactly causing this before adding a disable.
@cdce8p seems to have an idea, or at least has located the source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to replicate the failure when running under tox: (
tox -e py36 -- -k consider_iterating
). Sorry about jumping in, I was just pinged by the mention of pylint-dev/astroid#979There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to add
--recreate
, which you probably did some time before. Can now indeed reproduce.I can change this to another variable name. Can somebody tell me where
pylint
is getting thebad-names list
from? I'm probably overlooking something..Edit: Got it. It is because
var
is lowercase, uppercase fixes the issue. Pushing now!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As to why this shows up after that merge on astroid, my reading of https://github.com/PyCQA/pylint/blob/bc95cd34071ec2e71de5bca8ff95cc9b88e23814/pylint/checkers/base.py#L1975-L1984 is that
invalid-name
is only emitted if the Assign.value
can be inferred. SinceCompare
nodes are only just now inferred, these popped up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems I mixed up
invalid-name
withdisallowed-name
myself.var
is fine to us, but here it's inferred as constant which should be uppercase (like @DanielNoord mentioned).pylint-dev/astroid#979 added additional inference for
compare
nodes which is why these can now correctly be inferred as constants. Thusinvalid-name
is emitted now.Sorry for the ping @nelfin.