Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ unwrap_used = "deny"
expect_used = "deny"
panic = "deny"
unreachable = "deny"
# Require every `#[allow(...)]` to record a `reason = "..."`, so each opt-out of
# the panic-safety set above is self-documenting and auditable in review.
allow_attributes_without_reason = "deny"
# Forbid direct indexing/slicing (`a[i]`, `a[i..j]`) which panics out of bounds.
# Completes the no-panic family above by closing the remaining common panic
# source; prefer `.get(i)` / `.get(i..j)` so malformed input is handled, not fatal.
Expand Down
7 changes: 6 additions & 1 deletion lib/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,12 @@ pub fn restart_if_running(binary_path: &Path) -> Result<bool, String> {
}

#[cfg(test)]
#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
#[allow(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
reason = "tests deliberately unwrap/panic to fail fast on broken fixtures"
)]
mod tests {
use super::*;

Expand Down
3 changes: 2 additions & 1 deletion lib/src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ pub fn download_and_verify(client: &Client, info: &ReleaseInfo) -> Result<Downlo
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::significant_drop_tightening
clippy::significant_drop_tightening,
reason = "tests deliberately unwrap/panic to fail fast on broken fixtures"
)]
mod tests {
use super::*;
Expand Down
7 changes: 6 additions & 1 deletion lib/src/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ pub fn extract_zip(archive_bytes: &[u8]) -> Result<Vec<u8>, String> {
}

#[cfg(test)]
#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
#[allow(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
reason = "tests deliberately unwrap/panic to fail fast on broken fixtures"
)]
mod tests {
use super::*;
use std::io::Write;
Expand Down
8 changes: 6 additions & 2 deletions lib/src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ pub struct VersionInfo {

pub struct ReleaseInfo {
/// Retained for consumers that need the resolved tag (e.g. for display/logging).
#[allow(dead_code)]
#[allow(
dead_code,
reason = "retained for consumers that need the resolved tag (e.g. for display/logging)"
)]
pub tag: String,
pub asset_url: String,
pub checksums_url: String,
Expand Down Expand Up @@ -179,7 +182,8 @@ pub fn parse_checksum(checksums_text: &str, asset_name: &str) -> Result<String,
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::significant_drop_tightening
clippy::significant_drop_tightening,
reason = "tests deliberately unwrap/panic to fail fast on broken fixtures"
)]
mod tests {
use super::*;
Expand Down
7 changes: 6 additions & 1 deletion lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ pub fn install_binary_to(binary_bytes: &[u8], home_dir: &Path) -> Result<PathBuf
}

#[cfg(test)]
#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
#[allow(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
reason = "tests deliberately unwrap/panic to fail fast on broken fixtures"
)]
mod tests {
use super::*;

Expand Down
7 changes: 6 additions & 1 deletion lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ pub fn install(
}

#[cfg(test)]
#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
#[allow(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
reason = "tests deliberately unwrap/panic to fail fast on broken fixtures"
)]
mod tests {
use super::*;

Expand Down
7 changes: 6 additions & 1 deletion lib/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ pub fn detect() -> Result<Platform, String> {
}

#[cfg(test)]
#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
#[allow(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
reason = "tests deliberately unwrap/panic to fail fast on broken fixtures"
)]
mod tests {
use super::*;

Expand Down
7 changes: 6 additions & 1 deletion lib/tests/e2e_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
//!
//! Run with: `cargo test --test e2e_install -- --test-threads=1`

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
#![allow(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
reason = "end-to-end tests deliberately unwrap/panic to fail fast on broken fixtures"
)]

use std::fs;
use std::path::PathBuf;
Expand Down
Loading