Skip to content

Commit 0b515fa

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 0b515fa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/rust.yml

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

0 commit comments

Comments
 (0)