mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Ruff 2024.2 style (#9639)
This commit is contained in:
parent
0293908b71
commit
a6f32ddc5e
47 changed files with 835 additions and 2362 deletions
|
@ -10,7 +10,6 @@ use ruff_text_size::{Ranged, TextLen, TextRange};
|
|||
use crate::comments::SourceComment;
|
||||
use crate::context::NodeLevel;
|
||||
use crate::prelude::*;
|
||||
use crate::preview::is_blank_line_after_nested_stub_class_enabled;
|
||||
use crate::statement::suite::should_insert_blank_line_after_class_in_stub_file;
|
||||
|
||||
/// Formats the leading comments of a node.
|
||||
|
@ -544,10 +543,7 @@ pub(crate) fn empty_lines_before_trailing_comments<'a>(
|
|||
// Black has different rules for stub vs. non-stub and top level vs. indented
|
||||
let empty_lines = match (f.options().source_type(), f.context().node_level()) {
|
||||
(PySourceType::Stub, NodeLevel::TopLevel(_)) => 1,
|
||||
(PySourceType::Stub, _) => u32::from(
|
||||
is_blank_line_after_nested_stub_class_enabled(f.context())
|
||||
&& node_kind == NodeKind::StmtClassDef,
|
||||
),
|
||||
(PySourceType::Stub, _) => u32::from(node_kind == NodeKind::StmtClassDef),
|
||||
(_, NodeLevel::TopLevel(_)) => 2,
|
||||
(_, _) => 1,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue