Skip to content

Commit 2505123

Browse files
OttoAllmendingerllm-git
andcommitted
feat(git-hooks): enable cargo clippy in pre-commit hook
Enable cargo clippy checks alongside formatting in the pre-commit hooks for Rust files. Checks are configured to treat warnings as errors for better code quality enforcement. Issue: BTC-2650 Co-authored-by: llm-git <llm-git@ttll.de>
1 parent 805b2e8 commit 2505123

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This will:
2222
Pre-commit hooks automatically run on staged files:
2323

2424
- **JS/TS**: Prettier formatting + ESLint
25-
- **Rust**: `cargo fmt`
25+
- **Rust**: `cargo fmt` + `cargo clippy`
2626

2727
# Package Management
2828

lint-staged.config.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ export default {
6363
const manifest = `packages/${pkg}/Cargo.toml`;
6464
if (existsSync(manifest)) {
6565
commands.push(`cargo fmt --manifest-path ${manifest}`);
66-
// TODO: enable once pre-existing clippy warnings are fixed
67-
// commands.push(
68-
// `cargo clippy --manifest-path ${manifest} --all-targets --all-features -- -D warnings`,
69-
// );
66+
commands.push(
67+
`cargo clippy --manifest-path ${manifest} --all-targets --all-features -- -D warnings`,
68+
);
7069
}
7170
}
7271
return commands;

0 commit comments

Comments
 (0)