-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Update arguments to parameters (Additional) [1]
#20711
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
arguments to parameters related to ARGUMENT_TYPE_EXPECTEDarguments to parameters related to ARGUMENT_TYPE_EXPECTED and MISSING_OR_INVALID_SELF_TYPE
mypy/message_registry.py
Outdated
| # Self-type | ||
| MISSING_OR_INVALID_SELF_TYPE: Final = ErrorMessage( | ||
| "Self argument missing for a non-static method (or an invalid type for self)" | ||
| "self parameter missing for a non-static method (or an invalid type for self)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also changed Self to self which is actually used as a parameter because It's more understandable:
class Cls: # ↓↓↓↓
def method(self) -> None: ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be more consistent to use "self" parameter ... if using the lower-case version. I'd prefer it it was either quoted this way (we use double quotes) or unchanged from original, with capitalized 'Self'.
This comment has been minimized.
This comment has been minimized.
arguments to parameters related to ARGUMENT_TYPE_EXPECTED and MISSING_OR_INVALID_SELF_TYPEarguments to parameters (Additional) 1
arguments to parameters (Additional) 1arguments to parameters (Additional) [1]
This comment has been minimized.
This comment has been minimized.
JukkaL
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this makes the terminology more consistent. Mostly looks good.
mypy/message_registry.py
Outdated
| # Self-type | ||
| MISSING_OR_INVALID_SELF_TYPE: Final = ErrorMessage( | ||
| "Self argument missing for a non-static method (or an invalid type for self)" | ||
| "self parameter missing for a non-static method (or an invalid type for self)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be more consistent to use "self" parameter ... if using the lower-case version. I'd prefer it it was either quoted this way (we use double quotes) or unchanged from original, with capitalized 'Self'.
|
Diff from mypy_primer, showing the effect of this PR on open source code: colour (https://github.com/colour-science/colour)
- colour/characterisation/aces_it.py:975: error: Ellipses cannot accompany other argument types in function type signature [syntax]
+ colour/characterisation/aces_it.py:975: error: Ellipses cannot accompany other parameter types in function type signature [syntax]
cki-lib (https://gitlab.com/cki-project/cki-lib)
- cki_lib/metrics/server.py:8: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/metrics/server.py:8: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/s3bucket.py:18: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/s3bucket.py:18: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/kcidb/validate.py:49: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/kcidb/validate.py:49: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/kcidb/validate.py:137: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/kcidb/validate.py:137: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/cki_pipeline.py:199: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/cki_pipeline.py:199: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/messagequeue.py:269: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/messagequeue.py:269: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/messagequeue.py:338: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/messagequeue.py:338: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/messagequeue.py:389: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/messagequeue.py:389: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- cki_lib/messagequeue.py:447: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ cki_lib/messagequeue.py:447: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- tests/kcidb/test_checks.py:193: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ tests/kcidb/test_checks.py:193: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- tests/kcidb/test_checks.py:207: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ tests/kcidb/test_checks.py:207: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
steam.py (https://github.com/Gobot1234/steam.py)
- steam/_const.py:73: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/_const.py:73: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- steam/utils.py:167: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/utils.py:167: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- steam/utils.py:173: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/utils.py:173: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- steam/utils.py:221: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/utils.py:221: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- steam/utils.py:227: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ steam/utils.py:227: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
discord.py (https://github.com/Rapptz/discord.py)
- discord/client.py:1887: error: Self argument missing for a non-static method (or an invalid type for self) [misc]
+ discord/client.py:1887: error: "self" parameter missing for a non-static method (or an invalid type for self) [misc]
- discord/client.py:1897: error: Self argument missing for a non-static method (or an invalid type for self) [misc]
+ discord/client.py:1897: error: "self" parameter missing for a non-static method (or an invalid type for self) [misc]
pyodide (https://github.com/pyodide/pyodide)
- pyodide-build/pyodide_build/common.py:298: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/common.py:298: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/common.py:440: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/common.py:440: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/common.py:452: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/common.py:452: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/common.py:463: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/common.py:463: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/recipe/skeleton.py:237: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/recipe/skeleton.py:237: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/recipe/skeleton.py:246: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/recipe/skeleton.py:246: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/tests/test_cli_xbuildenv.py:29: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/tests/test_cli_xbuildenv.py:29: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/recipe/builder.py:781: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/recipe/builder.py:781: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/tests/recipe/test_graph_builder.py:133: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/tests/recipe/test_graph_builder.py:133: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/tests/recipe/test_graph_builder.py:161: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/tests/recipe/test_graph_builder.py:161: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- pyodide-build/pyodide_build/tests/test_cli.py:299: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyodide-build/pyodide_build/tests/test_cli.py:299: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
pandera (https://github.com/pandera-dev/pandera)
- tests/pandas/test_model.py:47: error: Self argument missing for a non-static method (or an invalid type for self) [misc]
+ tests/pandas/test_model.py:47: error: "self" parameter missing for a non-static method (or an invalid type for self) [misc]
- tests/pandas/test_model.py:52: error: Self argument missing for a non-static method (or an invalid type for self) [misc]
+ tests/pandas/test_model.py:52: error: "self" parameter missing for a non-static method (or an invalid type for self) [misc]
artigraph (https://github.com/artigraph/artigraph)
- src/arti/internal/models.py:146: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ src/arti/internal/models.py:146: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
- src/arti/internal/models.py:150: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ src/arti/internal/models.py:150: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
pyppeteer (https://github.com/pyppeteer/pyppeteer)
- pyppeteer/launcher.py:222: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
+ pyppeteer/launcher.py:222: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
Fix: #20683
I changed
argumentstoparametersin the error messages of these constants below and I also changed some names of constants: