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

[Backport maintenance/3.1.x] Recognize new-style attrs decorators in too-few-public-methods check #9596

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented May 4, 2024

Backport c032181 from #9346.

…9346)

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`
(#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 #9345.

(cherry picked from commit c032181)
@jacobtylerwalls jacobtylerwalls enabled auto-merge (squash) May 4, 2024 18:20
Copy link

codecov bot commented May 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (maintenance/3.1.x@053c2c3). Click here to learn what that means.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                  @@
##             maintenance/3.1.x    #9596   +/-   ##
====================================================
  Coverage                     ?   95.82%           
====================================================
  Files                        ?      173           
  Lines                        ?    18801           
  Branches                     ?        0           
====================================================
  Hits                         ?    18016           
  Misses                       ?      785           
  Partials                     ?        0           
Files Coverage Δ
pylint/checkers/design_analysis.py 98.90% <100.00%> (ø)

@jacobtylerwalls jacobtylerwalls merged commit b8b9abd into maintenance/3.1.x May 4, 2024
24 checks passed
@jacobtylerwalls jacobtylerwalls deleted the backport-9346-to-maintenance/3.1.x branch May 4, 2024 18:34
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.1.1 milestone May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants