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

Remove unused visit_package function #4952

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

DanielNoord
Copy link
Collaborator

Type
βœ“ πŸ”¨ Refactoring

Description

See:

I'm not too familiar with the pyreverse code, but even if it isn't called anymore, we shouldn't remove it here. That should be done in a separate PR.

Originally posted by @cdce8p in #4940 (comment)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1190951887

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 93.088%

Totals Coverage Status
Change from base Build 1189311027: 0.03%
Covered Lines: 13211
Relevant Lines: 14192

πŸ’› - Coveralls

@Pierre-Sassoulas
Copy link
Member

@DudeNr33 what do you think ?

@DudeNr33
Copy link
Collaborator

DudeNr33 commented Sep 1, 2021

It indeed seems like this method is never executed.
I removed it locally and ran pyreverse over the codebase without issues.
When adding some logging to the method and running pyreverse no output appears.
This is probably because the underlying ASTWalker class determines the method to call for the visit of each node by doing a getattr(handler, f"visit_{kid}"), where kid is the lowercase class name of the astroid node.
And since astroid does not have a node class named "Package", this method is never called.

So I say go for it!

As a side note for a potential future cleanup MR, while looking at the code I noticed that the whole tagging logic of the nodes has become obsolete in the Linker class, as we now use fully qualified names in the output files.

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.

I'm trusting the current leading expert in pyreverse on that one :)

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.11.0 milestone Sep 1, 2021
@Pierre-Sassoulas Pierre-Sassoulas added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Sep 1, 2021
@Pierre-Sassoulas Pierre-Sassoulas merged commit e49c3b1 into pylint-dev:main Sep 1, 2021
@DanielNoord DanielNoord deleted the visit-package branch September 8, 2021 19:31
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.

4 participants