mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-19 01:50:38 +00:00
[tryceratops
] Add fix for error-instead-of-exception
(TRY400
) (#9520)
## Summary add autofix for `error-instead-of-exception` (`TRY400`) ## Test Plan `cargo test`
This commit is contained in:
parent
2bddde2627
commit
7ef7e0ddb6
5 changed files with 316 additions and 6 deletions
|
@ -64,7 +64,7 @@ pub fn is_logger_candidate(
|
|||
false
|
||||
}
|
||||
|
||||
/// If the keywords to a logging call contain `exc_info=True` or `exc_info=sys.exc_info()`,
|
||||
/// If the keywords to a logging call contain `exc_info=True` or `exc_info=sys.exc_info()`,
|
||||
/// return the `Keyword` for `exc_info`.
|
||||
pub fn exc_info<'a>(arguments: &'a Arguments, semantic: &SemanticModel) -> Option<&'a Keyword> {
|
||||
let exc_info = arguments.find_keyword("exc_info")?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue