Skip to content

Commit

Permalink
build: deny using expect in non-test code
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron authored and jcrossley3 committed Mar 28, 2024
1 parent d8ae8c6 commit 1f4602a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
allow-unwrap-in-tests = true
allow-expect-in-tests = true
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Check
run: cargo check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::unwrap_used
run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::unwrap_used -D clippy::expect_used
- name: Test
run: cargo test -- --nocapture
env:
Expand Down
1 change: 1 addition & 0 deletions common/infrastructure/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub trait Endpoint: Debug {
}

fn url() -> Url {
#[allow(clippy::expect_used)]
Url::parse(&format!("http://localhost:{}{}", Self::PORT, Self::PATH))
.expect("default value must parse")
}
Expand Down
1 change: 1 addition & 0 deletions common/infrastructure/src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ fn init_otlp(name: &str) {
println!("Using Jaeger tracing.");
println!("{:#?}", pipeline);

#[allow(clippy::expect_used)]
let tracer = pipeline
.install_batch(opentelemetry_sdk::runtime::Tokio)
.expect("unable to setup tracing pipeline");
Expand Down

0 comments on commit 1f4602a

Please sign in to comment.