From b4b567b673469eb292e51262369bc9b5006a5644 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Wed, 11 Mar 2026 22:38:58 +0100 Subject: [PATCH] Replace `#[allow(...)]` with `#[expect(...)]` `expect` works like `allow` except it fails if the lint isn't actually required. So helps to catch things like unnecessary `#[allow(dead_code)]`. --- crates/but-action/src/auto_commit.rs | 4 ++-- crates/but-action/src/lib.rs | 2 +- crates/but-api-macros/src/lib.rs | 2 +- crates/but-api/src/legacy/open.rs | 1 - crates/but-bot/src/lib.rs | 2 +- crates/but-claude/src/claude_transcript.rs | 2 +- crates/but-claude/src/permissions/patterns.rs | 1 - crates/but-claude/src/session.rs | 2 +- crates/but-core/src/tree/mod.rs | 2 +- crates/but-core/src/worktree/checkout/tree.rs | 2 +- crates/but-ctx/src/lib.rs | 11 ++++------- crates/but-github/src/token.rs | 2 -- crates/but-gitlab/src/token.rs | 2 -- crates/but-hunk-dependency/src/ui.rs | 2 +- .../but-hunk-dependency/tests/hunk_dependency/ui.rs | 2 +- .../tests/hunk_dependency/workspace_dependencies.rs | 2 +- crates/but-link/tests/claiming.rs | 11 +++++------ crates/but-link/tests/cli.rs | 2 +- crates/but-link/tests/db.rs | 5 ++--- crates/but-link/tests/payloads.rs | 2 -- crates/but-link/tests/repo.rs | 4 ++-- crates/but-meta/src/legacy/storage.rs | 2 +- crates/but-meta/src/virtual_branches_legacy_types.rs | 2 +- crates/but-project-handle/src/project_handle.rs | 2 +- crates/but-rebase/src/graph_rebase/cherry_pick.rs | 2 +- crates/but-rebase/src/graph_rebase/mod.rs | 1 - crates/but-schemars/src/lib.rs | 6 +++--- crates/but-workspace/src/branch/apply.rs | 2 +- crates/but-workspace/src/commit/mod.rs | 2 +- .../src/tree_manipulation/create_tree_without_diff.rs | 1 - crates/but-worktrees/tests/worktree/main.rs | 2 +- crates/but/src/command/legacy/absorb.rs | 2 +- crates/but/src/command/legacy/branch/list.rs | 4 ++-- crates/but/src/command/legacy/branch/mod.rs | 2 +- crates/but/src/command/legacy/branch/show.rs | 1 - crates/but/src/command/legacy/diff/show.rs | 2 +- crates/but/src/command/legacy/forge/review.rs | 8 ++++---- crates/but/src/command/legacy/rub/mod.rs | 1 - crates/but/src/command/legacy/rub/squash.rs | 2 +- crates/but/src/command/legacy/status/json.rs | 1 - crates/but/src/command/legacy/status/mod.rs | 2 +- crates/but/vendor/cli-prompts/examples/general.rs | 2 +- crates/gitbutler-repo-actions/src/repository.rs | 2 +- crates/gitbutler-tauri/src/claude.rs | 2 +- 44 files changed, 50 insertions(+), 68 deletions(-) diff --git a/crates/but-action/src/auto_commit.rs b/crates/but-action/src/auto_commit.rs index 820f32fd98a..c9a705945ff 100644 --- a/crates/but-action/src/auto_commit.rs +++ b/crates/but-action/src/auto_commit.rs @@ -59,7 +59,7 @@ impl AutoCommitEvent { } } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub(crate) fn auto_commit( project_id: ProjectHandleOrLegacyProjectId, repo: &gix::Repository, @@ -135,7 +135,7 @@ pub(crate) fn auto_commit_simple( ) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn apply_commit_changes( project_id: Option, repo: &gix::Repository, diff --git a/crates/but-action/src/lib.rs b/crates/but-action/src/lib.rs index d8e65757087..dc91e5df87d 100644 --- a/crates/but-action/src/lib.rs +++ b/crates/but-action/src/lib.rs @@ -40,7 +40,7 @@ pub fn branch_changes( branch_changes::branch_changes(ctx, llm, changes, model) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub fn auto_commit( project_id: ProjectHandleOrLegacyProjectId, repo: &gix::Repository, diff --git a/crates/but-api-macros/src/lib.rs b/crates/but-api-macros/src/lib.rs index 3eaaab653c9..7c957248a5c 100644 --- a/crates/but-api-macros/src/lib.rs +++ b/crates/but-api-macros/src/lib.rs @@ -297,7 +297,7 @@ pub fn but_api(attr: TokenStream, item: TokenStream) -> TokenStream { #input_fn const _: () = { - #[allow(dead_code)] + #[expect(dead_code)] fn keep_json(_json: #json_ty) {} }; diff --git a/crates/but-api/src/legacy/open.rs b/crates/but-api/src/legacy/open.rs index 4384ae6bc00..6ccf287ddc3 100644 --- a/crates/but-api/src/legacy/open.rs +++ b/crates/but-api/src/legacy/open.rs @@ -1,7 +1,6 @@ //! In place of commands.rs use std::env; -#[allow(unused_imports)] use anyhow::anyhow; use anyhow::{Context as _, Result, bail}; use but_api_macros::but_api; diff --git a/crates/but-bot/src/lib.rs b/crates/but-bot/src/lib.rs index bff6060c4aa..f23718f5b9e 100644 --- a/crates/but-bot/src/lib.rs +++ b/crates/but-bot/src/lib.rs @@ -22,7 +22,7 @@ pub fn bot( graph.start(&mut but_bot) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub fn forge_branch_chat( project_id: ProjectHandleOrLegacyProjectId, branch: String, diff --git a/crates/but-claude/src/claude_transcript.rs b/crates/but-claude/src/claude_transcript.rs index 2b0b0d21c6a..cbdd23dcdac 100644 --- a/crates/but-claude/src/claude_transcript.rs +++ b/crates/but-claude/src/claude_transcript.rs @@ -30,7 +30,7 @@ pub struct AssistantMessage { #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "type")] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub enum Record { #[serde(rename = "summary")] Summary { diff --git a/crates/but-claude/src/permissions/patterns.rs b/crates/but-claude/src/permissions/patterns.rs index ba1d769525b..7bd1c0ca5e0 100644 --- a/crates/but-claude/src/permissions/patterns.rs +++ b/crates/but-claude/src/permissions/patterns.rs @@ -148,7 +148,6 @@ impl PathPattern { } /// What kind of pattern to serialize as. -#[allow(dead_code)] #[derive(Debug, Clone, Copy, Serialize, Deserialize)] pub enum PathPatternKind { HomeRelative, diff --git a/crates/but-claude/src/session.rs b/crates/but-claude/src/session.rs index 46d18942e09..494787c5c2e 100644 --- a/crates/but-claude/src/session.rs +++ b/crates/but-claude/src/session.rs @@ -1590,7 +1590,7 @@ async fn handle_ask_user_question( /// `can_use_tool` callback to work correctly with the SDK's streaming mode. /// 2. Performs file locking to track which files are being edited during the session, /// preventing conflicts when Claude modifies files. -#[allow(unused_variables)] +#[expect(unused_variables)] fn create_pretool_use_hook( sync_ctx: ThreadSafeContext, stack_id: but_core::ref_metadata::StackId, diff --git a/crates/but-core/src/tree/mod.rs b/crates/but-core/src/tree/mod.rs index 68b160ac9de..ed5ea1ac8fc 100644 --- a/crates/but-core/src/tree/mod.rs +++ b/crates/but-core/src/tree/mod.rs @@ -485,7 +485,7 @@ fn to_additive_hunks( /// /// Note that this algorithm is kind of the opposite of what people would expect if it's run where `to_additive_hunks()` works. /// But here we are… just making this work. -#[allow(clippy::indexing_slicing)] +#[expect(clippy::indexing_slicing)] fn to_additive_hunks_fallback( hunks_to_keep: impl IntoIterator, worktree_hunks: &[HunkHeader], diff --git a/crates/but-core/src/worktree/checkout/tree.rs b/crates/but-core/src/worktree/checkout/tree.rs index e9a7f796e51..dea7f061d5d 100644 --- a/crates/but-core/src/worktree/checkout/tree.rs +++ b/crates/but-core/src/worktree/checkout/tree.rs @@ -20,7 +20,7 @@ impl Default for Lut { } } -#[allow(clippy::indexing_slicing)] +#[expect(clippy::indexing_slicing)] impl Lut { /// Insert a node for each component in slash-separated `rela_path`. pub fn track_file(&mut self, rela_path: &BStr) { diff --git a/crates/but-ctx/src/lib.rs b/crates/but-ctx/src/lib.rs index a801f78288c..222ea7db84f 100644 --- a/crates/but-ctx/src/lib.rs +++ b/crates/but-ctx/src/lib.rs @@ -380,7 +380,7 @@ impl Context { /// # IMPORTANT /// * if the workspace was changed, write the new workspace back into `&mut ws`. #[instrument(name = "Context::workspace_mut_and_db_mut", level = "debug", skip_all)] - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] pub fn workspace_mut_and_db_mut( &mut self, ) -> anyhow::Result<( @@ -442,7 +442,7 @@ impl Context { /// * if the workspace was changed, write it back into `&mut ws`. /// * Keep the guard alive like `let (_guard, …) = …`! #[instrument(name = "Context::workspace_and_db_mut", level = "debug", skip_all)] - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] pub fn workspace_and_db_mut( &mut self, ) -> anyhow::Result<( @@ -469,7 +469,6 @@ impl Context { level = "debug", skip_all )] - #[allow(clippy::type_complexity)] pub fn workspace_and_db_mut_with_perm( &mut self, _perm: &RepoShared, @@ -501,7 +500,7 @@ impl Context { /// * if the workspace was changed, write it back into `&mut ws`. /// * Keep the guard alive like `let (_guard, …) = …`! #[instrument(name = "Context::workspace_mut_from_head", level = "debug", skip_all)] - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] pub fn workspace_mut_and_db( &mut self, ) -> anyhow::Result<( @@ -526,7 +525,6 @@ impl Context { level = "debug", skip_all )] - #[allow(clippy::type_complexity)] pub fn workspace_mut_and_db_with_perm( &self, _perm: &RepoExclusive, @@ -558,7 +556,7 @@ impl Context { /// # IMPORTANT /// * Keep the guard alive like `let (_guard, …) = …`! #[instrument(name = "Context::workspace_from_head", level = "debug", skip_all)] - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] pub fn workspace_and_db( &self, ) -> anyhow::Result<( @@ -580,7 +578,6 @@ impl Context { level = "debug", skip_all )] - #[allow(clippy::type_complexity)] pub fn workspace_and_db_with_perm( &self, _perm: &RepoShared, diff --git a/crates/but-github/src/token.rs b/crates/but-github/src/token.rs index 13359b82680..d7d90b2b3e7 100644 --- a/crates/but-github/src/token.rs +++ b/crates/but-github/src/token.rs @@ -127,12 +127,10 @@ pub enum GitHubAccount { username: String, access_token: Sensitive, }, - #[allow(dead_code)] Pat { username: String, access_token: Sensitive, }, - #[allow(dead_code)] Enterprise { username: String, host: String, diff --git a/crates/but-gitlab/src/token.rs b/crates/but-gitlab/src/token.rs index b4ee43ccdd5..55a0c3d4d5e 100644 --- a/crates/but-gitlab/src/token.rs +++ b/crates/but-gitlab/src/token.rs @@ -113,12 +113,10 @@ impl std::fmt::Display for GitlabAccountIdentifier { } pub enum GitLabAccount { - #[allow(dead_code)] Pat { username: String, access_token: Sensitive, }, - #[allow(dead_code)] SelfHosted { username: String, host: String, diff --git a/crates/but-hunk-dependency/src/ui.rs b/crates/but-hunk-dependency/src/ui.rs index 31d95b0e0b1..2aebdbfa588 100644 --- a/crates/but-hunk-dependency/src/ui.rs +++ b/crates/but-hunk-dependency/src/ui.rs @@ -87,7 +87,7 @@ impl HunkDependencies { fn hunk_dependency_diffs_schema(generate: &mut schemars::SchemaGenerator) -> schemars::Schema { /// A mirror of the tuple `(String, DiffHunk, Vec)` for schema generation. #[derive(schemars::JsonSchema)] - #[allow(dead_code)] + #[expect(dead_code)] struct HunkDependencyDiff(String, DiffHunk, Vec); generate.subschema_for::>() diff --git a/crates/but-hunk-dependency/tests/hunk_dependency/ui.rs b/crates/but-hunk-dependency/tests/hunk_dependency/ui.rs index a8b820a7b32..dcf105fa2b0 100644 --- a/crates/but-hunk-dependency/tests/hunk_dependency/ui.rs +++ b/crates/but-hunk-dependency/tests/hunk_dependency/ui.rs @@ -321,7 +321,7 @@ mod util { pub struct TestContext { // TODO: remove this once this has been ported to 'modern' code, i.e. uses `but-graph::projection::Workspace`. - #[allow(dead_code)] + #[expect(dead_code)] pub tmpdir: Option, } diff --git a/crates/but-hunk-dependency/tests/hunk_dependency/workspace_dependencies.rs b/crates/but-hunk-dependency/tests/hunk_dependency/workspace_dependencies.rs index 55e5a4b225f..c4236fe7b21 100644 --- a/crates/but-hunk-dependency/tests/hunk_dependency/workspace_dependencies.rs +++ b/crates/but-hunk-dependency/tests/hunk_dependency/workspace_dependencies.rs @@ -911,7 +911,7 @@ mod util { pub ctx: Context, // TODO: make non-optional // TODO: remove once we don't need vb.toml anymore which is produced on the fly. - #[allow(dead_code)] + #[expect(dead_code)] tmpdir: Option, } } diff --git a/crates/but-link/tests/claiming.rs b/crates/but-link/tests/claiming.rs index 955c2833f47..1a024683934 100644 --- a/crates/but-link/tests/claiming.rs +++ b/crates/but-link/tests/claiming.rs @@ -4,22 +4,21 @@ use std::time::Duration; use rusqlite::{Connection, params}; use serde_json::json; -#[allow(dead_code)] +#[expect(dead_code)] #[path = "../src/services/acquire.rs"] mod acquire_impl; -#[allow(dead_code)] +#[expect(dead_code)] #[path = "../src/cli.rs"] mod cli; -#[allow(dead_code, unused_imports)] +#[expect(dead_code, unused_imports)] #[path = "../src/db/mod.rs"] mod db; -#[allow(dead_code)] +#[expect(dead_code)] #[path = "../src/payloads.rs"] mod payloads; -#[allow(dead_code)] +#[expect(dead_code)] #[path = "../src/repo.rs"] mod repo; -#[allow(dead_code)] #[path = "../src/text.rs"] mod text; diff --git a/crates/but-link/tests/cli.rs b/crates/but-link/tests/cli.rs index e6e9e6340b4..4911d881dbc 100644 --- a/crates/but-link/tests/cli.rs +++ b/crates/but-link/tests/cli.rs @@ -2,7 +2,7 @@ use std::time::Duration; use clap::{CommandFactory, Parser, error::ErrorKind}; -#[allow(dead_code)] +#[expect(dead_code)] #[path = "../src/cli.rs"] mod cli_impl; diff --git a/crates/but-link/tests/db.rs b/crates/but-link/tests/db.rs index ea19a321bb6..6a483fa9b60 100644 --- a/crates/but-link/tests/db.rs +++ b/crates/but-link/tests/db.rs @@ -1,13 +1,12 @@ use rusqlite::{Connection, params}; use serde_json::{Value, json}; -#[allow(dead_code, unused_imports)] +#[expect(dead_code, unused_imports)] #[path = "../src/db/mod.rs"] mod db; -#[allow(dead_code)] +#[expect(dead_code)] #[path = "../src/payloads.rs"] mod payloads; -#[allow(dead_code)] #[path = "../src/text.rs"] mod text; diff --git a/crates/but-link/tests/payloads.rs b/crates/but-link/tests/payloads.rs index 9c29118add0..a64bfb95ca8 100644 --- a/crates/but-link/tests/payloads.rs +++ b/crates/but-link/tests/payloads.rs @@ -1,7 +1,5 @@ -#[allow(dead_code)] #[path = "../src/payloads.rs"] mod payloads_impl; -#[allow(dead_code)] #[path = "../src/text.rs"] mod text; diff --git a/crates/but-link/tests/repo.rs b/crates/but-link/tests/repo.rs index 8827973be4c..e618bdfec37 100644 --- a/crates/but-link/tests/repo.rs +++ b/crates/but-link/tests/repo.rs @@ -1,7 +1,7 @@ -#[allow(dead_code)] +#[expect(dead_code)] #[path = "../src/cli.rs"] mod cli; -#[allow(dead_code)] +#[expect(dead_code)] #[path = "../src/repo.rs"] mod repo_impl; diff --git a/crates/but-meta/src/legacy/storage.rs b/crates/but-meta/src/legacy/storage.rs index ea28fadf04c..4ca7cd0ac1d 100644 --- a/crates/but-meta/src/legacy/storage.rs +++ b/crates/but-meta/src/legacy/storage.rs @@ -586,7 +586,7 @@ fn snapshot_to_legacy(snapshot: &VirtualBranchesSnapshot) -> anyhow::Result( .attach(repo)) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn commit_from_conflicted_tree<'repo>( parents: &[gix::ObjectId], mut to_rebase: but_core::Commit<'repo>, diff --git a/crates/but-rebase/src/graph_rebase/mod.rs b/crates/but-rebase/src/graph_rebase/mod.rs index 91de37060cd..4b4be2acf48 100644 --- a/crates/but-rebase/src/graph_rebase/mod.rs +++ b/crates/but-rebase/src/graph_rebase/mod.rs @@ -225,7 +225,6 @@ pub struct Editor { } /// Represents a successful rebase, and any valid, but potentially conflicting scenarios it had. -#[allow(unused)] #[derive(Debug, Clone)] pub struct SuccessfulRebase { pub(crate) repo: gix::Repository, diff --git a/crates/but-schemars/src/lib.rs b/crates/but-schemars/src/lib.rs index 30e3c98fed6..da3e044b63a 100644 --- a/crates/but-schemars/src/lib.rs +++ b/crates/but-schemars/src/lib.rs @@ -221,7 +221,7 @@ pub fn bstring_bytes_opt(generate: &mut schemars::SchemaGenerator) -> schemars:: } #[derive(schemars::JsonSchema)] -#[allow(dead_code)] +#[expect(dead_code)] struct GixTime { seconds: i64, offset: i32, @@ -243,7 +243,7 @@ pub fn gix_time_opt(generate: &mut schemars::SchemaGenerator) -> schemars::Schem #[derive(schemars::JsonSchema)] #[schemars(rename = "EntryKind")] -#[allow(dead_code)] +#[expect(dead_code)] enum EntryKindSchema { Tree, Blob, @@ -269,7 +269,7 @@ pub fn entry_kind(generate: &mut schemars::SchemaGenerator) -> schemars::Schema /// Schema for `serde_error::Error` which serializes as `{description: string, source?: Error | null}`. #[derive(schemars::JsonSchema)] #[schemars(rename = "SerdeError")] -#[allow(dead_code)] +#[expect(dead_code)] struct SerdeErrorSchema { description: String, source: Option>, diff --git a/crates/but-workspace/src/branch/apply.rs b/crates/but-workspace/src/branch/apply.rs index 43df52f0c83..bc3b96a9b64 100644 --- a/crates/but-workspace/src/branch/apply.rs +++ b/crates/but-workspace/src/branch/apply.rs @@ -127,7 +127,7 @@ pub struct Options { pub new_stack_id: Option StackId>, } -#[allow(clippy::indexing_slicing)] +#[expect(clippy::indexing_slicing)] pub(crate) mod function { use std::borrow::Cow; diff --git a/crates/but-workspace/src/commit/mod.rs b/crates/but-workspace/src/commit/mod.rs index ef2f9b68b1f..a47ed09c555 100644 --- a/crates/but-workspace/src/commit/mod.rs +++ b/crates/but-workspace/src/commit/mod.rs @@ -141,7 +141,7 @@ pub mod merge { tips.into_iter().map(|t| (I::Merge, t)).collect(); let mut ran_merge_trials_loop_safety = false; - #[allow(clippy::indexing_slicing)] + #[expect(clippy::indexing_slicing)] 'retry_loop: loop { let mut prev_base_sidx = None; let mut merge_tree_id = None; diff --git a/crates/but-workspace/src/tree_manipulation/create_tree_without_diff.rs b/crates/but-workspace/src/tree_manipulation/create_tree_without_diff.rs index f42e061852b..ee7fef8254e 100644 --- a/crates/but-workspace/src/tree_manipulation/create_tree_without_diff.rs +++ b/crates/but-workspace/src/tree_manipulation/create_tree_without_diff.rs @@ -15,7 +15,6 @@ pub enum ChangesSource { id: gix::ObjectId, }, /// Changes between two arbitrary trees - #[allow(dead_code)] Tree { /// The "after" tree ID after_id: gix::ObjectId, diff --git a/crates/but-worktrees/tests/worktree/main.rs b/crates/but-worktrees/tests/worktree/main.rs index adacce4390b..0e2288df7b2 100644 --- a/crates/but-worktrees/tests/worktree/main.rs +++ b/crates/but-worktrees/tests/worktree/main.rs @@ -24,7 +24,7 @@ mod util { }) } - #[allow(unused)] + #[expect(unused)] pub struct TestContext { pub ctx: Context, pub handle: VirtualBranchesHandle, diff --git a/crates/but/src/command/legacy/absorb.rs b/crates/but/src/command/legacy/absorb.rs index eeace0972d8..7b0e29eb763 100644 --- a/crates/but/src/command/legacy/absorb.rs +++ b/crates/but/src/command/legacy/absorb.rs @@ -122,7 +122,7 @@ pub(crate) fn handle( } /// Absorb a single file into the appropriate commit -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn absorb_assignments( absorption_plan: Vec, guard: &mut RepoExclusiveGuard, diff --git a/crates/but/src/command/legacy/branch/list.rs b/crates/but/src/command/legacy/branch/list.rs index 3b175a36a70..28c809e9801 100644 --- a/crates/but/src/command/legacy/branch/list.rs +++ b/crates/but/src/command/legacy/branch/list.rs @@ -7,7 +7,7 @@ use gitbutler_branch_actions::BranchListingFilter; use crate::utils::OutputChannel; -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub fn list( ctx: &mut but_ctx::Context, local: bool, @@ -236,7 +236,7 @@ pub fn list( Ok(()) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn output_json( applied_stacks: &[but_workspace::legacy::ui::StackEntry], branches: &[gitbutler_branch_actions::BranchListing], diff --git a/crates/but/src/command/legacy/branch/mod.rs b/crates/but/src/command/legacy/branch/mod.rs index 797f30f51dd..b8b831b32e1 100644 --- a/crates/but/src/command/legacy/branch/mod.rs +++ b/crates/but/src/command/legacy/branch/mod.rs @@ -161,7 +161,7 @@ pub fn show_branches( Ok(()) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub fn list_branches( ctx: &mut but_ctx::Context, out: &mut OutputChannel, diff --git a/crates/but/src/command/legacy/branch/show.rs b/crates/but/src/command/legacy/branch/show.rs index 2634b3764b9..c0f3ba2593b 100644 --- a/crates/but/src/command/legacy/branch/show.rs +++ b/crates/but/src/command/legacy/branch/show.rs @@ -6,7 +6,6 @@ use tracing::instrument; use crate::utils::{OutputChannel, shorten_object_id}; -#[allow(clippy::too_many_arguments)] pub fn show( ctx: &mut Context, branch_id: &str, diff --git a/crates/but/src/command/legacy/diff/show.rs b/crates/but/src/command/legacy/diff/show.rs index bde69d0866c..ffe84a7cc46 100644 --- a/crates/but/src/command/legacy/diff/show.rs +++ b/crates/but/src/command/legacy/diff/show.rs @@ -11,7 +11,7 @@ use super::{ }; use crate::{IdMap, id::UncommittedCliId, utils::OutputChannel}; -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(crate) enum Filter { Unassigned, Uncommitted(UncommittedCliId), diff --git a/crates/but/src/command/legacy/forge/review.rs b/crates/but/src/command/legacy/forge/review.rs index ea27f55564f..a3833ef189b 100644 --- a/crates/but/src/command/legacy/forge/review.rs +++ b/crates/but/src/command/legacy/forge/review.rs @@ -278,7 +278,7 @@ pub fn set_review_template( /// Create a new forge review for a branch. /// If no branch is specified, prompts the user to select one. /// If there is only one branch without a an acco, asks for confirmation. -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub async fn create_review( ctx: &mut Context, branch: Option, @@ -447,7 +447,7 @@ fn get_branch_names(project: &Project, branch_id: &str) -> anyhow::Result>, @@ -612,7 +612,7 @@ fn prompt_for_branch_selection( Ok(selected_branches) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] async fn publish_reviews_for_branch_and_dependents( ctx: &mut Context, branch_name: &str, @@ -857,7 +857,7 @@ pub fn parse_review_message(content: &str) -> anyhow::Result Ok(ForgeReviewMessage { title, body }) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] async fn publish_review_for_branch( ctx: &mut Context, stack_id: Option, diff --git a/crates/but/src/command/legacy/rub/mod.rs b/crates/but/src/command/legacy/rub/mod.rs index cdd5827b886..b3a2e70a39e 100644 --- a/crates/but/src/command/legacy/rub/mod.rs +++ b/crates/but/src/command/legacy/rub/mod.rs @@ -229,7 +229,6 @@ impl<'a> RubOperation<'a> { /// /// This function is the single source of truth for what operations are valid. /// Both `handle()` and disambiguation logic use this function. -#[allow(private_interfaces)] pub(crate) fn route_operation<'a>( source: &'a CliId, target: &'a CliId, diff --git a/crates/but/src/command/legacy/rub/squash.rs b/crates/but/src/command/legacy/rub/squash.rs index 78de4a455f5..066e8854636 100644 --- a/crates/but/src/command/legacy/rub/squash.rs +++ b/crates/but/src/command/legacy/rub/squash.rs @@ -314,7 +314,7 @@ fn squash_commits_internal( } /// Helper function to squash all commits in a branch into the bottom-most commit -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn squash_branch_commits( ctx: &mut Context, out: &mut OutputChannel, diff --git a/crates/but/src/command/legacy/status/json.rs b/crates/but/src/command/legacy/status/json.rs index 0a64eed948d..faeb58ae604 100644 --- a/crates/but/src/command/legacy/status/json.rs +++ b/crates/but/src/command/legacy/status/json.rs @@ -289,7 +289,6 @@ impl From> for Ci { } impl Branch { - #[allow(clippy::too_many_arguments)] pub fn from_branch_details( repo: &gix::Repository, cli_id: String, diff --git a/crates/but/src/command/legacy/status/mod.rs b/crates/but/src/command/legacy/status/mod.rs index bab2f695b2c..f7610fff3af 100644 --- a/crates/but/src/command/legacy/status/mod.rs +++ b/crates/but/src/command/legacy/status/mod.rs @@ -590,7 +590,7 @@ fn ci_map( Ok(ci_map) } -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] fn print_assignments( repo: &gix::Repository, stack: Option, diff --git a/crates/but/vendor/cli-prompts/examples/general.rs b/crates/but/vendor/cli-prompts/examples/general.rs index 529d5b41140..47180e15bc8 100644 --- a/crates/but/vendor/cli-prompts/examples/general.rs +++ b/crates/but/vendor/cli-prompts/examples/general.rs @@ -6,7 +6,7 @@ use cli_prompts::{ #[derive(Debug)] enum CarModel { Audi, - #[allow(clippy::upper_case_acronyms)] + #[expect(clippy::upper_case_acronyms)] BMW, Chevrolet, } diff --git a/crates/gitbutler-repo-actions/src/repository.rs b/crates/gitbutler-repo-actions/src/repository.rs index fc8593f20f9..2757a97e133 100644 --- a/crates/gitbutler-repo-actions/src/repository.rs +++ b/crates/gitbutler-repo-actions/src/repository.rs @@ -14,7 +14,7 @@ use gitbutler_repo::{ use gitbutler_stack::{Stack, StackId}; use crate::askpass; -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] pub trait RepoActionsExt { fn fetch(&self, remote_name: &str, askpass: Option) -> Result<()>; /// Returns the stderr output of the git executable if used. diff --git a/crates/gitbutler-tauri/src/claude.rs b/crates/gitbutler-tauri/src/claude.rs index 9dbfb7eed49..dbb8449d420 100644 --- a/crates/gitbutler-tauri/src/claude.rs +++ b/crates/gitbutler-tauri/src/claude.rs @@ -14,7 +14,7 @@ use but_ctx::ProjectHandleOrLegacyProjectId; use tauri::State; use tracing::instrument; -#[allow(clippy::too_many_arguments)] +#[expect(clippy::too_many_arguments)] #[tauri::command(async)] #[instrument(skip(claude), err(Debug))] pub async fn claude_send_message(