Skip to content

Commit 9872577

Browse files
committed
feat: add comprehensive linting script for toolchain testing
- Add ./scripts/lint.sh to test linting with both stable and nightly toolchains - Update .github/copilot-instructions.md to recommend new linting script - Script ensures CI compatibility by testing with stable toolchain - Enables local development confidence with nightly toolchain testing - Simplifies pre-commit workflow for consistent linting across environments
1 parent 0f2a7ab commit 9872577

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/copilot-instructions.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ This is a deployment infrastructure proof-of-concept for the Torrust ecosystem.
3333
```bash
3434
# Run cargo machete
3535
cargo machete
36-
# Run linters
36+
# Run linters (recommended - tests both stable & nightly)
37+
./scripts/lint.sh
38+
# Or run linters with single toolchain
3739
cargo run --bin linter all
3840
# Run tests
3941
cargo test
@@ -54,7 +56,9 @@ This is a deployment infrastructure proof-of-concept for the Torrust ecosystem.
5456
- **Build**: `cargo build`
5557
- **Test**: `cargo test`
5658
- **Unit Tests**: When writing unit tests, follow conventions described in [`docs/contributing/testing.md`](../docs/contributing/testing.md)
57-
- **Lint**: `cargo run --bin linter all` (mandatory before commits)
59+
- **Lint**: `./scripts/lint.sh` (comprehensive - tests stable & nightly toolchains)
60+
- Alternative: `cargo run --bin linter all` (single toolchain)
61+
- Options: `./scripts/lint.sh --stable` or `./scripts/lint.sh --nightly`
5862
- **Dependencies**: `cargo machete` (mandatory before commits - no unused dependencies)
5963
- **E2E**: `cargo run --bin e2e-tests`
6064

scripts/lint.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# Run linters with both stable and nightly Rust toolchains
3+
4+
set -euo pipefail
5+
6+
echo "Testing with stable toolchain..."
7+
rustup run stable cargo run --bin linter all
8+
9+
echo "Testing with nightly toolchain..."
10+
rustup run nightly cargo run --bin linter all
11+
12+
echo "All linting tests passed!"

0 commit comments

Comments
 (0)