This repository was archived by the owner on Nov 15, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathcheck-code.sh
More file actions
64 lines (53 loc) · 2.13 KB
/
Copy pathcheck-code.sh
File metadata and controls
64 lines (53 loc) · 2.13 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Simple code quality check script
# Run this manually instead of using pre-commit hooks
set -e
echo "🔍 Running code quality checks..."
# Check for trailing whitespace
echo "📝 Checking for trailing whitespace..."
if grep -r '[[:space:]]$' --include="*.rs" --include="*.toml" --include="*.yaml" --include="*.json" --include="*.md" . | grep -v target/ | grep -v node_modules/ | grep -v .git/; then
echo "❌ Found trailing whitespace"
exit 1
fi
echo "✅ No trailing whitespace found"
# Check YAML syntax
echo "📄 Checking YAML syntax..."
if command -v yamllint &> /dev/null; then
yamllint .pre-commit-config.yaml .github/workflows/ci.yml || echo "⚠️ YAML linting issues found"
else
echo "⚠️ yamllint not installed, skipping YAML checks"
fi
# Check TOML syntax
echo "📄 Checking TOML syntax..."
if command -v toml-sort &> /dev/null; then
echo "⚠️ TOML validation not available"
else
echo "⚠️ TOML validator not installed, skipping TOML checks"
fi
# Check for large files
echo "📦 Checking for large files..."
if find . -type f -size +1M | grep -v target/ | grep -v node_modules/ | grep -v .git/ | grep -v pkg/; then
echo "❌ Found large files (>1MB)"
exit 1
fi
echo "✅ No large files found"
# Check for merge conflicts
echo "🔀 Checking for merge conflicts..."
if grep -r "<<<<<<< HEAD" --include="*.rs" --include="*.toml" --include="*.yaml" --include="*.json" --include="*.md" . | grep -v target/ | grep -v node_modules/ | grep -v .git/; then
echo "❌ Found merge conflict markers"
exit 1
fi
echo "✅ No merge conflicts found"
# Optional: Run cargo fmt check (commented out to avoid hanging)
# echo "🦀 Checking Rust formatting..."
# cargo fmt --all -- --check
# Optional: Run cargo clippy (commented out to avoid hanging)
# echo "🦀 Running Rust linter..."
# cargo clippy --all-targets --all-features -- -D warnings
echo "✅ All basic checks passed!"
echo ""
echo "💡 To run comprehensive checks manually:"
echo " cargo fmt --all"
echo " cargo clippy --all-targets --all-features -- -D warnings"
echo " cargo test --all-targets --all-features"
echo " npm run test:e2e"