-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New-style attrs decorators not recognized as data class decorators #9345
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Milestone
Comments
akirchhoff-modular
added a commit
to akirchhoff-modular/pylint
that referenced
this issue
Jan 4, 2024
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.
jacobtylerwalls
pushed a commit
that referenced
this issue
May 4, 2024
…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.
github-actions bot
pushed a commit
that referenced
this issue
May 4, 2024
…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
pushed a commit
that referenced
this issue
May 4, 2024
…9346) (#9596) 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) Co-authored-by: akirchhoff-modular <github-work@kirchhoff.digital>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Bug description
Beginning with attrs 21.1.0, the recommended way to use attrs is through
import attrs
and usingattrs.define
/attrs.frozen
, notimport attr
andattr.s
orattr.attrs
. Pylint does understandattr.attrs
(#2988), but new-style uses of attrs are not understood to be data class decorators.Configuration
No response
Command used
Pylint output
Expected behavior
I expect the code to pass pylint without triggering the
too-few-public-methods
check.Pylint version
OS / Environment
No response
Additional dependencies
The text was updated successfully, but these errors were encountered: