Skip to content

Commit 374b732

Browse files
committed
Ban new library unwraps in CI
Fail library clippy runs when new unwrap calls are introduced so the unwrap policy stays enforced without pulling tests, benches, or docs into the restriction. Co-Authored-By: HAL 9000
1 parent 9878330 commit 374b732

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/rust.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ jobs:
8181
- name: Check release build with UniFFI support on Rust ${{ matrix.toolchain }}
8282
if: matrix.build-uniffi
8383
run: cargo check --release --features uniffi --verbose --color always
84+
- name: Ban unwrap in library code on Rust ${{ matrix.toolchain }}
85+
if: matrix.build-uniffi
86+
env:
87+
RUSTFLAGS: ""
88+
run: |
89+
rustup component add clippy
90+
cargo clippy --lib --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
91+
cargo clippy --lib --features uniffi --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
8492
- name: Test on Rust ${{ matrix.toolchain }}
8593
if: "matrix.platform != 'windows-latest'"
8694
run: |

0 commit comments

Comments
 (0)