mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
clean up to fix nightly clippy warnings and dedents (#3057)
This commit is contained in:
parent
3ad257cfea
commit
35606d7b05
8 changed files with 207 additions and 218 deletions
|
@ -78,16 +78,10 @@ impl<'a> Visitor<'a> for NewlineNormalizer {
|
|||
let required_newlines = match self.trailer {
|
||||
Trailer::FunctionDef | Trailer::ClassDef => self.depth.max_newlines(),
|
||||
Trailer::Docstring if matches!(self.scope, Scope::Class) => 1,
|
||||
Trailer::Import => {
|
||||
if matches!(
|
||||
stmt.node,
|
||||
StmtKind::Import { .. } | StmtKind::ImportFrom { .. }
|
||||
) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
}
|
||||
Trailer::Import => usize::from(!matches!(
|
||||
stmt.node,
|
||||
StmtKind::Import { .. } | StmtKind::ImportFrom { .. }
|
||||
)),
|
||||
_ => 0,
|
||||
};
|
||||
let present_newlines = stmt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue