microsoft / pyright

Static Type Checker for Python
Other
13.12k stars 1.4k forks source link

Improved consistency of parameter name restrictions for the `reportSe… #8720

Closed erictraut closed 1 month ago

erictraut commented 1 month ago

…lfClsParameterNamecheck. Previously, different rules were applied tonew` and class methods within metaclasses. This addresses #8717.

github-actions[bot] commented 1 month ago

Diff from mypy_primer, showing the effect of this PR on open source code:

pandera (https://github.com/pandera-dev/pandera)
- /tmp/mypy_primer/projects/pandera/tests/test_inspection_utils.py
-   /tmp/mypy_primer/projects/pandera/tests/test_inspection_utils.py:20:27 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
-   /tmp/mypy_primer/projects/pandera/tests/core/test_decorators.py:1110:13 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
- 2442 errors, 25 warnings, 0 informations 
+ 2442 errors, 23 warnings, 0 informations 

scrapy (https://github.com/scrapy/scrapy)
+   /tmp/mypy_primer/projects/scrapy/scrapy/utils/deprecate.py:62:13 - warning: __new__ override should take a "cls" parameter (reportSelfClsParameterName)
- 2103 errors, 132 warnings, 0 informations 
+ 2103 errors, 133 warnings, 0 informations 

pytest (https://github.com/pytest-dev/pytest)
-   /tmp/mypy_primer/projects/pytest/testing/test_monkeypatch.py:376:19 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
- 774 errors, 40 warnings, 0 informations 
+ 774 errors, 39 warnings, 0 informations