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

New check: B040 #12097

Open
Zac-HD opened this issue Jun 29, 2024 · 5 comments
Open

New check: B040 #12097

Zac-HD opened this issue Jun 29, 2024 · 5 comments
Labels
rule Implementing or modifying a lint rule

Comments

@Zac-HD
Copy link

Zac-HD commented Jun 29, 2024

PyCQA/flake8-bugbear#474 / PyCQA/flake8-bugbear#477

@zanieb zanieb added the rule Implementing or modifying a lint rule label Jun 29, 2024
@zanieb
Copy link
Member

zanieb commented Jun 29, 2024

Makes sense to me!

@zanieb zanieb added the help wanted Contributions especially welcome label Jun 29, 2024
@jakkdl
Copy link

jakkdl commented Jun 29, 2024

note that I explicitly decided not to cover some thorny cases, but given you have the full logic for unused variables already, I think it might make sense for you to cover them.
See discussion in the linked PR and the end of the file with test cases

@charliermarsh charliermarsh added the good first issue Good for newcomers label Jul 17, 2024
@Heidar-An
Copy link

Heidar-An commented Jul 30, 2024

Hey! I've been using this crate for some time now and I'd love to contribute back! However, I'm a bit confused by the initial comment, what exactly are we trying to fix?

@Zac-HD
Copy link
Author

Zac-HD commented Jul 30, 2024

We'd like to implement the new lint rule from upstream - this is basically a 'please port it' feature request!

divident added a commit to divident/ruff that referenced this issue Aug 8, 2024
divident added a commit to divident/ruff that referenced this issue Aug 8, 2024
@divident
Copy link

divident commented Aug 8, 2024

@Zac-HD Hi, I have added the rule that covers the same set of errors as one in upstream and even covers the unhandled cases there. Currently it only doesn't cover the reassignment of the exception like

try:
    ...
except Exception as e:
    e2 = ValueError()  # should error
    e2.add_note(str(e))

@MichaReiser MichaReiser removed help wanted Contributions especially welcome good first issue Good for newcomers labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants