-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix a false negative for duplicate-argument-name
#9670
Merged
DanielNoord
merged 7 commits into
pylint-dev:main
from
mbyrnepr2:9669_false_negative_duplicate_argument_name
Jun 3, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1ad19d4
Fix a false negative for ``duplicate-argument-name`` by including ``p…
mbyrnepr2 156212b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a4d1036
Update functional test output by adding quotes to the duplicate argument
mbyrnepr2 9fd5946
Regenerate the docs.
mbyrnepr2 a2700ff
Update pylint/checkers/base/basic_error_checker.py
mbyrnepr2 cbd20f1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] aab51bb
Refactor the tests for readability.
mbyrnepr2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Fix a false negative for ``duplicate-argument-name`` by including ``positional-only``, ``*args`` and ``**kwargs`` arguments in the check. | ||
|
||
Closes #9669 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
"""Check for duplicate function arguments.""" | ||
|
||
# pylint: disable=missing-docstring, line-too-long, unused-argument | ||
|
||
|
||
def foo1(_, _): # [duplicate-argument-name] | ||
"""Function with duplicate argument name.""" | ||
... | ||
|
||
def foo2(_abc, *, _abc): # [duplicate-argument-name] | ||
"""Function with duplicate argument name.""" | ||
... | ||
|
||
def foo3(_, _=3): # [duplicate-argument-name] | ||
"""Function with duplicate argument name.""" | ||
... | ||
|
||
def foo4(_, *, _): # [duplicate-argument-name] | ||
"""Function with duplicate argument name.""" | ||
... | ||
|
||
def foo5(_, *_, _=3): # [duplicate-argument-name, duplicate-argument-name] | ||
... | ||
|
||
def foo6(a, *a): # [duplicate-argument-name] | ||
... | ||
|
||
def foo7(a, /, a): # [duplicate-argument-name] | ||
... | ||
|
||
def foo8(a, **a): # [duplicate-argument-name] | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
duplicate-argument-name:4:12:4:13:foo1:Duplicate argument name _ in function definition:HIGH | ||
duplicate-argument-name:7:18:7:22:foo2:Duplicate argument name _abc in function definition:HIGH | ||
duplicate-argument-name:10:12:10:13:foo3:Duplicate argument name _ in function definition:HIGH | ||
duplicate-argument-name:13:15:13:16:foo4:Duplicate argument name _ in function definition:HIGH | ||
duplicate-argument-name:6:12:6:13:foo1:Duplicate argument name '_' in function definition:HIGH | ||
duplicate-argument-name:9:18:9:22:foo2:Duplicate argument name '_abc' in function definition:HIGH | ||
duplicate-argument-name:12:12:12:13:foo3:Duplicate argument name '_' in function definition:HIGH | ||
duplicate-argument-name:15:15:15:16:foo4:Duplicate argument name '_' in function definition:HIGH | ||
duplicate-argument-name:18:13:18:14:foo5:Duplicate argument name '_' in function definition:HIGH | ||
duplicate-argument-name:18:16:18:17:foo5:Duplicate argument name '_' in function definition:HIGH | ||
duplicate-argument-name:21:13:21:14:foo6:Duplicate argument name 'a' in function definition:HIGH | ||
duplicate-argument-name:24:15:24:16:foo7:Duplicate argument name 'a' in function definition:HIGH | ||
duplicate-argument-name:27:14:27:15:foo8:Duplicate argument name 'a' in function definition:HIGH |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is an incidental change to add quotes to the name of the missing argument in the message output.