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

Add bad-dunder-name checker #7642

Merged
merged 10 commits into from
Oct 31, 2022

Conversation

clavedeluna
Copy link
Contributor

Type of Changes

Type
✨ New feature

Description

The new bad-dunder-name checker flags any potentially misspelled known dunder name method and flags any method defined with _..._ that's not one of the pre-defined ones.

If you can think of more test cases, happy to add them.

Closes #3038

@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas added the Enhancement ✨ Improvement to a component label Oct 17, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Oct 17, 2022
pylint/checkers/dunder_methods.py Outdated Show resolved Hide resolved
tests/functional/b/bad_dunder_name.py Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Oct 18, 2022

Pull Request Test Coverage Report for Build 3359652883

  • 27 of 27 (100.0%) changed or added relevant lines in 3 files are covered.
  • 21 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.02%) to 95.377%

Files with Coverage Reduction New Missed Lines %
pylint/extensions/docparams.py 2 98.51%
pylint/checkers/variables.py 19 97.43%
Totals Coverage Status
Change from base Build 3328032636: 0.02%
Covered Lines: 17205
Relevant Lines: 18039

💛 - Coveralls

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It starts to look pretty good 👍

pylint/checkers/dunder_methods.py Outdated Show resolved Hide resolved
pylint/checkers/dunder_methods.py Outdated Show resolved Hide resolved
tests/functional/a/arguments_differ.py Outdated Show resolved Hide resolved
# author likely unintentionally misspelled the correct init dunder.
pass

def _init_(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would raise with the change suggested earlier, I think it make sense.

tests/functional/b/bad_dunder_name.py Outdated Show resolved Hide resolved
pylint/checkers/dunder_methods.py Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas added the Needs review 🔍 Needs to be reviewed by one or multiple more persons label Oct 18, 2022
@DanielNoord
Copy link
Collaborator

I haven't followed discussion or review but was just triggered by the primer. Is this something for an extension? It seems many plugins and packages define non standard dunders (and that's technically allowed by the Python spec just without guarantee that it will always work).

@clavedeluna
Copy link
Contributor Author

I haven't followed discussion or review but was just triggered by the primer. Is this something for an extension? It seems many plugins and packages define non standard dunders (and that's technically allowed by the Python spec just without guarantee that it will always work).

Ok cool, I can make it an extension. @Pierre-Sassoulas does that make the config for good dunder names moot, or do we want both?

@Pierre-Sassoulas
Copy link
Member

I think that if we want this check to be used at all, it needs an option to define what good dunder name are (django for example would probably add __conform__, __html__, etc.). We probably means to define it better somewhere but extensions is something we need to maintain too, so they should at least provide some value.

@clavedeluna
Copy link
Contributor Author

I think that if we want this check to be used at all, it needs an option to define what good dunder name are (django for example would probably add __conform__, __html__, etc.). We probably means to define it better somewhere but extensions is something we need to maintain too, so they should at least provide some value.

Makes sense, so...

does that make the config for good dunder names moot, or do we want both?

? What's your decision?

@Pierre-Sassoulas
Copy link
Member

? What's your decision?

We need the option for good dunder name.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty nice checker @clavedeluna, I think the refactor to put in pylint.constants also make a lot of sense. I'll wait for another reviewer before merging, new checker are always what bring the most issue in a release.

return

