Skip to content

Commit ad04cfc

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 1ce86ac commit ad04cfc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/rust.yml

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

0 commit comments

Comments
 (0)