Open
Description
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)