# Detect something that could be a bad dunder method
if (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed the discussion here, but is there a reason why we don't check for __? Could _test_ be something private?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A function starting with _ is protected, a function starting with __ is private those should not raise. But _init__ is a bad dunder name that we should detect so a single underscore is enough.

DanielNoord
DanielNoord previously approved these changes Oct 30, 2022
@Pierre-Sassoulas Pierre-Sassoulas dismissed stale reviews from DanielNoord and themself via 6c940a3 October 31, 2022 08:15
@Pierre-Sassoulas Pierre-Sassoulas removed the Needs review 🔍 Needs to be reviewed by one or multiple more persons label Oct 31, 2022
@Pierre-Sassoulas Pierre-Sassoulas enabled auto-merge (squash) October 31, 2022 08:17
@Pierre-Sassoulas
Copy link
Member

Thank you for your work on this checker @clavedeluna, I think this is a nice addition to pylint ! Let's see how it goes, but I'm pretty confident we won't have too much issues opened for this one.

@Pierre-Sassoulas Pierre-Sassoulas merged commit 004fc74 into pylint-dev:main Oct 31, 2022
@github-actions
Copy link
Contributor

🤖 Effect of this PR on checked open source code: 🤖

Effect on django:
The following messages are now emitted:

  1. bad-dunder-name:
    Bad or misspelled dunder method name prepare_class.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/utils/functional.py#L122
  2. bad-dunder-name:
    Bad or misspelled dunder method name promise.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/utils/functional.py#L144
  3. bad-dunder-name:
    Bad or misspelled dunder method name html.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/utils/safestring.py#L16
  4. bad-dunder-name:
    Bad or misspelled dunder method name generate_next_value.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/db/models/enums.py#L91
  5. bad-dunder-name:
    Bad or misspelled dunder method name aiter.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/db/models/query.py#L74
  6. bad-dunder-name:
    Bad or misspelled dunder method name aiter.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/db/models/query.py#L397
  7. bad-dunder-name:
    Bad or misspelled dunder method name aiter.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/db/models/query.py#L2096
  8. bad-dunder-name:
    Bad or misspelled dunder method name conform.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/contrib/gis/db/backends/spatialite/adapter.py#L8
  9. bad-dunder-name:
    Bad or misspelled dunder method name conform.
    https://github.com/django/django/blob/970f61fefb148284fb2af63b5cc844279254111a/django/contrib/gis/db/backends/postgis/adapter.py#L29

Effect on pandas:
The following messages are now emitted:

  1. bad-dunder-name:
    Bad or misspelled dunder method name nonzero.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/generic.py#L1518
  2. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/generic.py#L2061
  3. bad-dunder-name:
    Bad or misspelled dunder method name array_wrap.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/generic.py#L2064
  4. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/generic.py#L2102
  5. bad-dunder-name:
    Bad or misspelled dunder method name repr_latex.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/generic.py#L2168
  6. bad-dunder-name:
    Bad or misspelled dunder method name repr_data_resource.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/generic.py#L2179
  7. bad-dunder-name:
    Bad or misspelled dunder method name finalize.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/generic.py#L5858
  8. bad-dunder-name:
    Bad or misspelled dunder method name dataframe.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/frame.py#L843
  9. bad-dunder-name:
    Bad or misspelled dunder method name repr_fits_vertical.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/frame.py#L1006
  10. bad-dunder-name:
    Bad or misspelled dunder method name repr_fits_horizontal.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/frame.py#L1013
  11. bad-dunder-name:
    Bad or misspelled dunder method name repr_html.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/frame.py#L1087
  12. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/series.py#L822
  13. bad-dunder-name:
    Bad or misspelled dunder method name str_find.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/strings/object_array.py#L241
  14. bad-dunder-name:
    Bad or misspelled dunder method name nonzero.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/internals/managers.py#L215
  15. bad-dunder-name:
    Bad or misspelled dunder method name dlpack.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/interchange/buffer.py#L52
  16. bad-dunder-name:
    Bad or misspelled dunder method name dlpack_device.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/interchange/buffer.py#L60
  17. bad-dunder-name:
    Bad or misspelled dunder method name dlpack.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/interchange/dataframe_protocol.py#L148
  18. bad-dunder-name:
    Bad or misspelled dunder method name dlpack_device.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/interchange/dataframe_protocol.py#L163
  19. bad-dunder-name:
    Bad or misspelled dunder method name dataframe.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/interchange/dataframe_protocol.py#L392
  20. bad-dunder-name:
    Bad or misspelled dunder method name dataframe.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/interchange/dataframe.py#L38
  21. bad-dunder-name:
    Bad or misspelled dunder method name from_arrow.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/string_.py#L181
  22. bad-dunder-name:
    Bad or misspelled dunder method name arrow_array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/string_.py#L373
  23. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/numpy_.py#L130
  24. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/numpy_.py#L133
  25. bad-dunder-name:
    Bad or misspelled dunder method name from_arrow.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/numeric.py#L66
  26. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/interval.py#L1426
  27. bad-dunder-name:
    Bad or misspelled dunder method name arrow_array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/interval.py#L1444
  28. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/period.py#L365
  29. bad-dunder-name:
    Bad or misspelled dunder method name arrow_array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/period.py#L374
  30. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/base.py#L1652
  31. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/datetimes.py#L596
  32. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/string_arrow.py#L154
  33. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/datetimelike.py#L330
  34. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/datetimelike.py#L2050
  35. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/masked.py#L500
  36. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/masked.py#L509
  37. bad-dunder-name:
    Bad or misspelled dunder method name arrow_array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/masked.py#L586
  38. bad-dunder-name:
    Bad or misspelled dunder method name from_arrow.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/boolean.py#L104
  39. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/categorical.py#L1346
  40. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/categorical.py#L1365
  41. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/sparse/array.py#L590
  42. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/sparse/array.py#L1713
  43. bad-dunder-name:
    Bad or misspelled dunder method name from_arrow.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/arrow/dtype.py#L199
  44. bad-dunder-name:
    Bad or misspelled dunder method name arrow_array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/arrow/array.py#L335
  45. bad-dunder-name:
    Bad or misspelled dunder method name arrow_ext_serialize.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/arrow/extension_types.py#L23
  46. bad-dunder-name:
    Bad or misspelled dunder method name arrow_ext_deserialize.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/arrow/extension_types.py#L28
  47. bad-dunder-name:
    Bad or misspelled dunder method name arrow_ext_serialize.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/arrow/extension_types.py#L73
  48. bad-dunder-name:
    Bad or misspelled dunder method name arrow_ext_deserialize.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/arrays/arrow/extension_types.py#L78
  49. bad-dunder-name:
    Bad or misspelled dunder method name from_arrow.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/dtypes/dtypes.py#L1009
  50. bad-dunder-name:
    Bad or misspelled dunder method name from_arrow.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/dtypes/dtypes.py#L1261
  51. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/indexes/base.py#L881
  52. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/indexes/base.py#L887
  53. bad-dunder-name:
    Bad or misspelled dunder method name array_wrap.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/indexes/base.py#L926
  54. bad-dunder-name:
    Bad or misspelled dunder method name nonzero.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/indexes/base.py#L3047
  55. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/core/indexes/multi.py#L1190
  56. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/tests/frame/test_arithmetic.py#L49
  57. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/tests/frame/methods/test_select_dtypes.py#L35
  58. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/tests/dtypes/test_inference.py#L110
  59. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/tests/extension/test_common.py#L20
  60. bad-dunder-name:
    Bad or misspelled dunder method name array_ufunc.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/tests/extension/decimal/array.py#L119
  61. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/tests/extension/json/array.py#L145
  62. bad-dunder-name:
    Bad or misspelled dunder method name array.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/tests/indexes/test_index_new.py#L358
  63. bad-dunder-name:
    Bad or misspelled dunder method name repr_html.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/io/formats/style.py#L379
  64. bad-dunder-name:
    Bad or misspelled dunder method name repr_latex.
    https://github.com/pandas-dev/pandas/blob/4b98e0b99ad3064463f9dc777e46d0b2f249e248/pandas/io/formats/style.py#L388

Effect on pytest:
The following messages are now emitted:

  1. inconsistent-return-statements:
    Either all return statements in a function should return an expression, or none of them should.
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/pytester.py#L301
  2. no-name-in-module:
    No name 'NOSE_SUPPORT_METHOD' in module '_pytest.deprecated'
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/python.py#L62
  3. no-name-in-module:
    No name 'PytestReturnNotNoneWarning' in module '_pytest.warning_types'
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/python.py#L81
  4. inconsistent-return-statements:
    Either all return statements in a function should return an expression, or none of them should.
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/python.py#L1085
  5. inconsistent-return-statements:
    Either all return statements in a function should return an expression, or none of them should.
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/fixtures.py#L130
  6. inconsistent-return-statements:
    Either all return statements in a function should return an expression, or none of them should.
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/python_api.py#L798
  7. no-name-in-module:
    No name 'NOSE_SUPPORT' in module '_pytest.deprecated'
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/nose.py#L5
  8. no-name-in-module:
    No name 'warn_explicit_for' in module '_pytest.warning_types'
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/config/__init__.py#L62
  9. no-member:
    Module '_pytest.deprecated' has no 'HOOK_LEGACY_MARKING' member
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/config/__init__.py#L369
  10. bad-dunder-name:
    Bad or misspelled dunder method name div.
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/_py/path.py#L339
  11. bad-dunder-name:
    Bad or misspelled dunder method name attrs_post_init.
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/_code/code.py#L1005
  12. bad-dunder-name:
    Bad or misspelled dunder method name attrs_post_init.
    https://github.com/pytest-dev/pytest/blob/646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a/src/_pytest/_code/code.py#L1021

Effect on sentry:
The following messages are now emitted:

  1. bad-dunder-name:
    Bad or misspelled dunder method name post__init.
    https://github.com/getsentry/sentry/blob/4be98deb27375dac541740b9c8d7ce871ff2bc99/src/sentry/ratelimits/cardinality.py#L33
  2. bad-dunder-name:
    Bad or misspelled dunder method name post__init.
    https://github.com/getsentry/sentry/blob/4be98deb27375dac541740b9c8d7ce871ff2bc99/src/sentry/ratelimits/sliding_windows.py#L112

This comment was generated for commit 6c940a3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to check for misspellings in special functions
4 participants