Skip to content

Commit 87dcc16

Browse files
mikolalysenkoclaude
andcommitted
fix: split clippy into own CI job and fix broken update.rs tests
- Move clippy into a dedicated `clippy` job so it runs independently from tests and is separately visible in PR checks - Remove `components: clippy` from the test job (no longer needed) - Fix 2 pre-existing test failures in package_json::update::tests: assertions checked for "socket patch apply" (space) but the SOCKET_PATCH_COMMAND writes "socket-patch apply" (hyphen) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2b3c783 commit 87dcc16

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,31 @@ permissions:
99
contents: read
1010

1111
jobs:
12+
clippy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
17+
18+
- name: Install Rust
19+
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
20+
with:
21+
toolchain: stable
22+
components: clippy
23+
24+
- name: Cache cargo
25+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
26+
with:
27+
path: |
28+
~/.cargo/registry
29+
~/.cargo/git
30+
target
31+
key: ubuntu-latest-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
32+
restore-keys: ubuntu-latest-cargo-clippy-
33+
34+
- name: Run clippy
35+
run: cargo clippy --workspace --all-features -- -D warnings
36+
1237
test:
1338
strategy:
1439
matrix:
@@ -22,7 +47,6 @@ jobs:
2247
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
2348
with:
2449
toolchain: stable
25-
components: clippy
2650

2751
- name: Cache cargo
2852
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
@@ -34,9 +58,6 @@ jobs:
3458
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3559
restore-keys: ${{ matrix.os }}-cargo-
3660

37-
- name: Run clippy
38-
run: cargo clippy --workspace --all-features -- -D warnings
39-
4061
- name: Run tests
4162
run: cargo test --workspace --all-features
4263

crates/socket-patch-core/src/package_json/update.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ mod tests {
156156
let result = update_package_json(&pkg, false).await;
157157
assert_eq!(result.status, UpdateStatus::Updated);
158158
let content = fs::read_to_string(&pkg).await.unwrap();
159-
assert!(content.contains("socket patch apply"));
159+
assert!(content.contains("socket-patch apply"));
160160
}
161161

162162
#[tokio::test]
@@ -178,7 +178,7 @@ mod tests {
178178
assert_eq!(result.status, UpdateStatus::Updated);
179179
let content = fs::read_to_string(&pkg).await.unwrap();
180180
assert!(content.contains("postinstall"));
181-
assert!(content.contains("socket patch apply"));
181+
assert!(content.contains("socket-patch apply"));
182182
}
183183

184184
#[tokio::test]

0 commit comments

Comments
 (0)