Skip to content

Commit 2ab4a3c

Browse files
authored
chore: enable clippy for tests (#24)
1 parent 70be24d commit 2ab4a3c

19 files changed

Lines changed: 87 additions & 102 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494

9595
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # ratchet:Swatinem/rust-cache@v2.9.1
9696

97-
- run: cargo clippy -- -D warnings
97+
- run: cargo clippy --all-targets -- -D warnings
9898

9999
msrv:
100100
name: MSRV check

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"rust-analyzer.check.command": "clippy",
3+
"[rust]": {
4+
"editor.formatOnSave": true,
5+
"editor.defaultFormatter": "rust-lang.rust-analyzer"
6+
}
7+
}

CLAUDE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ The primary goal is a faithful port — matching the original STAR behavior as c
2020
Rust 2024 edition. Standard Cargo commands:
2121

2222
```bash
23-
cargo build # Debug build
24-
cargo build --release # Release build
25-
cargo test # Run all tests
26-
cargo test <name> # Run a single test by name
27-
cargo clippy # Lint
28-
cargo fmt # Format code
23+
cargo build # Debug build
24+
cargo build --release # Release build
25+
cargo test # Run all tests
26+
cargo test <name> # Run a single test by name
27+
cargo clippy --all-targets # Lint
28+
cargo fmt # Format code
2929
```
3030

31-
Always run `cargo clippy`, `cargo fmt --check`, and `cargo test` before considering a phase complete.
31+
Always run `cargo clippy --all-targets`, `cargo fmt --check`, and `cargo test` before considering a phase complete.
3232

3333
## Current Status
3434

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
Rust 2024 edition. Standard Cargo commands:
66

77
```bash
8-
cargo build # debug build
9-
cargo build --release # release build
10-
cargo test # run all tests
11-
cargo clippy # lint (zero warnings expected)
12-
cargo fmt --check # formatting check
8+
cargo build # debug build
9+
cargo build --release # release build
10+
cargo test # run all tests
11+
cargo clippy --all-targets # lint (zero warnings expected)
12+
cargo fmt --check # formatting check
1313
```
1414

1515
CI runs on Linux (x86_64, x86-64-v3, aarch64), macOS (aarch64), and Windows (x86_64). PRs must pass all CI checks before merging.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ See [ROADMAP.md](ROADMAP.md) for detailed implementation tracking.
155155
Requires Rust 2024 edition (rustc 1.85+).
156156

157157
```bash
158-
cargo build --release # Release build
159-
cargo test # Run tests
160-
cargo clippy # Lint
161-
cargo fmt # Format
158+
cargo build --release # Release build
159+
cargo test # Run tests
160+
cargo clippy --all-targets # Lint
161+
cargo fmt # Format
162162
```
163163

164164
## Development

docs/src/content/docs/about/contributing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Contributions are welcome. The repository is on GitHub at [scverse/rustar-aligne
1010
Rust 2024 edition. Standard Cargo commands:
1111

1212
```bash
13-
cargo build # debug build
14-
cargo build --release # release build
15-
cargo test # run all tests
16-
cargo clippy # lint (zero warnings expected)
17-
cargo fmt --check # formatting check
13+
cargo build # debug build
14+
cargo build --release # release build
15+
cargo test # run all tests
16+
cargo clippy --all-targets # lint (zero warnings expected)
17+
cargo fmt --check # formatting check
1818
```
1919

2020
CI runs on Linux (x86_64, x86-64-v3, aarch64), macOS (aarch64), and Windows (x86_64). PRs must pass all CI checks before merging.

docs/src/content/docs/getting-started/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ target/release/rustar-aligner --version
8787
### Verify the build
8888

8989
```bash
90-
cargo test # full test suite (~396 tests)
91-
cargo clippy # lint (zero warnings expected)
92-
cargo fmt --check # formatting check
90+
cargo test # full test suite (~396 tests)
91+
cargo clippy --all-targets # lint (zero warnings expected)
92+
cargo fmt --check # formatting check
9393
```
9494

9595
### Debug builds

src/align/score.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,9 +1281,7 @@ mod tests {
12811281
seq[6] = 2; // G
12821282
seq[7] = 3; // T
12831283
// Fill intron body
1284-
for i in 8..28 {
1285-
seq[i] = 1; // C
1286-
}
1284+
seq[8..28].fill(1); // C
12871285
// AG acceptor for jR=1 position (donor at pos 6, del=24, acceptor at 28,29)
12881286
seq[28] = 0; // A
12891287
seq[29] = 2; // G

src/align/stitch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3044,7 +3044,7 @@ mod tests {
30443044

30453045
#[test]
30463046
fn test_wa_entry_sorting() {
3047-
let mut entries = vec![
3047+
let mut entries = [
30483048
WindowAlignment {
30493049
seed_idx: 0,
30503050
read_pos: 10,

src/chimeric/detect.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,8 +1344,15 @@ mod tests {
13441344
let read_len = 100usize;
13451345
let t1 = make_clipped_transcript(0, 50, false, read_len, 0, 0);
13461346
let read_seq = make_read_seq(read_len);
1347-
let result =
1348-
detect_chimeric_old(&[t1.clone()], &t1, &read_seq, "r", &params, &index).unwrap();
1347+
let result = detect_chimeric_old(
1348+
std::slice::from_ref(&t1),
1349+
&t1,
1350+
&read_seq,
1351+
"r",
1352+
&params,
1353+
&index,
1354+
)
1355+
.unwrap();
13491356
assert!(result.is_empty());
13501357
}
13511358

0 commit comments

Comments
 (0)