fix: add --all to cargo fmt in script/test and autoformat codebase
cargo fmt without --all fails with "Failed to find targets" in workspace repos. This was blocking every story's gates. Also ran cargo fmt --all to fix all existing formatting issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+14
-11
@@ -202,9 +202,7 @@ pub fn normalize_line_breaks(text: &str) -> String {
|
||||
return true;
|
||||
}
|
||||
// Horizontal rules: lines made entirely of -, *, or _ (at least 3 chars).
|
||||
let all_hr_chars = trimmed
|
||||
.chars()
|
||||
.all(|c| matches!(c, '-' | '*' | '_' | ' '));
|
||||
let all_hr_chars = trimmed.chars().all(|c| matches!(c, '-' | '*' | '_' | ' '));
|
||||
let hr_char_count = trimmed.chars().filter(|c| !c.is_whitespace()).count();
|
||||
all_hr_chars && hr_char_count >= 3
|
||||
}
|
||||
@@ -389,11 +387,7 @@ mod tests {
|
||||
#[test]
|
||||
fn strip_mention_emoji_display_name_no_separator() {
|
||||
// Display name with emoji, no separator
|
||||
let rest = strip_bot_mention(
|
||||
"timmy ⚡️ ambient on",
|
||||
"timmy ⚡️",
|
||||
"@timmy:homeserver.local",
|
||||
);
|
||||
let rest = strip_bot_mention("timmy ⚡️ ambient on", "timmy ⚡️", "@timmy:homeserver.local");
|
||||
assert_eq!(rest, "ambient on");
|
||||
}
|
||||
|
||||
@@ -638,9 +632,18 @@ mod tests {
|
||||
let output = normalize_line_breaks(input);
|
||||
// Prose sentences before and after the code block get doubled.
|
||||
// The code block itself is preserved.
|
||||
assert!(output.contains("First sentence.\n\nSecond sentence."), "prose before code: {output}");
|
||||
assert!(output.contains("```rust\nlet x = 1;\nlet y = 2;\n```"), "code block preserved: {output}");
|
||||
assert!(output.contains("Third sentence.\n\nFourth sentence."), "prose after code: {output}");
|
||||
assert!(
|
||||
output.contains("First sentence.\n\nSecond sentence."),
|
||||
"prose before code: {output}"
|
||||
);
|
||||
assert!(
|
||||
output.contains("```rust\nlet x = 1;\nlet y = 2;\n```"),
|
||||
"code block preserved: {output}"
|
||||
);
|
||||
assert!(
|
||||
output.contains("Third sentence.\n\nFourth sentence."),
|
||||
"prose after code: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user