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

Add configurable suppressions for classes based on inheritance (for use with typing.Protocol, typing.NamedTuple, dataclass, etc.) #8788

Open
emirkmo opened this issue Jun 20, 2023 · 0 comments
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling

Comments

@emirkmo
Copy link

emirkmo commented Jun 20, 2023

Why?

It would resolve high priority issue #3732, among many others. Pylint complaints on classes that are primarily used with type hinting or with data containers are not valid. It is very tedious to disable multiple checks such as too few public methods manually on all of these classes. (Not to mention preferences with docstrings for code meant just for typing and that should occupy as little screen real estate as possible).

Opening up this more generic issue because the other one is too specific, but there are more uses for inheritance-relationship or class-name based suppression.

Request

Add a way to configure disables for a category of classes based on inheritance-relationship or class-name.

Features

Ideally, the classes to customize can be specified by name, metaclass, and parent class.

See original comment by @earonesty :

Configurable suppressions for classes would be generally useful:

Simple config override in .pylintrc for classes that:

# [CLASSRULES.<CUSTOM_NAME>]
# metaclass_match=<metaclass_regex>
# parent_match=<parent_regex>
# disable=list,of,disables

Would solve a lot of these issues.

Originally posted by @earonesty in #3732 (comment)

@emirkmo emirkmo changed the title Add configurable suppressions for classes (for use with typing.Protocol, typing.NamedTuple, dataclass, etc.) Add configurable suppressions for classes based on inheritance (for use with typing.Protocol, typing.NamedTuple, dataclass, etc.) Jun 20, 2023
@jacobtylerwalls jacobtylerwalls added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling
Projects
None yet
Development

No branches or pull requests

2 participants