Skip to content

do not report too-few-public-methods for attr.s, attr.dataclass, typing.NamedTuple and similar.  #3732

Open
@graingert

Description

@graingert

do not report too-few-public-methods for attr.s, attr.dataclass, typing.NamedTuple and similar.

example:

import attr

@attr.dataclass(frozen=True)  # pylint-ignore: too-few-public-methods
class Foo:
    ham: str
    spam: str

@uriva As mentioned by @matkoniecz in most cases the check makes sense. If your class has a single method on it, it's probably a function in disguise. You can also configure the number of public methods with min-public-methods. But there are a couple of classes for which we should not report this, as it makes perfect sense to not have too many methods or no methods at all. This includes attrs, dataclasses, typing.NamedTuple and similar.

Originally posted by @PCManticore in #2710 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentGood first issueFriendly and approachable by new contributorsHacktoberfestHelp wanted 🙏Outside help would be appreciated, good for new contributorsHigh priorityIssue with more than 10 reactionsNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions