Skip to content

Commit 67385ff

Browse files
author
ao xing
committed
chore: add rust git hooks
1 parent f777146 commit 67385ff

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

.githooks/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
cd "$(dirname "$0")/../rust" || exit 1
3+
cargo fmt --all -- --check

.githooks/pre-push

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
cd "$(dirname "$0")/../rust" || exit 1
3+
cargo clippy -- -D warnings

rust/crates/rusty-claude-cli/src/main.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10868,7 +10868,10 @@ mod tests {
1086810868
fn resolves_known_model_aliases() {
1086910869
assert_eq!(resolve_model_alias("opus"), "anthropic/claude-opus-4-6");
1087010870
assert_eq!(resolve_model_alias("sonnet"), "anthropic/claude-sonnet-4-6");
10871-
assert_eq!(resolve_model_alias("haiku"), "anthropic/claude-haiku-4-5-20251213");
10871+
assert_eq!(
10872+
resolve_model_alias("haiku"),
10873+
"anthropic/claude-haiku-4-5-20251213"
10874+
);
1087210875
assert_eq!(resolve_model_alias("claude-opus"), "claude-opus");
1087310876
}
1087410877

@@ -11342,7 +11345,10 @@ mod tests {
1134211345
model_flag_raw,
1134311346
..
1134411347
} => {
11345-
assert_eq!(model, "anthropic/claude-sonnet-4-6", "sonnet alias should resolve");
11348+
assert_eq!(
11349+
model, "anthropic/claude-sonnet-4-6",
11350+
"sonnet alias should resolve"
11351+
);
1134611352
assert_eq!(
1134711353
model_flag_raw.as_deref(),
1134811354
Some("sonnet"),
@@ -15064,9 +15070,18 @@ mod alias_resolution_tests {
1506415070
#[test]
1506515071
fn test_alias_resolution_builtin() {
1506615072
// Built-in aliases should resolve to their full IDs
15067-
assert_eq!(resolve_model_alias_with_config("opus"), "anthropic/claude-opus-4-6");
15068-
assert_eq!(resolve_model_alias_with_config("sonnet"), "anthropic/claude-sonnet-4-6");
15069-
assert_eq!(resolve_model_alias_with_config("haiku"), "anthropic/claude-haiku-4-5-20251213");
15073+
assert_eq!(
15074+
resolve_model_alias_with_config("opus"),
15075+
"anthropic/claude-opus-4-6"
15076+
);
15077+
assert_eq!(
15078+
resolve_model_alias_with_config("sonnet"),
15079+
"anthropic/claude-sonnet-4-6"
15080+
);
15081+
assert_eq!(
15082+
resolve_model_alias_with_config("haiku"),
15083+
"anthropic/claude-haiku-4-5-20251213"
15084+
);
1507015085
}
1507115086

1507215087
#[test]

0 commit comments

Comments
 (0)