-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add Enum dunder to the list of allowed dunder #10722
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
Changes from all commits
b7484c4
8a1846a
cf2ed83
77b90cd
0942223
33ada01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Add Enum dunder methods ``_generate_next_value_``, ``_missing_``, ``_numeric_repr_``, ``_add_alias_``, and ``_add_value_alias_`` to the list passed to ``--good-dunder-names``. | ||
|
|
||
| Closes #10435 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -219,26 +219,31 @@ def _get_pylint_home() -> str: | |||||
| "__anext__": "Use anext built-in function", | ||||||
| }, | ||||||
| } | ||||||
|
|
||||||
| EXTRA_DUNDER_METHODS = [ | ||||||
| "__new__", | ||||||
| "__subclasses__", | ||||||
| "__init_subclass__", | ||||||
| "__set_name__", | ||||||
| "__class_getitem__", | ||||||
| "__missing__", | ||||||
| "__exit__", | ||||||
| "__await__", | ||||||
| "__aexit__", | ||||||
| "__getnewargs_ex__", | ||||||
| "__getnewargs__", | ||||||
| "__getstate__", | ||||||
| "__index__", | ||||||
| "__setstate__", | ||||||
| "__reduce__", | ||||||
| "__reduce_ex__", | ||||||
| "__post_init__", # part of `dataclasses` module | ||||||
| ] | ||||||
| EXTRA_DUNDER_METHODS: dict[tuple[int, int], list[str]] = { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it could be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi @mbyrnepr2, I think that'll work too but it'll be
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Would this work?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes I think that will work. Thank you for the suggestion. |
||||||
| (0, 0): [ | ||||||
| "__new__", | ||||||
| "__subclasses__", | ||||||
| "__init_subclass__", | ||||||
| "__set_name__", | ||||||
| "__class_getitem__", | ||||||
| "__missing__", | ||||||
| "__exit__", | ||||||
| "__await__", | ||||||
| "__aexit__", | ||||||
| "__getnewargs_ex__", | ||||||
| "__getnewargs__", | ||||||
| "__getstate__", | ||||||
| "__index__", | ||||||
| "__setstate__", | ||||||
| "__reduce__", | ||||||
| "__reduce_ex__", | ||||||
| "__post_init__", # part of `dataclasses` module | ||||||
| "_generate_next_value_", | ||||||
| "_missing_", | ||||||
| "_numeric_repr_", | ||||||
| ], | ||||||
| (3, 13): ["_add_alias_", "_add_value_alias_"], | ||||||
| } | ||||||
|
|
||||||
| DUNDER_PROPERTIES = [ | ||||||
| "__class__", | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.