pylint icon indicating copy to clipboard operation
pylint copied to clipboard

Accept regexes in ignored-parents

Open avylove opened this issue 2 years ago • 0 comments

Current problem

I'm currently linting a code base which heavily uses a library that loves mixins raising multiple failures for too-many-ancestors. While I can use the ignored-parents option to tune this, I have to find the qualified name of the parents and maintain this list as the code changes.

Desired solution

Support regexes in ignored-parents. This would allow entries like mixin_lover\..* or mixin_lover\.mixins\..* Putting these in another option would be fine too. I'm not sure it's necessary unless that's more consistent with other options.

Now that I'm writing this, another approach would be an option like ignored-parent-modules where module and package names can be listed. So for the above example mixin_lover or mixin_lover.mixins. This allows for cleaner, less confusing syntax. It's less flexible, but more flexible than the current option.

Additional context

No response

avylove avatar Sep 22 '22 13:09 avylove