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
Fix crash for unused-private-member
when there are nested attributes
#4783
Fix crash for unused-private-member
when there are nested attributes
#4783
Conversation
42d1c2a
to
49c4bba
Compare
@@ -201,3 +201,19 @@ def __inner_4(): # [unused-private-member] | |||
|
|||
fn_to_return = __inner_1 if flag else __inner_3(__inner_2) | |||
return fn_to_return | |||
|
|||
|
|||
# Test cases for crash reported in #4755 |
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.
That line is more or less obvious from the Github link below. Better to write a short description here. Something like
# https://github.com/PyCQA/pylint/issues/4755
# Nested attributes shouldn't cause crash
(I would also reverse the order and put the link first.)
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.
Fixed this, also added a few overlooked testcases and fixed docs for some of the other test cases i've worked on.
I realise that this might bloat up this PR a little, and I'm sorry for that.
Hope it's okay π
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.
ππ»
add additional test cases and docs for existing tests
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.
π¬ Looks good as well!
Caused tests to fail
for more information, see https://pre-commit.ci
Type of Changes
Description
Added logic to prevent checking attributes of attributes, and only check for the first level of attributes.
Closes #4755