Skip to content
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

Conversation

mbyrnepr2
Copy link
Member

Type of Changes

Type
βœ“ πŸ› Bug fix
✨ New feature
πŸ”¨ Refactoring
πŸ“œ Docs

Description

Fix a false negative for duplicate-argument-name by including positional-only, *args and **kwargs arguments in the check.

Closes #9669

…ositional-only``, ``*args`` and ``**kwargs`` arguments in the check.

Closes pylint-dev#9669
@mbyrnepr2 mbyrnepr2 added the False Negative πŸ¦‹ No message is emitted but something is wrong with the code label May 22, 2024
@@ -145,7 +145,7 @@ class BasicErrorChecker(_BasicChecker):
"pre-decrement operator -- and ++, which doesn't exist in Python.",
),
"E0108": (
"Duplicate argument name %s in function definition",
"Duplicate argument name %r in function definition",
Copy link
Member Author

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.

Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 95.84%. Comparing base (d3b1ef1) to head (aab51bb).
Report is 149 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9670      +/-   ##
==========================================
- Coverage   95.84%   95.84%   -0.01%     
==========================================
  Files         174      174              
  Lines       18904    18901       -3     
==========================================
- Hits        18118    18115       -3     
  Misses        786      786              
Files with missing lines Coverage Ξ”
pylint/checkers/base/basic_error_checker.py 95.45% <100.00%> (-0.07%) ⬇️

This comment has been minimized.

@mbyrnepr2 mbyrnepr2 marked this pull request as ready for review May 22, 2024 13:53

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.3.0 milestone May 22, 2024
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some nits.

pylint/checkers/base/basic_error_checker.py Outdated Show resolved Hide resolved
tests/functional/d/duplicate/duplicate_argument_name.py Outdated Show resolved Hide resolved
@Pierre-Sassoulas
Copy link
Member

Let's wait for another review, 3.3.0 is not out yet :)

Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit aab51bb

@DanielNoord DanielNoord merged commit 4203d87 into pylint-dev:main Jun 3, 2024
44 checks passed
@mbyrnepr2 mbyrnepr2 deleted the 9669_false_negative_duplicate_argument_name branch June 4, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative πŸ¦‹ No message is emitted but something is wrong with the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False negatives for duplicate-argument-name
3 participants