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

Recognize new-style attrs decorators in too-few-public-methods check #9346

Merged

Commits on Jan 4, 2024

  1. Recognize new-style attrs decorators in too-few-public-methods check

    Beginning with attrs 21.1.0, the recommended way to use attrs is through
    `import attrs` and using `attrs.define`/`attrs.frozen`, not `import
    attr` and `attr.s` or `attr.attrs`. Pylint does understand `attr.attrs`
    (pylint-dev#2988), but new-style uses of attrs are not understood to be data class
    decorators.
    
    Modify `_is_exempt_from_public_methods` to recognize `attrs.define` and
    `attrs.frozen` in a similar way as is currently done with
    `dataclasses.dataclass`.
    
    Closes pylint-dev#9345.
    akirchhoff-modular committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    86f4378 View commit details
    Browse the repository at this point in the history