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 Y062: Protocol method arg should not be pos-or-kw #442
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This comment has been minimized.
This comment has been minimized.
pyi.py
Outdated
def check_arg_kinds(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None: | ||
for pos_or_kw in node.args.args[1:]: # exclude "self" | ||
self.error(pos_or_kw, Y062.format(arg=pos_or_kw.arg, method=node.name)) |
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.
This only allows protocols that use PEP-570 syntax, but typeshed doesn't use any PEP-570 syntax yet.
Also, what if it's a public protocol? In that case, it's probably a stub for a "real" protocol that exists at runtime, so stubtest will start complaining if a parameter is positional-only in the stub but positional-or-keyword at runtime. Maybe we should only complain about private protocols, similar to the way we only complain if a protocol/TypeVar/TypedDict is unused if the protocol/TypeVar/TypedDict is private?
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 fixed the code to also handle __
(typeshed-primer was unhappy with me about that).
Not sure about public protocols; it's probably also a bug in the public code. Let's go over the typeshed hits first to see if there are real-world examples of this problem.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This comment has been minimized.
This comment has been minimized.
@@ -1987,6 +1998,12 @@ def check_self_typevars(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> N | |||
return_annotation=return_annotation, | |||
) | |||
|
|||
def check_arg_kinds(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None: | |||
for pos_or_kw in node.args.args[1:]: # exclude "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.
This isn't correct for staticmethods. I think it's questionable anyway to have a staticmethod in a protocol, but there's at least one in the standard library (email.headerregistry._HeaderParser.value_parser
).
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.
if we want to disallow staticmethods in protocols, I feel like that should probably be a dedicated error code -- I lean towards saying check should probably handle staticmethods in protocols in a principled way?
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.
Yes, I should change the code here to handle staticmethods correctly. It's worth thinking about whether we should lint against staticmethods in protocols, but that should be an independent change.
I'm going to hold off on updating this PR for a while though until I can get the typeshed-primer hits down a bit.
Some of the fallout from PyCQA/flake8-pyi#442. In each case, I looked at CPython to check how the protocol is being used.
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This comment has been minimized.
This comment has been minimized.
⚠ Flake8 diff showing the effect of this PR on typeshed: > ./stdlib/codecs.pyi:93:24: Y062 Argument "errors" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/codecs.pyi:96:24: Y062 Argument "errors" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/abc.pyi:157:29: Y062 Argument "encoding" to protocol method "read_text" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:9:28: Y062 Argument "item" to protocol method "__contains__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:10:27: Y062 Argument "key" to protocol method "__getitem__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:15:23: Y062 Argument "name" to protocol method "get_all" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:15:34: Y062 Argument "failobj" to protocol method "get_all" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:17:23: Y062 Argument "name" to protocol method "get_all" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:17:34: Y062 Argument "failobj" to protocol method "get_all" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:20:23: Y062 Argument "name" to protocol method "get" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:20:34: Y062 Argument "failobj" to protocol method "get" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:22:23: Y062 Argument "name" to protocol method "get" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/importlib/metadata/_meta.pyi:22:34: Y062 Argument "failobj" to protocol method "get" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:100:13: Y062 Argument "path" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:101:13: Y062 Argument "ignore_errors" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:102:13: Y062 Argument "onerror" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:110:13: Y062 Argument "path" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:111:13: Y062 Argument "ignore_errors" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:112:13: Y062 Argument "onerror" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:120:13: Y062 Argument "path" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:121:13: Y062 Argument "ignore_errors" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:122:13: Y062 Argument "onerror" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:129:19: Y062 Argument "path" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:129:41: Y062 Argument "ignore_errors" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stdlib/shutil.pyi:129:70: Y062 Argument "onerror" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/__init__.pyi:19:24: Y062 Argument "handler" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/__init__.pyi:22:24: Y062 Argument "exception_handler" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:10:29: Y062 Argument "event" to protocol method "trigger_event" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:16:9: Y062 Argument "event" to protocol method "emit" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:17:9: Y062 Argument "data" to protocol method "emit" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:18:9: Y062 Argument "to" to protocol method "emit" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:19:9: Y062 Argument "room" to protocol method "emit" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:20:9: Y062 Argument "skip_sid" to protocol method "emit" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:21:9: Y062 Argument "namespace" to protocol method "emit" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:22:9: Y062 Argument "callback" to protocol method "emit" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:23:9: Y062 Argument "ignore_queue" to protocol method "emit" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:27:9: Y062 Argument "data" to protocol method "send" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:28:9: Y062 Argument "to" to protocol method "send" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:29:9: Y062 Argument "room" to protocol method "send" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:30:9: Y062 Argument "skip_sid" to protocol method "send" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:31:9: Y062 Argument "namespace" to protocol method "send" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:32:9: Y062 Argument "callback" to protocol method "send" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:33:9: Y062 Argument "ignore_queue" to protocol method "send" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:37:9: Y062 Argument "event" to protocol method "call" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:38:9: Y062 Argument "data" to protocol method "call" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:39:9: Y062 Argument "to" to protocol method "call" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:40:9: Y062 Argument "sid" to protocol method "call" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:41:9: Y062 Argument "namespace" to protocol method "call" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:42:9: Y062 Argument "timeout" to protocol method "call" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:43:9: Y062 Argument "ignore_queue" to protocol method "call" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:45:26: Y062 Argument "sid" to protocol method "enter_room" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:45:31: Y062 Argument "room" to protocol method "enter_room" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:45:42: Y062 Argument "namespace" to protocol method "enter_room" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:46:26: Y062 Argument "sid" to protocol method "leave_room" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:46:31: Y062 Argument "room" to protocol method "leave_room" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:46:42: Y062 Argument "namespace" to protocol method "leave_room" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:47:26: Y062 Argument "room" to protocol method "close_room" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:47:37: Y062 Argument "namespace" to protocol method "close_room" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:48:21: Y062 Argument "sid" to protocol method "rooms" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:48:26: Y062 Argument "namespace" to protocol method "rooms" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:49:27: Y062 Argument "sid" to protocol method "get_session" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:49:32: Y062 Argument "namespace" to protocol method "get_session" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:50:28: Y062 Argument "sid" to protocol method "save_session" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:50:33: Y062 Argument "session" to protocol method "save_session" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:50:42: Y062 Argument "namespace" to protocol method "save_session" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:51:23: Y062 Argument "sid" to protocol method "session" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:51:28: Y062 Argument "namespace" to protocol method "session" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:52:26: Y062 Argument "sid" to protocol method "disconnect" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Flask-SocketIO/flask_socketio/namespace.pyi:52:31: Y062 Argument "namespace" to protocol method "disconnect" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Pillow/PIL/ImageFont.pyi:15:63: Y062 Argument "direction" to protocol method "getmask" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/Pillow/PIL/ImageFont.pyi:15:78: Y062 Argument "features" to protocol method "getmask" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/WebOb/webob/response.pyi:18:9: Y062 Argument "seconds" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/cffi/_cffi_backend.pyi:11:24: Y062 Argument "cdecl" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/cffi/_cffi_backend.pyi:11:44: Y062 Argument "init" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/fpdf2/fpdf/_fonttools_shims.pyi:10:24: Y062 Argument "glyphSet" to protocol method "__init__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/fpdf2/fpdf/_fonttools_shims.pyi:10:47: Y062 Argument "glyphName" to protocol method "__init__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/fpdf2/fpdf/_fonttools_shims.pyi:11:20: Y062 Argument "pen" to protocol method "draw" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/fpdf2/fpdf/_fonttools_shims.pyi:12:26: Y062 Argument "pen" to protocol method "drawPoints" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/__init__.pyi:208:22: Y062 Argument "iterator" to protocol method "filter" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/__init__.pyi:701:23: Y062 Argument "num" to protocol method "hscroll" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/__init__.pyi:702:23: Y062 Argument "num" to protocol method "vscroll" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/__init__.pyi:703:21: Y062 Argument "x" to protocol method "click" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/__init__.pyi:703:29: Y062 Argument "y" to protocol method "click" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/__init__.pyi:703:37: Y062 Argument "button" to protocol method "click" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/xmethod.pyi:31:24: Y062 Argument "name" to protocol method "__init__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/xmethod.pyi:32:21: Y062 Argument "class_type" to protocol method "match" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/gdb/gdb/xmethod.pyi:32:43: Y062 Argument "method_name" to protocol method "match" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/greenlet/greenlet/_greenlet.pyi:22:23: Y062 Argument "obj" to protocol method "__get__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/greenlet/greenlet/_greenlet.pyi:22:38: Y062 Argument "owner" to protocol method "__get__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/greenlet/greenlet/_greenlet.pyi:23:23: Y062 Argument "obj" to protocol method "__set__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/greenlet/greenlet/_greenlet.pyi:23:38: Y062 Argument "value" to protocol method "__set__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/_typing.pyi:9:24: Y062 Argument "validator" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/_typing.pyi:9:46: Y062 Argument "value" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/_typing.pyi:9:58: Y062 Argument "instance" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/_typing.pyi:9:73: Y062 Argument "schema" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:21:9: Y062 Argument "schema" to protocol method "__init__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:22:9: Y062 Argument "resolver" to protocol method "__init__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:23:9: Y062 Argument "format_checker" to protocol method "__init__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:26:27: Y062 Argument "schema" to protocol method "check_schema" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:27:23: Y062 Argument "instance" to protocol method "is_type" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:27:49: Y062 Argument "type" to protocol method "is_type" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:28:24: Y062 Argument "instance" to protocol method "is_valid" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:29:27: Y062 Argument "instance" to protocol method "iter_errors" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/jsonschema/jsonschema/protocols.pyi:30:24: Y062 Argument "instance" to protocol method "validate" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/openpyxl/openpyxl/descriptors/sequence.pyi:16:24: Y062 Argument "node" to protocol method "from_tree" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/paramiko/paramiko/transport.pyi:24:26: Y062 Argument "ptype" to protocol method "parse_next" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/paramiko/paramiko/transport.pyi:24:38: Y062 Argument "m" to protocol method "parse_next" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pika/pika/adapters/twisted_connection.pyi:132:24: Y062 Argument "parameters" to protocol method "__init__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pika/pika/adapters/twisted_connection.pyi:132:61: Y062 Argument "custom_reactor" to protocol method "__init__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pika/pika/adapters/twisted_connection.pyi:133:23: Y062 Argument "channel_number" to protocol method "channel" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pika/pika/adapters/twisted_connection.pyi:138:21: Y062 Argument "reply_code" to protocol method "close" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pika/pika/adapters/twisted_connection.pyi:138:44: Y062 Argument "reply_text" to protocol method "close" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pika/pika/adapters/twisted_connection.pyi:139:28: Y062 Argument "data" to protocol method "dataReceived" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pika/pika/adapters/twisted_connection.pyi:140:30: Y062 Argument "reason" to protocol method "connectionLost" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pika/pika/adapters/twisted_connection.pyi:141:30: Y062 Argument "transport" to protocol method "makeConnection" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pyserial/serial/threaded/__init__.pyi:18:29: Y062 Argument "packet" to protocol method "handle_packet" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pyserial/serial/threaded/__init__.pyi:26:29: Y062 Argument "packet" to protocol method "handle_packet" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/pyserial/serial/threaded/__init__.pyi:27:41: Y062 Argument "data" to protocol method "handle_out_of_packet_data" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/redis/redis/asyncio/client.pyi:20:24: Y062 Argument "response" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/redis/redis/asyncio/client.pyi:23:30: Y062 Argument "response" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/redis/redis/asyncio/client.pyi:283:24: Y062 Argument "e" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/redis/redis/asyncio/client.pyi:283:42: Y062 Argument "pubsub" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/redis/redis/asyncio/client.pyi:286:30: Y062 Argument "e" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/redis/redis/asyncio/client.pyi:286:48: Y062 Argument "pubsub" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/redis/redis/asyncio/connection.pyi:68:24: Y062 Argument "connection" to protocol method "__call__" should probably not be positional-or-keyword. Make it positional-only, since usually you don't want to mandate a specific argument name
> ./stubs/redis/red
... (truncated 69 lines) ...
|
(#449 bagged Y062, so this will have to be Y063 now :) |
Fixes #441