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

Ignore class methods signatures with similarities "ignore-signatures" option enabled #4653

Closed
mhumetskyi opened this issue Jul 1, 2021 · 1 comment · Fixed by #4858
Closed
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component
Milestone

Comments

@mhumetskyi
Copy link
Contributor

mhumetskyi commented Jul 1, 2021

Is your feature request related to a problem? Please describe

Initial already closed issue #3619.
One more related closed question with examples #4350.

Similarities "ignore-signatures" option currently only ignores functions' signatures.
Class methods won't be ignored with the current implementation which would be very useful to avoid false-negative duplicate-code errors for classes.

Describe the solution you'd like

With similarities "ignore-signatures" option enabled, class methods' signatures are ignored the same way as functions'.

@mhumetskyi
Copy link
Contributor Author

@Pierre-Sassoulas hi again!
I have opened PR with the proposed solution.

While worked on that I have noticed that function tolineno property may not work correctly, but there is already opened issue for astroid: pylint-dev/astroid#868

We rely on tolineno property only when a function doesn't have a body (== when it has only docstring), so the impact is small.

It's just FYI in case somebody will report an issue that pylint doesn't work well in this case 🙃

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.10.0 milestone Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component
Projects
None yet
2 participants