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:
@@ -37,9 +37,7 @@ fn move_item<'a>(
|
||||
// Use the typed projection for compile-safe stage comparison.
|
||||
if let Ok(Some(typed_item)) = crate::pipeline_state::read_typed(story_id) {
|
||||
let current_dir = typed_item.stage.dir_name();
|
||||
if current_dir == target_dir
|
||||
|| extra_done_dirs.contains(¤t_dir)
|
||||
{
|
||||
if current_dir == target_dir || extra_done_dirs.contains(¤t_dir) {
|
||||
return Ok(None); // Idempotent: already there.
|
||||
}
|
||||
|
||||
@@ -77,11 +75,7 @@ fn move_item<'a>(
|
||||
}))
|
||||
};
|
||||
|
||||
crate::db::move_item_stage(
|
||||
story_id,
|
||||
target_dir,
|
||||
transform.as_ref().map(|f| f.as_ref()),
|
||||
);
|
||||
crate::db::move_item_stage(story_id, target_dir, transform.as_ref().map(|f| f.as_ref()));
|
||||
|
||||
slog!("[lifecycle] Moved '{story_id}' from work/{src_dir}/ to work/{target_dir}/");
|
||||
return Ok(Some(src_dir));
|
||||
@@ -121,7 +115,16 @@ fn move_item<'a>(
|
||||
/// that has already advanced past the coding stage.
|
||||
/// Idempotent: if already in `2_current/`, returns Ok. If not found, logs and returns Ok.
|
||||
pub fn move_story_to_current(project_root: &Path, story_id: &str) -> Result<(), String> {
|
||||
move_item(project_root, story_id, &["1_backlog"], "2_current", &[], true, &[]).map(|_| ())
|
||||
move_item(
|
||||
project_root,
|
||||
story_id,
|
||||
&["1_backlog"],
|
||||
"2_current",
|
||||
&[],
|
||||
true,
|
||||
&[],
|
||||
)
|
||||
.map(|_| ())
|
||||
}
|
||||
|
||||
/// Check whether a feature branch `feature/story-{story_id}` exists and has
|
||||
@@ -205,12 +208,25 @@ pub fn move_story_to_qa(project_root: &Path, story_id: &str) -> Result<(), Strin
|
||||
}
|
||||
|
||||
/// Move a story from `work/3_qa/` back to `work/2_current/`, clearing `review_hold` and writing notes.
|
||||
pub fn reject_story_from_qa(project_root: &Path, story_id: &str, notes: &str) -> Result<(), String> {
|
||||
let moved = move_item(project_root, story_id, &["3_qa"], "2_current", &[], false, &["review_hold"])?;
|
||||
pub fn reject_story_from_qa(
|
||||
project_root: &Path,
|
||||
story_id: &str,
|
||||
notes: &str,
|
||||
) -> Result<(), String> {
|
||||
let moved = move_item(
|
||||
project_root,
|
||||
story_id,
|
||||
&["3_qa"],
|
||||
"2_current",
|
||||
&[],
|
||||
false,
|
||||
&["review_hold"],
|
||||
)?;
|
||||
if moved.is_some() && !notes.is_empty() {
|
||||
// Append rejection notes to the stored content.
|
||||
if let Some(content) = crate::db::read_content(story_id) {
|
||||
let updated = crate::io::story_metadata::write_rejection_notes_to_content(&content, notes);
|
||||
let updated =
|
||||
crate::io::story_metadata::write_rejection_notes_to_content(&content, notes);
|
||||
crate::db::write_content(story_id, &updated);
|
||||
// Re-sync to DB.
|
||||
crate::db::write_item_with_content(story_id, "2_current", &updated);
|
||||
@@ -251,8 +267,16 @@ pub fn move_story_to_stage(
|
||||
|
||||
let all_dirs: Vec<&str> = STAGES.iter().map(|(_, dir)| *dir).collect();
|
||||
|
||||
match move_item(project_root, story_id, &all_dirs, target_dir, &[], false, &[])
|
||||
.map_err(|_| format!("Work item '{story_id}' not found in any pipeline stage."))?
|
||||
match move_item(
|
||||
project_root,
|
||||
story_id,
|
||||
&all_dirs,
|
||||
target_dir,
|
||||
&[],
|
||||
false,
|
||||
&[],
|
||||
)
|
||||
.map_err(|_| format!("Work item '{story_id}' not found in any pipeline stage."))?
|
||||
{
|
||||
Some(src_dir) => {
|
||||
let from_stage = STAGES
|
||||
|
||||
Reference in New Issue
Block a user