Skip to content
Merged
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
5 changes: 5 additions & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ unreachable = "deny"
# 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.
indexing_slicing = "deny"
# Require every `#[allow(...)]` to carry a `reason = "..."` explaining why the
# lint is suppressed. Suppressions silence the linter, so each one should be
# justified in-place; this keeps them auditable and prevents stale or
# copy-pasted allows from accumulating unexplained.
allow_attributes_without_reason = "deny"
# Forbid string slicing (`&s[i..j]`) which panics when a bound falls inside a
# UTF-8 multi-byte char. `indexing_slicing` covers arrays/slices/`Vec`, not `str`;
# this closes that remaining panic gap. Prefer `.get(i..j)` for fallible slicing.
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 use unwrap/expect/panic for brevity; only production code must stay panic-free"
)]
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 use unwrap/expect/panic and short-lived locks for brevity; only production code must stay panic-free"
)]
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 use unwrap/expect/panic for brevity; only production code must stay panic-free"
)]
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 use unwrap/expect/panic and short-lived locks for brevity; only production code must stay panic-free"
)]
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 use unwrap/expect/panic for brevity; only production code must stay panic-free"
)]
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 use unwrap/expect/panic for brevity; only production code must stay panic-free"
)]
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 use unwrap/expect/panic for brevity; only production code must stay panic-free"
)]
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 = "tests use unwrap/expect/panic for brevity; only production code must stay panic-free"
)]

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