Skip to content

Improve B033 (duplicate set items)#385

Merged
JelleZijlstra merged 4 commits into
PyCQA:mainfrom
JelleZijlstra:improvesetdupe
May 22, 2023
Merged

Improve B033 (duplicate set items)#385
JelleZijlstra merged 4 commits into
PyCQA:mainfrom
JelleZijlstra:improvesetdupe

Conversation

@JelleZijlstra

Copy link
Copy Markdown
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

@cooperlees cooperlees left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator Author

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

@cooperlees

Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

Easy enough to do, I pushed the new test

@JelleZijlstra JelleZijlstra merged commit a309029 into PyCQA:main May 22, 2023
@JelleZijlstra JelleZijlstra deleted the improvesetdupe branch May 22, 2023 17:43
@JelleZijlstra JelleZijlstra restored the improvesetdupe branch September 10, 2024 23:37
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