Skip to content

Commit c2bc3c2

Browse files
committed
improve: enhance lint.sh script with debugging and artifact cleaning
- Add cargo clean between toolchain switches to prevent build conflicts - Add toolchain debugging information showing versions and target directory - Add visual separators and emojis for better script output readability - Prevent future shellcheck 'no shell scripts found' issues from toolchain conflicts - Improve error diagnosis with detailed version information display
1 parent 0f8815d commit c2bc3c2

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

scripts/lint.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,38 @@
11
#!/bin/bash
22
# Run linters with both stable and nightly Rust toolchains
3+
# This script prevents build artifact conflicts between toolchains by cleaning between runs
34

45
set -euo pipefail
56

7+
# Function to display current toolchain information
8+
show_toolchain_info() {
9+
local toolchain=$1
10+
echo "============================================"
11+
echo "🔧 Current Toolchain: $toolchain"
12+
echo "============================================"
13+
rustup run "$toolchain" rustc --version
14+
rustup run "$toolchain" cargo --version
15+
echo "Target directory: $(pwd)/target"
16+
echo "============================================"
17+
echo
18+
}
19+
20+
echo "🧪 Running linters with both stable and nightly Rust toolchains"
21+
echo
22+
623
echo "Testing with stable toolchain..."
24+
show_toolchain_info "stable"
725
rustup run stable cargo run --bin linter all
826

27+
echo
28+
echo "🧹 Cleaning build artifacts to prevent toolchain conflicts..."
29+
cargo clean
30+
echo "Build artifacts cleaned successfully"
31+
echo
32+
933
echo "Testing with nightly toolchain..."
34+
show_toolchain_info "nightly"
1035
rustup run nightly cargo run --bin linter all
1136

12-
echo "All linting tests passed!"
37+
echo
38+
echo "✅ All linting tests passed!"

0 commit comments

Comments
 (0)