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:
+45
-42
@@ -101,7 +101,6 @@ fn default_rate_limit_notifications() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
pub struct ComponentConfig {
|
||||
@@ -288,27 +287,28 @@ impl ProjectConfig {
|
||||
// Parsed successfully but no agents — could be legacy or no agent section.
|
||||
// Try legacy format.
|
||||
if let Ok(legacy) = toml::from_str::<LegacyProjectConfig>(content)
|
||||
&& let Some(agent) = legacy.agent {
|
||||
slog!(
|
||||
"[config] Warning: [agent] table is deprecated. \
|
||||
&& let Some(agent) = legacy.agent
|
||||
{
|
||||
slog!(
|
||||
"[config] Warning: [agent] table is deprecated. \
|
||||
Use [[agent]] array format instead."
|
||||
);
|
||||
let config = ProjectConfig {
|
||||
component: legacy.component,
|
||||
agent: vec![agent],
|
||||
watcher: legacy.watcher,
|
||||
default_qa: legacy.default_qa,
|
||||
default_coder_model: legacy.default_coder_model,
|
||||
max_coders: legacy.max_coders,
|
||||
max_retries: legacy.max_retries,
|
||||
base_branch: legacy.base_branch,
|
||||
rate_limit_notifications: legacy.rate_limit_notifications,
|
||||
timezone: legacy.timezone,
|
||||
rendezvous: None,
|
||||
};
|
||||
validate_agents(&config.agent)?;
|
||||
return Ok(config);
|
||||
}
|
||||
);
|
||||
let config = ProjectConfig {
|
||||
component: legacy.component,
|
||||
agent: vec![agent],
|
||||
watcher: legacy.watcher,
|
||||
default_qa: legacy.default_qa,
|
||||
default_coder_model: legacy.default_coder_model,
|
||||
max_coders: legacy.max_coders,
|
||||
max_retries: legacy.max_retries,
|
||||
base_branch: legacy.base_branch,
|
||||
rate_limit_notifications: legacy.rate_limit_notifications,
|
||||
timezone: legacy.timezone,
|
||||
rendezvous: None,
|
||||
};
|
||||
validate_agents(&config.agent)?;
|
||||
return Ok(config);
|
||||
}
|
||||
// No agent section at all
|
||||
Ok(config)
|
||||
}
|
||||
@@ -411,10 +411,11 @@ impl ProjectConfig {
|
||||
args.push(model.clone());
|
||||
}
|
||||
if let Some(ref tools) = agent.allowed_tools
|
||||
&& !tools.is_empty() {
|
||||
args.push("--allowedTools".to_string());
|
||||
args.push(tools.join(","));
|
||||
}
|
||||
&& !tools.is_empty()
|
||||
{
|
||||
args.push("--allowedTools".to_string());
|
||||
args.push(tools.join(","));
|
||||
}
|
||||
if let Some(turns) = agent.max_turns {
|
||||
args.push("--max-turns".to_string());
|
||||
args.push(turns.to_string());
|
||||
@@ -443,19 +444,21 @@ fn validate_agents(agents: &[AgentConfig]) -> Result<(), String> {
|
||||
return Err(format!("Duplicate agent name: '{}'", agent.name));
|
||||
}
|
||||
if let Some(budget) = agent.max_budget_usd
|
||||
&& budget <= 0.0 {
|
||||
return Err(format!(
|
||||
"Agent '{}': max_budget_usd must be positive, got {budget}",
|
||||
agent.name
|
||||
));
|
||||
}
|
||||
&& budget <= 0.0
|
||||
{
|
||||
return Err(format!(
|
||||
"Agent '{}': max_budget_usd must be positive, got {budget}",
|
||||
agent.name
|
||||
));
|
||||
}
|
||||
if let Some(turns) = agent.max_turns
|
||||
&& turns == 0 {
|
||||
return Err(format!(
|
||||
"Agent '{}': max_turns must be positive, got 0",
|
||||
agent.name
|
||||
));
|
||||
}
|
||||
&& turns == 0
|
||||
{
|
||||
return Err(format!(
|
||||
"Agent '{}': max_turns must be positive, got 0",
|
||||
agent.name
|
||||
));
|
||||
}
|
||||
if let Some(ref runtime) = agent.runtime {
|
||||
match runtime.as_str() {
|
||||
"claude-code" | "gemini" => {}
|
||||
@@ -957,10 +960,7 @@ name = "coder"
|
||||
runtime = "claude-code"
|
||||
"#;
|
||||
let config = ProjectConfig::parse(toml_str).unwrap();
|
||||
assert_eq!(
|
||||
config.agent[0].runtime,
|
||||
Some("claude-code".to_string())
|
||||
);
|
||||
assert_eq!(config.agent[0].runtime, Some("claude-code".to_string()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1067,7 +1067,10 @@ prompt = "git difftool {{base_branch}}...HEAD"
|
||||
name = "coder"
|
||||
"#;
|
||||
let config = ProjectConfig::parse(toml_str).unwrap();
|
||||
assert!(config.rate_limit_notifications, "rate_limit_notifications should default to true");
|
||||
assert!(
|
||||
config.rate_limit_notifications,
|
||||
"rate_limit_notifications should default to true"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user