mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-23 04:55:09 +00:00
Store source code on message (#3897)
This commit is contained in:
parent
76c47a9a43
commit
381203c084
20 changed files with 537 additions and 217 deletions
|
@ -125,7 +125,7 @@ pub fn expand_indented_block(
|
|||
/// Return true if the `orelse` block of an `if` statement is an `elif` statement.
|
||||
pub fn is_elif(orelse: &[rustpython_parser::ast::Stmt], locator: &Locator) -> bool {
|
||||
if orelse.len() == 1 && matches!(orelse[0].node, rustpython_parser::ast::StmtKind::If { .. }) {
|
||||
let contents = locator.skip(orelse[0].location);
|
||||
let contents = locator.after(orelse[0].location);
|
||||
if contents.starts_with("elif") {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue