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

Improve B033 (duplicate set items) #385

Merged
merged 4 commits into from May 22, 2023

Conversation

JelleZijlstra
Copy link
Collaborator

  • Include the repr() of the duplicate item in the error
  • Point the error directly at the duplicate item

Fixes #384

- Include the repr() of the duplicate item in the error
- Point the error directly at the duplicate item

Fixes PyCQA#384
Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

LGTM - So we get an error per duplicate now right? So if the "multi_line" set had 0, False as well, we'd get two errors?

(Just confirming I'm reading it right)

I ask, cause if so that's awesome. I prefer tools that show you all the errors so you can fix them all and don't get new errors after you fix on where ever possible ...

@JelleZijlstra
Copy link
Collaborator Author

Yes, we'll give errors for all of them. Could add a test showing that explicitly if you like.

@cooperlees
Copy link
Collaborator

Yes, we'll give errors for all of them. Could add a test showing that explicitly if you like.

Awesome. I won't block on it, so feel free to merge, but if you have time to do so, I think it clearly states the full intention and guards against regression in the future.

@JelleZijlstra
Copy link
Collaborator Author

Easy enough to do, I pushed the new test

@JelleZijlstra JelleZijlstra merged commit a309029 into PyCQA:main May 22, 2023
5 checks passed
@JelleZijlstra JelleZijlstra deleted the improvesetdupe branch May 22, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

B033 should say what the duplicate set item is
2 participants