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:
@@ -1,8 +1,8 @@
|
||||
//! Handler for the `backlog` command — shows only Stage::Backlog items.
|
||||
|
||||
use crate::pipeline_state::{PipelineItem, Stage};
|
||||
use super::CommandContext;
|
||||
use super::status::{story_short_label, unmet_deps_from_items};
|
||||
use crate::pipeline_state::{PipelineItem, Stage};
|
||||
|
||||
pub(super) fn handle_backlog(_ctx: &CommandContext) -> Option<String> {
|
||||
Some(build_backlog_output())
|
||||
@@ -94,16 +94,29 @@ mod tests {
|
||||
make_item("30_story_in_qa", "In QA", Stage::Qa),
|
||||
];
|
||||
let output = build_backlog_from_items(&items);
|
||||
assert!(output.contains("In Backlog"), "should show backlog item: {output}");
|
||||
assert!(!output.contains("In Progress"), "should not show coding items: {output}");
|
||||
assert!(!output.contains("In QA"), "should not show QA items: {output}");
|
||||
assert!(
|
||||
output.contains("In Backlog"),
|
||||
"should show backlog item: {output}"
|
||||
);
|
||||
assert!(
|
||||
!output.contains("In Progress"),
|
||||
"should not show coding items: {output}"
|
||||
);
|
||||
assert!(
|
||||
!output.contains("In QA"),
|
||||
"should not show QA items: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
// -- AC: shows number, type, name -----------------------------------------
|
||||
|
||||
#[test]
|
||||
fn backlog_shows_number_type_and_name() {
|
||||
let items = vec![make_item("42_story_my_feature", "My Feature", Stage::Backlog)];
|
||||
let items = vec![make_item(
|
||||
"42_story_my_feature",
|
||||
"My Feature",
|
||||
Stage::Backlog,
|
||||
)];
|
||||
let output = build_backlog_from_items(&items);
|
||||
assert!(
|
||||
output.contains("42 [story] — My Feature"),
|
||||
@@ -116,7 +129,12 @@ mod tests {
|
||||
#[test]
|
||||
fn backlog_shows_waiting_on_for_unmet_deps() {
|
||||
let items = vec![
|
||||
make_item_with_deps("10_story_waiting", "Waiting Story", Stage::Backlog, vec![999]),
|
||||
make_item_with_deps(
|
||||
"10_story_waiting",
|
||||
"Waiting Story",
|
||||
Stage::Backlog,
|
||||
vec![999],
|
||||
),
|
||||
make_item("999_story_dep", "Dep Story", Stage::Backlog),
|
||||
];
|
||||
let output = build_backlog_from_items(&items);
|
||||
@@ -150,16 +168,17 @@ mod tests {
|
||||
fn backlog_no_waiting_on_when_no_deps() {
|
||||
let items = vec![make_item("5_story_nodeps", "No Deps", Stage::Backlog)];
|
||||
let output = build_backlog_from_items(&items);
|
||||
assert!(!output.contains("waiting on"), "no dep suffix when no deps: {output}");
|
||||
assert!(
|
||||
!output.contains("waiting on"),
|
||||
"no dep suffix when no deps: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
// -- AC: command is registered in the registry ----------------------------
|
||||
|
||||
#[test]
|
||||
fn backlog_command_in_registry() {
|
||||
let found = super::super::commands()
|
||||
.iter()
|
||||
.any(|c| c.name == "backlog");
|
||||
let found = super::super::commands().iter().any(|c| c.name == "backlog");
|
||||
assert!(found, "backlog must be registered in commands()");
|
||||
}
|
||||
|
||||
@@ -171,7 +190,10 @@ mod tests {
|
||||
"@timmy help",
|
||||
);
|
||||
let output = result.unwrap_or_default();
|
||||
assert!(output.contains("backlog"), "backlog should appear in help output: {output}");
|
||||
assert!(
|
||||
output.contains("backlog"),
|
||||
"backlog should appear in help output: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -181,7 +203,10 @@ mod tests {
|
||||
"@timmy:homeserver.local",
|
||||
"@timmy backlog",
|
||||
);
|
||||
assert!(result.is_some(), "backlog command should match and return Some");
|
||||
assert!(
|
||||
result.is_some(),
|
||||
"backlog command should match and return Some"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -192,7 +217,10 @@ mod tests {
|
||||
"@timmy backlog",
|
||||
);
|
||||
let output = result.unwrap_or_default();
|
||||
assert!(output.contains("Backlog"), "backlog output should contain Backlog header: {output}");
|
||||
assert!(
|
||||
output.contains("Backlog"),
|
||||
"backlog output should contain Backlog header: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
// -- empty backlog --------------------------------------------------------
|
||||
@@ -201,6 +229,9 @@ mod tests {
|
||||
fn backlog_shows_none_when_empty() {
|
||||
let items = vec![make_item("1_story_done", "Done", Stage::Coding)];
|
||||
let output = build_backlog_from_items(&items);
|
||||
assert!(output.contains("*(none)*"), "should show none when no backlog items: {output}");
|
||||
assert!(
|
||||
output.contains("*(none)*"),
|
||||
"should show none when no backlog items: {output}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user