Skip to content

Commit 29f34fa

Browse files
committed
Fix formatting and update pre-commit hook to auto-fix
- cargo fmt applied to cli/commands.rs - Pre-commit hook now runs cargo fmt and re-stages formatted files instead of just checking
1 parent b9ce5c9 commit 29f34fa

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.githooks/pre-commit

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ if [ "${SKIP_GIT_HOOKS:-0}" = "1" ]; then
77
exit 0
88
fi
99

10-
echo "=== pre-commit: checking formatting ==="
11-
cargo fmt --all -- --check
10+
echo "=== pre-commit: formatting code ==="
11+
cargo fmt --all
12+
13+
# Re-stage any files that were reformatted
14+
git diff --name-only | while read -r file; do
15+
if [ -f "$file" ]; then
16+
git add "$file"
17+
fi
18+
done
1219

1320
echo "=== pre-commit: running clippy ==="
1421
cargo clippy --all-targets --all-features -- -D warnings

src/cli/commands.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,11 @@ async fn run_swe_harness_command(args: SweHarnessArgs) -> anyhow::Result<()> {
725725
let mut input_path = std::path::PathBuf::from(&args.input);
726726

727727
// Download tasks from HuggingFace unless --no-dataset is set
728-
let effective_dataset = if args.no_dataset { None } else { args.dataset.clone() };
728+
let effective_dataset = if args.no_dataset {
729+
None
730+
} else {
731+
args.dataset.clone()
732+
};
729733
if let Some(ref dataset_repo) = effective_dataset {
730734
download_hf_tasks(dataset_repo, args.task_id.as_deref(), &input_path).await?;
731735

0 commit comments

Comments
 (0)