-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathauto-fix.sh
More file actions
executable file
·47 lines (38 loc) · 1.3 KB
/
Copy pathauto-fix.sh
File metadata and controls
executable file
·47 lines (38 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Auto-fix common issues before committing
# This modifies files to fix formatting and linting issues
set -e
# Match GitHub Actions environment
export CARGO_TERM_COLOR=always
export RUST_BACKTRACE=1
echo "🔧 Auto-fixing common issues..."
echo "================================"
echo ""
# Ensure we're using the latest stable Rust (matches GitHub Actions)
echo "0️⃣ Ensuring Rust toolchain is up-to-date..."
rustup update stable --no-self-update > /dev/null 2>&1 || true
current_version=$(rustc --version)
echo " Using: $current_version"
echo ""
# Auto-format code
echo "1️⃣ Auto-formatting code..."
cargo fmt
echo "✓ Code formatted"
echo ""
echo "2️⃣ Auto-fixing clippy issues (all targets and features)..."
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged
echo "✓ Clippy fixes applied (where possible)"
echo ""
echo "3️⃣ Checking if all issues are fixed..."
echo ""
# Run quick check to verify
echo "Running quick-check to verify fixes..."
echo "--------------------------------------"
./contributing/scripts/quick-check.sh
echo ""
echo "🎉 Auto-fix complete!"
echo ""
echo "Next steps:"
echo " - Review the changes with 'git diff'"
echo " - Stage changes with 'git add -p' (interactive) or 'git add .'"
echo " - Commit with a descriptive message"