-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix false positive for keyword-arg-before-vararg
#8571
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? # to your account
Fix false positive for keyword-arg-before-vararg
#8571
Conversation
β¦l-only parameter with a default value precedes ``*args``. Closes #8570
This comment has been minimized.
This comment has been minimized.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8571 +/- ##
=======================================
Coverage 95.91% 95.91%
=======================================
Files 174 174
Lines 18369 18371 +2
=======================================
+ Hits 17618 17620 +2
Misses 751 751
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
One nit, rest LGTM!
pylint/checkers/typecheck.py
Outdated
@@ -1001,8 +1001,17 @@ def _compiled_generated_members(self) -> tuple[Pattern[str], ...]: | |||
|
|||
@only_required_for_messages("keyword-arg-before-vararg") | |||
def visit_functiondef(self, node: nodes.FunctionDef) -> None: | |||
# check for keyword arg before varargs | |||
"""Check for keyword arg before varargs. |
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.
Bit of a nit but let's keep this as a comment. That makes it easier to later add another check to this visit
method.
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.
Sure! Let me know if it still doesn't look right.
β¦ comment at the top of the method.
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit 0969d7c |
Type of Changes
Description
Fix false positive for
keyword-arg-before-vararg
when a positional-only parameter with a default value precedes*args
.Closes #8570