diff --git a/Cargo.toml b/Cargo.toml index 85057f3c..c9565039 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,6 +82,7 @@ radicle-surf = "0.26.0" clippy.type_complexity = "allow" clippy.enum_variant_names = "allow" clippy.fallible_impl_from = "deny" +clippy.wildcard_enum_match_arm = "deny" [profile.container] inherits = "release" diff --git a/crates/radicle-cli/src/commands/inbox.rs b/crates/radicle-cli/src/commands/inbox.rs index 7dd3ddbc..616e3382 100644 --- a/crates/radicle-cli/src/commands/inbox.rs +++ b/crates/radicle-cli/src/commands/inbox.rs @@ -453,7 +453,8 @@ fn show( .spawn()? .wait()?; } - notification => { + notification @ NotificationKind::Cob { .. } + | notification @ NotificationKind::Unknown { .. } => { term::json::to_pretty(¬ification, Path::new("notification.json"))?.print(); } } diff --git a/crates/radicle-cli/src/commands/issue/args.rs b/crates/radicle-cli/src/commands/issue/args.rs index de04489e..e89023f3 100644 --- a/crates/radicle-cli/src/commands/issue/args.rs +++ b/crates/radicle-cli/src/commands/issue/args.rs @@ -196,7 +196,7 @@ impl Command { // Special handling for `--edit` will be removed in the future. | Command::Edit { .. } => true, Command::Comment(args) => !args.is_edit(), - _ => false, + Command::Cache{..} | Command::Show { .. } | Command::List(_) => false, } } } diff --git a/crates/radicle-cli/src/commands/patch/review/builder.rs b/crates/radicle-cli/src/commands/patch/review/builder.rs index 05427305..ba5c6b27 100644 --- a/crates/radicle-cli/src/commands/patch/review/builder.rs +++ b/crates/radicle-cli/src/commands/patch/review/builder.rs @@ -186,7 +186,10 @@ impl ReviewItem { Self::FileAdded { hunk, .. } => hunk.as_ref(), Self::FileDeleted { hunk, .. } => hunk.as_ref(), Self::FileModified { hunk, .. } => hunk.as_ref(), - _ => None, + Self::FileMoved { .. } + | Self::FileCopied { .. } + | Self::FileEofChanged { .. } + | Self::FileModeChanged { .. } => None, } } @@ -277,7 +280,7 @@ impl ReviewItem { EofNewLine::OldMissing => { VStack::default().child(term::Label::new("`\\n` added at end-of-file")) } - _ => VStack::default(), + EofNewLine::BothMissing | EofNewLine::NoneMissing => VStack::default(), }, Self::FileModeChanged { .. } => VStack::default(), } diff --git a/crates/radicle-cli/src/git/unified_diff.rs b/crates/radicle-cli/src/git/unified_diff.rs index d37cdcbf..a167bec5 100644 --- a/crates/radicle-cli/src/git/unified_diff.rs +++ b/crates/radicle-cli/src/git/unified_diff.rs @@ -37,7 +37,7 @@ impl Error { match self { Self::UnexpectedEof => true, Self::Io(e) => e.kind() == io::ErrorKind::UnexpectedEof, - _ => false, + Self::Syntax(_) | Self::ParseInt(_) | Self::Utf8(_) => false, } } } diff --git a/crates/radicle-cli/src/node.rs b/crates/radicle-cli/src/node.rs index 3212ecc6..518f4f98 100644 --- a/crates/radicle-cli/src/node.rs +++ b/crates/radicle-cli/src/node.rs @@ -87,7 +87,7 @@ impl SyncError { fn is_connection_err(&self) -> bool { match self { Self::Node(e) => e.is_connection_err(), - _ => false, + Self::Repository(_) | Self::AllSeedsTimedOut | Self::Target(_) => false, } } } diff --git a/crates/radicle-cli/src/terminal/cob.rs b/crates/radicle-cli/src/terminal/cob.rs index d43f932c..1f1b8be4 100644 --- a/crates/radicle-cli/src/terminal/cob.rs +++ b/crates/radicle-cli/src/terminal/cob.rs @@ -102,6 +102,9 @@ where /// Adds a hint to the COB out-of-date database error. fn with_hint(e: profile::Error) -> anyhow::Error { + // There are many types that aren't `profile::Error::CobsCache`; specifying them all in an + // error path seems overly verbose with little value. + #[allow(clippy::wildcard_enum_match_arm)] match e { profile::Error::CobsCache(cob::cache::Error::OutOfDate) => { anyhow::Error::from(terminal::args::Error::WithHint { diff --git a/crates/radicle-core/src/repo.rs b/crates/radicle-core/src/repo.rs index 82a637b6..0ef25438 100644 --- a/crates/radicle-core/src/repo.rs +++ b/crates/radicle-core/src/repo.rs @@ -234,10 +234,12 @@ mod sqlite_impls { code: None, message: Some(e.to_string()), }), - _ => Err(Error { - code: None, - message: Some(format!("sql: invalid type `{:?}` for id", value.kind())), - }), + Value::Binary(_) | Value::Float(_) | Value::Integer(_) | Value::Null => { + Err(Error { + code: None, + message: Some(format!("sql: invalid type `{:?}` for id", value.kind())), + }) + } } } }