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 false positive for keyword-arg-before-vararg #8571

Merged
merged 4 commits into from
Apr 13, 2023
Merged

Fix false positive for keyword-arg-before-vararg #8571

merged 4 commits into from
Apr 13, 2023

Conversation

mbyrnepr2
Copy link
Member

Type of Changes

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

Description

Fix false positive for keyword-arg-before-vararg when a positional-only parameter with a default value precedes *args.

Closes #8570

…l-only parameter with a default value precedes ``*args``.

Closes #8570
@github-actions

This comment has been minimized.

@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Merging #8571 (0969d7c) into main (0cd41b1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8571   +/-   ##
=======================================
  Coverage   95.91%   95.91%           
=======================================
  Files         174      174           
  Lines       18369    18371    +2     
=======================================
+ Hits        17618    17620    +2     
  Misses        751      751           
Impacted Files Coverage Ξ”
pylint/checkers/typecheck.py 96.46% <100.00%> (+<0.01%) ⬆️

@github-actions

This comment has been minimized.

@mbyrnepr2 mbyrnepr2 marked this pull request as draft April 12, 2023 18:47
@mbyrnepr2 mbyrnepr2 added the False Positive 🦟 A message is emitted but nothing is wrong with the code label Apr 12, 2023
@mbyrnepr2 mbyrnepr2 self-assigned this Apr 12, 2023
@mbyrnepr2 mbyrnepr2 added this to the 2.17.3 milestone Apr 12, 2023
@mbyrnepr2 mbyrnepr2 marked this pull request as ready for review April 12, 2023 19:40
@github-actions

This comment has been minimized.

DanielNoord
DanielNoord previously approved these changes Apr 12, 2023
Copy link
Collaborator

@DanielNoord DanielNoord left a 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!

@@ -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.
Copy link
Collaborator

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.

Copy link
Member Author

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.

@mbyrnepr2 mbyrnepr2 enabled auto-merge (squash) April 13, 2023 06:39
@mbyrnepr2 mbyrnepr2 merged commit 56fa5dc into pylint-dev:main Apr 13, 2023
@mbyrnepr2 mbyrnepr2 deleted the 8570_positional_only_and_varargs branch April 13, 2023 06:49
@github-actions
Copy link
Contributor

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

This comment was generated for commit 0969d7c

github-actions bot pushed a commit that referenced this pull request Apr 15, 2023
* Fix false positive for ``keyword-arg-before-vararg`` when a positional-only parameter with a default value precedes ``*args``.

Closes #8570

(cherry picked from commit 56fa5dc)
Pierre-Sassoulas pushed a commit that referenced this pull request Apr 15, 2023
* Fix false positive for ``keyword-arg-before-vararg`` when a positional-only parameter with a default value precedes ``*args``.

Closes #8570

(cherry picked from commit 56fa5dc)

Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive for keyword-arg-before-vararg with positional-only parameter
3 participants