Skip to content

Commit a05b2b6

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 3aafe0f commit a05b2b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ 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+
run: |
87+
rustup component add clippy
88+
cargo clippy --lib --verbose --color always -- -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
89+
cargo clippy --lib --features uniffi --verbose --color always -- -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
8490
- name: Test on Rust ${{ matrix.toolchain }}
8591
if: "matrix.platform != 'windows-latest'"
8692
run: |

0 commit comments

Comments
 (0)