mirror of https://github.com/astral-sh/ruff
Document that BLE001 supports both BaseException and Exception (#12788)
This commit is contained in:
parent
a176679b24
commit
253474b312
|
|
@ -10,7 +10,9 @@ use ruff_text_size::Ranged;
|
||||||
use crate::checkers::ast::Checker;
|
use crate::checkers::ast::Checker;
|
||||||
|
|
||||||
/// ## What it does
|
/// ## What it does
|
||||||
/// Checks for `except` clauses that catch all exceptions.
|
/// Checks for `except` clauses that catch all exceptions. This includes
|
||||||
|
/// bare `except`, `except BaseException` and `except Exception`.
|
||||||
|
///
|
||||||
///
|
///
|
||||||
/// ## Why is this bad?
|
/// ## Why is this bad?
|
||||||
/// Overly broad `except` clauses can lead to unexpected behavior, such as
|
/// Overly broad `except` clauses can lead to unexpected behavior, such as
|
||||||
|
|
@ -58,6 +60,7 @@ use crate::checkers::ast::Checker;
|
||||||
/// ## References
|
/// ## References
|
||||||
/// - [Python documentation: The `try` statement](https://docs.python.org/3/reference/compound_stmts.html#the-try-statement)
|
/// - [Python documentation: The `try` statement](https://docs.python.org/3/reference/compound_stmts.html#the-try-statement)
|
||||||
/// - [Python documentation: Exception hierarchy](https://docs.python.org/3/library/exceptions.html#exception-hierarchy)
|
/// - [Python documentation: Exception hierarchy](https://docs.python.org/3/library/exceptions.html#exception-hierarchy)
|
||||||
|
/// - [PEP8 Programming Recommendations on bare `except`](https://peps.python.org/pep-0008/#programming-recommendations)
|
||||||
#[violation]
|
#[violation]
|
||||||
pub struct BlindExcept {
|
pub struct BlindExcept {
|
||||||
name: String,
|
name: String,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue