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:
dave
2026-04-13 14:07:08 +00:00
parent ed2526ce41
commit 845b85e7a7
128 changed files with 3566 additions and 2395 deletions
+10 -13
View File
@@ -49,7 +49,9 @@ struct TokenRefreshError {
/// Returns the path to `~/.claude/.credentials.json`.
fn credentials_path() -> Result<PathBuf, String> {
let home = std::env::var("HOME").map_err(|_| "HOME not set".to_string())?;
Ok(PathBuf::from(home).join(".claude").join(".credentials.json"))
Ok(PathBuf::from(home)
.join(".claude")
.join(".credentials.json"))
}
/// Read OAuth credentials from disk.
@@ -61,12 +63,7 @@ pub fn read_credentials() -> Result<CredentialsFile, String> {
path.display()
)
})?;
serde_json::from_str(&data).map_err(|e| {
format!(
"Failed to parse {}: {e}",
path.display()
)
})
serde_json::from_str(&data).map_err(|e| format!("Failed to parse {}: {e}", path.display()))
}
/// Write updated credentials back to disk with 0600 permissions.
@@ -74,8 +71,7 @@ pub fn write_credentials(creds: &CredentialsFile) -> Result<(), String> {
let path = credentials_path()?;
let data = serde_json::to_string_pretty(creds)
.map_err(|e| format!("Failed to serialize credentials: {e}"))?;
std::fs::write(&path, &data)
.map_err(|e| format!("Failed to write {}: {e}", path.display()))?;
std::fs::write(&path, &data).map_err(|e| format!("Failed to write {}: {e}", path.display()))?;
// Restore 0600 permissions
#[cfg(unix)]
@@ -102,9 +98,7 @@ pub async fn refresh_access_token() -> Result<(), String> {
let refresh_token = creds.claude_ai_oauth.refresh_token.clone();
if refresh_token.is_empty() {
return Err(
"No refresh token found. Run `claude login` to authenticate.".to_string(),
);
return Err("No refresh token found. Run `claude login` to authenticate.".to_string());
}
let client = reqwest::Client::new();
@@ -215,7 +209,10 @@ mod tests {
assert_eq!(creds.claude_ai_oauth.access_token, "sk-ant-oat01-test");
assert_eq!(creds.claude_ai_oauth.refresh_token, "sk-ant-ort01-test");
assert_eq!(creds.claude_ai_oauth.expires_at, 1774466144677);
assert_eq!(creds.claude_ai_oauth.subscription_type.as_deref(), Some("max"));
assert_eq!(
creds.claude_ai_oauth.subscription_type.as_deref(),
Some("max")
);
}
#[test]