Skip to content

Commit ddf4565

Browse files
committed
sorting check
1 parent be55d68 commit ddf4565

3 files changed

Lines changed: 29 additions & 40 deletions

File tree

.githooks/pre-commit

Lines changed: 0 additions & 14 deletions
This file was deleted.

.githooks/pre-push

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
11
#!/bin/sh
2-
set -e pipefail
2+
set -e
3+
4+
# Dependency sorting
5+
if ! cargo sort --workspace --check; then
6+
echo "❌ Dependencies should be sorted (run 'cargo sort --workspace')"
7+
exit 1
8+
fi
39

410
# Dependency audit
5-
cargo deny check || {
11+
if ! cargo deny check; then
612
echo "❌ Critical: Vulnerable dependencies detected (run 'cargo deny check')"
7-
exit 1
8-
}
13+
exit 2
14+
fi
915

1016
# Formatting check
11-
cargo fmt --all -- --check || {
17+
if ! cargo fmt --all -- --check; then
1218
echo "❌ Formatting issues (run 'cargo fmt --all')"
13-
exit 2
14-
}
19+
exit 3
20+
fi
1521

1622
# Typo check
17-
typos || {
23+
if ! typos; then
1824
echo "❌ Spelling mistakes found (run 'typos --write-changes')"
19-
exit 3
20-
}
25+
exit 4
26+
fi
2127

2228
# Linting
23-
cargo clippy --all-targets --all-features -- -D warnings || {
29+
if ! cargo clippy --all-targets --all-features -- -D warnings; then
2430
echo "❌ Clippy violations (check warnings above)"
25-
exit 4
26-
}
31+
exit 5
32+
fi
2733

2834
# Tests
29-
cargo test --workspace --verbose || {
35+
if ! cargo test --workspace --verbose; then
3036
echo "❌ Test failures detected"
31-
exit 5
32-
}
37+
exit 6
38+
fi
3339

3440
echo "✅ All checks passed!"

Cargo.toml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1+
2+
# TODO(template) update for the crate name
3+
[workspace]
4+
members = ["examples", "mycrate"]
5+
resolver = "2"
6+
default-members = ["mycrate"]
17
[workspace.package]
28
version = "0.1.0"
39
edition = "2021"
410
# TODO(template) update for your repository
511
repository = "https://github.com/NethermindEth/rust-template"
612
license = "Apache-2.0" # TODO(template) update license if needed
713

8-
# TODO(template) update for the crate name
9-
[workspace]
10-
members = [
11-
"examples",
12-
"mycrate",
13-
]
14-
resolver = "2"
15-
default-members = ["mycrate"]
16-
1714
[workspace.dependencies]
1815

1916
[workspace.lints.rust]
@@ -33,4 +30,4 @@ cast_precision_loss = "deny"
3330
cast_sign_loss = "deny"
3431
needless_return = "deny"
3532
panicking_overflow_checks = "deny"
36-
unwrap_used = "deny"
33+
unwrap_used = "deny"

0 commit comments

Comments
 (0)