Skip to content

Commit 2d495fa

Browse files
Add cargo fmt hook for Claude Code, fix formatting
Configure .claude/settings.json to run cargo fmt after editing .rs files. Apply formatting fix to long line in integration tests.
1 parent a87de21 commit 2d495fa

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.claude/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hooks": {
3+
"afterEdit": [
4+
{
5+
"matcher": "*.rs",
6+
"command": "cargo fmt"
7+
}
8+
]
9+
}
10+
}

tests/integration.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ my-pkg = "{}"
342342
fn empty_config_does_nothing() {
343343
let cache_dir = TempDir::new().unwrap();
344344

345-
let toml = format!(r#"destination = "{}""#, cache_dir.path().display().to_string().replace('\\', "/"));
345+
let toml = format!(
346+
r#"destination = "{}""#,
347+
cache_dir.path().display().to_string().replace('\\', "/")
348+
);
346349
let config = Config::parse(&toml).unwrap();
347350
let dest = config.destination.clone().unwrap();
348351
let configured_local: HashSet<String> = config.local.keys().cloned().collect();

0 commit comments

Comments
 (0)