Skip to content

Add future=True to all NodeNG.frame calls #5621

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

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

DanielNoord
Copy link
Collaborator

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Write a good description on what the PR does.

Type of Changes

Type
🔨 Refactoring

Description

Follow up to changes in astroid 2.9.1.

Sorry, something went wrong.

@DanielNoord DanielNoord added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Dec 31, 2021
@DanielNoord DanielNoord added this to the 2.13.0 milestone Dec 31, 2021
@DanielNoord
Copy link
Collaborator Author

Not sure if this should be the PR to update the astroid version, but it could be.

@coveralls
Copy link

coveralls commented Dec 31, 2021

Pull Request Test Coverage Report for Build 1663088065

  • 54 of 54 (100.0%) changed or added relevant lines in 14 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.702%

Totals Coverage Status
Change from base Build 1662483525: 0.0%
Covered Lines: 14358
Relevant Lines: 15323

💛 - Coveralls

Copy link
Member

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @DanielNoord 🐬

Comment on lines 1661 to 1664
try:
frame_name = node.frame().name
frame_name = node.frame(future=True).name
except AttributeError:
return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we catch ParentMissingError here now too? Usually it should never happen unless we or a plugin screws up. In that case we would need to catch it for every other call as well which is just unnecessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also just remove it?

We don't cover it right now: https://coveralls.io/builds/45308622/source?filename=pylint%2Fcheckers%2Fclasses%2Fclass_checker.py

The commit that added it also doesn't talk about a plugin doing this wrong or anything: 5309e1d
The code from the original issue did raise an AttributeError but the fact that we no longer cover it and those tests had been added means (I think) that we handle those cases better in an earlier function and we never reach this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, let's remove it! If a plugin screws up, it's better to surface the error than to ignore it silently.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat !

@Pierre-Sassoulas Pierre-Sassoulas merged commit f3ece3f into pylint-dev:main Jan 10, 2022
@DanielNoord
Copy link
Collaborator Author

@Pierre-Sassoulas I don't think this was completely ready to merge. #5621 (comment) wasn't resolved yet 😉

@Pierre-Sassoulas
Copy link
Member

My bad I got overexcited with all those approved MR :D maybe we don't need to revert everything and we can do a follow-up instead ?

@DanielNoord DanielNoord deleted the frame branch January 11, 2022 09:05
@DanielNoord
Copy link
Collaborator Author

Yeah no problem. Do we want to remove the except indeed?

@DanielNoord
Copy link
Collaborator Author

See #5664 in case we want to go ahead with this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants