FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Enable Ruff flake8-blind-except (BLE) by Avasam · Pull Request #13728 · python/typeshed · GitHub

Repository navigation

Enable Ruff flake8-blind-except (BLE) - #13728

Closed
Avasam wants to merge 1 commit into
python:mainfrom
Avasam:Enable-Ruff-flake8-blind-except-(BLE)
Closed

Avasam wants to merge 1 commit into
python:mainfrom
Avasam:Enable-Ruff-flake8-blind-except-(BLE)

Conversation

Avasam commented Mar 27, 2025

Copy link
Copy Markdown
Collaborator

Ref #13295
flake8-blind-except (BLE)

Contains a single rule: blind-except (BLE001)
I think it's worth making sure we explain when blindly catching any exception in a script/test.

The one time we currently do it seems to be acceptable as per the rule's description.

srittau left a comment •
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Another of these "meh" rules. As the example here shows, it's often necessary to catch all "normal" exceptions, and it's – in my experience – a mistake only fresh or particularly uninterested developers make, and easily caught in code reviews (and a teaching opportunity). But I don't particularly care.

Avasam commented Mar 28, 2025 •
edited
Loading

Copy link
Copy Markdown
Collaborator Author

I'm neutral on this as well. In personal projects I'd enable it just to force myself to comment why I'm blindly catching all exceptions.
But there's a concern an external/newer contributor may not understand that their blind expect usage is ok and they should ignore the rule rather than try and solve it.

Similar reasons to try-except-in-loop (PERF203): it's good to be aware, but maybe shouldn't be enforced by tooling.

Copy link
Copy Markdown
Member

Yeah... I'd lean towards not enabling this one, since in some situations it will suggest something that's outright incorrect. But no strong opinion either.

Avasam closed this Mar 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL