Skip to content

Add Implementation for Pylint E1132: Repeated Keyword#8706

Merged
charliermarsh merged 7 commits intoastral-sh:mainfrom
AlexBieg:Pylint-E1132
Nov 19, 2023
Merged

Add Implementation for Pylint E1132: Repeated Keyword#8706
charliermarsh merged 7 commits intoastral-sh:mainfrom
AlexBieg:Pylint-E1132

Conversation

@AlexBieg
Copy link
Copy Markdown
Contributor

Summary

Adds the Pylint rule E1132 to check for repeated keyword arguments in a function call.

Test Plan

Tested via the included unit tests and manual spot checking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 15, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh
Copy link
Copy Markdown
Member

Awesome, thanks for this PR and for getting involved!

There's some overlap here with #8450, I'm almost wondering if they should one rule since they both only deal with static dictionary spreads, but I think I need to take a closer look at the code before I have a clear answer to that.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Nov 16, 2023
@AlexBieg
Copy link
Copy Markdown
Contributor Author

Oh yeah! I totally did not see that other PR. I'm happy to help merge stuff if we go down that route.

I also should have mentioned this in the summary, but this is my first meaningful Rust code besides random side projects, so feel free to be extra nit-picky with your comments 😄

Comment thread crates/ruff_linter/src/rules/pylint/rules/repeated_keywords.rs Outdated
Comment thread crates/ruff_linter/src/rules/pylint/rules/repeated_keywords.rs Outdated
Comment thread crates/ruff_linter/src/checkers/ast/analyze/expression.rs Outdated
Comment thread crates/ruff_linter/src/rules/pylint/rules/repeated_keywords.rs Outdated
@charliermarsh
Copy link
Copy Markdown
Member

Okay, it's probably fine to just proceed with this rule on its own. Left a few comments!

@AlexBieg
Copy link
Copy Markdown
Contributor Author

@charliermarsh Okay this is ready for another pass. All of your comments should be addressed. I also updated some of my destructuring statements to use .. so that unused values weren't just destructured into _ variables. I think it made it easier to read, but happy to change it back if it's not the preferred style.

Copy link
Copy Markdown
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks!

@charliermarsh charliermarsh added the preview Related to preview mode features label Nov 19, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) November 19, 2023 00:22
@charliermarsh charliermarsh merged commit 9279114 into astral-sh:main Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Related to preview mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants