Skip to content

Commit 8422182

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 Signed-off-by: Elias Rohrer <dev@tnull.de>
1 parent b8762bb commit 8422182

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/rust.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ jobs:
9090
run: |
9191
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --features uniffi
9292
93+
linting:
94+
- name: Checkout source code
95+
uses: actions/checkout@v6
96+
- name: Install Rust and clippy
97+
run: |
98+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable
99+
rustup component add clippy
100+
- name: Ban `unwrap` in library code
101+
run: |
102+
cargo clippy --lib --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
103+
cargo clippy --lib --features uniffi --verbose --color always -- -A warnings -D clippy::unwrap_used -A clippy::tabs_in_doc_comments
104+
93105
doc:
94106
name: Documentation
95107
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)