mirror of
https://github.com/astral-sh/ruff.git
synced 2026-12-04 02:03:58 +08:00
Excessive whitespace trimming with comment formatting (#26455)
Co-authored-by: Erik Johnson <source@ekriirke.net>
This commit is contained in:
co-authored by
Erik Johnson
parent
14a2f67eb4
commit
40a62bc699
+9
@@ -0,0 +1,9 @@
|
||||
# Black will inject a space between a comment hash and tab
|
||||
# as if the tab is non-whitespace.
|
||||
|
||||
#Flush
|
||||
# Normal
|
||||
# Tabbed
|
||||
# Double-tabbed
|
||||
pass # Normal missing pre-hash space
|
||||
pass # Tabbed, missing pre-hash space
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
# Black will inject a space between a comment hash and tab
|
||||
# as if the tab is non-whitespace.
|
||||
|
||||
# Flush
|
||||
# Normal
|
||||
# Tabbed
|
||||
# Double-tabbed
|
||||
pass # Normal missing pre-hash space
|
||||
pass # Tabbed, missing pre-hash space
|
||||
@@ -509,7 +509,7 @@ fn normalize_comment<'a>(
|
||||
Ok(Cow::Owned(std::format!("# {}", &content["\u{A0}".len()..])))
|
||||
}
|
||||
} else {
|
||||
Ok(Cow::Owned(std::format!("# {}", content.trim_start())))
|
||||
Ok(Cow::Owned(std::format!("# {content}")))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user