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

Count ancestors only in user code #3057

Closed
GoldsteinE opened this issue Aug 12, 2019 · 1 comment · Fixed by #4758
Closed

Count ancestors only in user code #3057

GoldsteinE opened this issue Aug 12, 2019 · 1 comment · Fixed by #4758
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component
Milestone

Comments

@GoldsteinE
Copy link

Is your feature request related to a problem? Please describe

Sometimes I need to inherit from classes defined in third-party libs. Sometimes these classes have long inheritance chain. I can't do anything about this, but still get too-many-ancestors.

Describe the solution you'd like

I want there was an option to count ancestors only in "local" code, so pylint will complain only about the part of problem I can fix.

Additional context

Here's example where it would be useful: https://stackoverflow.com/questions/22834392/understanding-too-many-ancestors-from-pylint/43090406

@PCManticore
Copy link
Contributor

Thanks, I think this sounds like a sensible approach.

@PCManticore PCManticore added Checkers Related to a checker Enhancement ✨ Improvement to a component labels Aug 16, 2019
9999years pushed a commit to 9999years/pylint that referenced this issue Jul 27, 2021
This allows users to specify classes to ignore while counting parent
classes.

Partially closes pylint-dev#3057
9999years pushed a commit to 9999years/pylint that referenced this issue Jul 27, 2021
This allows users to specify classes to ignore while counting parent
classes.

Partially closes pylint-dev#3057
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.10.0 milestone Jul 28, 2021
Pierre-Sassoulas added a commit that referenced this issue Jul 28, 2021
* Add ignored-parents option to design checker

This allows users to specify classes to ignore while counting parent
classes.

Partially closes #3057

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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
Development

Successfully merging a pull request may close this issue.

3 participants