From ac87fd4006a8090db6a11b06e9c9c5e82032b668 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 30 Jun 2024 15:30:38 -0400 Subject: [PATCH] Disable Clippy's `too-many-arguments` rule (#4663) ## Summary We allow this constantly, I think it's just too pedantic for us. --- Cargo.toml | 1 + crates/pep508-rs/src/marker.rs | 1 - crates/uv-build/src/lib.rs | 2 -- crates/uv-dispatch/src/lib.rs | 1 - crates/uv-distribution/src/source/mod.rs | 2 -- crates/uv-installer/src/plan.rs | 1 - crates/uv-resolver/src/manifest.rs | 1 - crates/uv-resolver/src/resolution/display.rs | 2 +- crates/uv-resolver/src/resolution/graph.rs | 1 - crates/uv-resolver/src/resolver/mod.rs | 2 -- crates/uv-resolver/src/resolver/provider.rs | 1 - crates/uv-resolver/src/version_map.rs | 2 -- crates/uv/src/commands/pip/operations.rs | 2 -- crates/uv/src/commands/pip/tree.rs | 1 - crates/uv/src/commands/pip/uninstall.rs | 1 - crates/uv/src/commands/project/lock.rs | 2 -- crates/uv/src/commands/project/mod.rs | 1 - crates/uv/src/commands/project/remove.rs | 1 - crates/uv/src/commands/project/run.rs | 1 - crates/uv/src/commands/project/sync.rs | 2 -- crates/uv/src/commands/tool/install.rs | 1 - crates/uv/src/commands/tool/list.rs | 1 - crates/uv/src/commands/tool/run.rs | 1 - crates/uv/src/commands/tool/uninstall.rs | 1 - 24 files changed, 2 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a8fbb2452..432f92238 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -179,6 +179,7 @@ module_name_repetitions = "allow" must_use_candidate = "allow" similar_names = "allow" too_many_lines = "allow" +too_many_arguments = "allow" # Disallowed restriction lints print_stdout = "warn" print_stderr = "warn" diff --git a/crates/pep508-rs/src/marker.rs b/crates/pep508-rs/src/marker.rs index ec12f3a69..2969f01a4 100644 --- a/crates/pep508-rs/src/marker.rs +++ b/crates/pep508-rs/src/marker.rs @@ -681,7 +681,6 @@ impl MarkerEnvironment { python_version, sys_platform ))] - #[allow(clippy::too_many_arguments)] fn py_new( implementation_name: &str, implementation_version: &str, diff --git a/crates/uv-build/src/lib.rs b/crates/uv-build/src/lib.rs index 76ccbb951..488878bc4 100644 --- a/crates/uv-build/src/lib.rs +++ b/crates/uv-build/src/lib.rs @@ -398,7 +398,6 @@ impl SourceBuild { /// contents from an archive if necessary. /// /// `source_dist` is for error reporting only. - #[allow(clippy::too_many_arguments)] pub async fn setup( source: &Path, subdirectory: Option<&Path>, @@ -901,7 +900,6 @@ fn escape_path_for_python(path: &Path) -> String { } /// Not a method because we call it before the builder is completely initialized -#[allow(clippy::too_many_arguments)] async fn create_pep517_build_environment( runner: &PythonRunner, source_tree: &Path, diff --git a/crates/uv-dispatch/src/lib.rs b/crates/uv-dispatch/src/lib.rs index 47a62c3e6..89fa0c837 100644 --- a/crates/uv-dispatch/src/lib.rs +++ b/crates/uv-dispatch/src/lib.rs @@ -54,7 +54,6 @@ pub struct BuildDispatch<'a> { } impl<'a> BuildDispatch<'a> { - #[allow(clippy::too_many_arguments)] pub fn new( client: &'a RegistryClient, cache: &'a Cache, diff --git a/crates/uv-distribution/src/source/mod.rs b/crates/uv-distribution/src/source/mod.rs index 8ef637d62..802931dcf 100644 --- a/crates/uv-distribution/src/source/mod.rs +++ b/crates/uv-distribution/src/source/mod.rs @@ -433,7 +433,6 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { } /// Build a source distribution from a remote URL. - #[allow(clippy::too_many_arguments)] async fn url<'data>( &self, source: &BuildableSource<'data>, @@ -505,7 +504,6 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> { /// /// If the build backend supports `prepare_metadata_for_build_wheel`, this method will avoid /// building the wheel. - #[allow(clippy::too_many_arguments)] async fn url_metadata<'data>( &self, source: &BuildableSource<'data>, diff --git a/crates/uv-installer/src/plan.rs b/crates/uv-installer/src/plan.rs index b038d1822..569966898 100644 --- a/crates/uv-installer/src/plan.rs +++ b/crates/uv-installer/src/plan.rs @@ -50,7 +50,6 @@ impl<'a> Planner<'a> { /// The install plan will also respect the required hashes, such that it will never return a /// cached distribution that does not match the required hash. Like pip, though, it _will_ /// return an _installed_ distribution that does not match the required hash. - #[allow(clippy::too_many_arguments)] pub fn build( self, mut site_packages: SitePackages, diff --git a/crates/uv-resolver/src/manifest.rs b/crates/uv-resolver/src/manifest.rs index 2274d476d..97d34ee0d 100644 --- a/crates/uv-resolver/src/manifest.rs +++ b/crates/uv-resolver/src/manifest.rs @@ -50,7 +50,6 @@ pub struct Manifest { } impl Manifest { - #[allow(clippy::too_many_arguments)] pub fn new( requirements: Vec, constraints: Constraints, diff --git a/crates/uv-resolver/src/resolution/display.rs b/crates/uv-resolver/src/resolution/display.rs index f5f0acf66..a7aa15ce9 100644 --- a/crates/uv-resolver/src/resolution/display.rs +++ b/crates/uv-resolver/src/resolution/display.rs @@ -64,7 +64,7 @@ impl<'a> From<&'a ResolutionGraph> for DisplayResolutionGraph<'a> { impl<'a> DisplayResolutionGraph<'a> { /// Create a new [`DisplayResolutionGraph`] for the given graph. - #[allow(clippy::fn_params_excessive_bools, clippy::too_many_arguments)] + #[allow(clippy::fn_params_excessive_bools)] pub fn new( underlying: &'a ResolutionGraph, marker_env: Option<&'a MarkerEnvironment>, diff --git a/crates/uv-resolver/src/resolution/graph.rs b/crates/uv-resolver/src/resolution/graph.rs index fa4b2b52a..6fbe77e81 100644 --- a/crates/uv-resolver/src/resolution/graph.rs +++ b/crates/uv-resolver/src/resolution/graph.rs @@ -52,7 +52,6 @@ pub(crate) enum ResolutionGraphNode { impl ResolutionGraph { /// Create a new graph from the resolved PubGrub state. - #[allow(clippy::too_many_arguments)] pub(crate) fn from_state( requirements: &[Requirement], constraints: &Constraints, diff --git a/crates/uv-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs index 4ec479b33..0b3c42b5e 100644 --- a/crates/uv-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -137,7 +137,6 @@ impl<'a, Context: BuildContext, InstalledPackages: InstalledPackagesProvider> /// When a marker environment is provided, the resolver is in /// "non-universal" mode, which corresponds to standard `pip` behavior that /// works only for a specific marker environment. - #[allow(clippy::too_many_arguments)] pub fn new( manifest: Manifest, options: Options, @@ -180,7 +179,6 @@ impl Resolver { /// Initialize a new resolver using a user provided backend. - #[allow(clippy::too_many_arguments)] pub fn new_custom_io( manifest: Manifest, options: Options, diff --git a/crates/uv-resolver/src/resolver/provider.rs b/crates/uv-resolver/src/resolver/provider.rs index 2a586f63d..3279b32eb 100644 --- a/crates/uv-resolver/src/resolver/provider.rs +++ b/crates/uv-resolver/src/resolver/provider.rs @@ -86,7 +86,6 @@ pub struct DefaultResolverProvider<'a, Context: BuildContext> { impl<'a, Context: BuildContext> DefaultResolverProvider<'a, Context> { /// Reads the flat index entries and builds the provider. - #[allow(clippy::too_many_arguments)] pub fn new( fetcher: DistributionDatabase<'a, Context>, flat_index: &'a FlatIndex, diff --git a/crates/uv-resolver/src/version_map.rs b/crates/uv-resolver/src/version_map.rs index 384813955..1ba22eb73 100644 --- a/crates/uv-resolver/src/version_map.rs +++ b/crates/uv-resolver/src/version_map.rs @@ -40,7 +40,6 @@ impl VersionMap { /// /// PEP 592: #[instrument(skip_all, fields(package_name))] - #[allow(clippy::too_many_arguments)] pub(crate) fn from_metadata( simple_metadata: OwnedArchive, package_name: &PackageName, @@ -489,7 +488,6 @@ impl VersionMapLazy { SourceDistCompatibility::Compatible(hash) } - #[allow(clippy::too_many_arguments)] fn wheel_compatibility( &self, filename: &WheelFilename, diff --git a/crates/uv/src/commands/pip/operations.rs b/crates/uv/src/commands/pip/operations.rs index 87b9ee3ba..ecfe3d16e 100644 --- a/crates/uv/src/commands/pip/operations.rs +++ b/crates/uv/src/commands/pip/operations.rs @@ -73,7 +73,6 @@ pub(crate) async fn read_requirements( } /// Resolve a set of requirements, similar to running `pip compile`. -#[allow(clippy::too_many_arguments)] pub(crate) async fn resolve( requirements: Vec, constraints: Vec, @@ -278,7 +277,6 @@ pub(crate) enum Modifications { } /// Install a set of requirements into the current environment. -#[allow(clippy::too_many_arguments)] pub(crate) async fn install( resolution: &Resolution, site_packages: SitePackages, diff --git a/crates/uv/src/commands/pip/tree.rs b/crates/uv/src/commands/pip/tree.rs index a70019187..a00f07eab 100644 --- a/crates/uv/src/commands/pip/tree.rs +++ b/crates/uv/src/commands/pip/tree.rs @@ -18,7 +18,6 @@ use crate::commands::ExitStatus; use crate::printer::Printer; /// Display the installed packages in the current environment as a dependency tree. -#[allow(clippy::too_many_arguments)] pub(crate) fn pip_tree( depth: u8, prune: Vec, diff --git a/crates/uv/src/commands/pip/uninstall.rs b/crates/uv/src/commands/pip/uninstall.rs index a19c91b9b..27219ccb0 100644 --- a/crates/uv/src/commands/pip/uninstall.rs +++ b/crates/uv/src/commands/pip/uninstall.rs @@ -22,7 +22,6 @@ use crate::commands::{elapsed, ExitStatus}; use crate::printer::Printer; /// Uninstall packages from the current environment. -#[allow(clippy::too_many_arguments)] pub(crate) async fn pip_uninstall( sources: &[RequirementsSource], python: Option, diff --git a/crates/uv/src/commands/project/lock.rs b/crates/uv/src/commands/project/lock.rs index da6ba310d..2f21a508a 100644 --- a/crates/uv/src/commands/project/lock.rs +++ b/crates/uv/src/commands/project/lock.rs @@ -23,7 +23,6 @@ use crate::printer::Printer; use crate::settings::{ResolverSettings, ResolverSettingsRef}; /// Resolve the project requirements into a lockfile. -#[allow(clippy::too_many_arguments)] pub(crate) async fn lock( python: Option, settings: ResolverSettings, @@ -82,7 +81,6 @@ pub(crate) async fn lock( } /// Lock the project requirements into a lockfile. -#[allow(clippy::too_many_arguments)] pub(super) async fn do_lock( workspace: &Workspace, interpreter: &Interpreter, diff --git a/crates/uv/src/commands/project/mod.rs b/crates/uv/src/commands/project/mod.rs index 53ed68fc3..78a60a5b3 100644 --- a/crates/uv/src/commands/project/mod.rs +++ b/crates/uv/src/commands/project/mod.rs @@ -278,7 +278,6 @@ pub(crate) async fn init_environment( } /// Update a [`PythonEnvironment`] to satisfy a set of [`RequirementsSource`]s. -#[allow(clippy::too_many_arguments)] pub(crate) async fn update_environment( venv: PythonEnvironment, requirements: &[RequirementsSource], diff --git a/crates/uv/src/commands/project/remove.rs b/crates/uv/src/commands/project/remove.rs index 501a812f3..37d0c68ec 100644 --- a/crates/uv/src/commands/project/remove.rs +++ b/crates/uv/src/commands/project/remove.rs @@ -16,7 +16,6 @@ use crate::printer::Printer; use crate::settings::{InstallerSettings, ResolverSettings}; /// Remove one or more packages from the project requirements. -#[allow(clippy::too_many_arguments)] pub(crate) async fn remove( requirements: Vec, dependency_type: DependencyType, diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index 130dbb294..023a640ec 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -25,7 +25,6 @@ use crate::printer::Printer; use crate::settings::ResolverInstallerSettings; /// Run a command. -#[allow(clippy::too_many_arguments)] pub(crate) async fn run( extras: ExtrasSpecification, dev: bool, diff --git a/crates/uv/src/commands/project/sync.rs b/crates/uv/src/commands/project/sync.rs index 6b7e82748..be588ba75 100644 --- a/crates/uv/src/commands/project/sync.rs +++ b/crates/uv/src/commands/project/sync.rs @@ -19,7 +19,6 @@ use crate::printer::Printer; use crate::settings::{InstallerSettings, InstallerSettingsRef}; /// Sync the project environment. -#[allow(clippy::too_many_arguments)] pub(crate) async fn sync( extras: ExtrasSpecification, dev: bool, @@ -82,7 +81,6 @@ pub(crate) async fn sync( } /// Sync a lockfile with an environment. -#[allow(clippy::too_many_arguments)] pub(super) async fn do_sync( project: &VirtualProject, venv: &PythonEnvironment, diff --git a/crates/uv/src/commands/tool/install.rs b/crates/uv/src/commands/tool/install.rs index b96a7a039..76b3c24be 100644 --- a/crates/uv/src/commands/tool/install.rs +++ b/crates/uv/src/commands/tool/install.rs @@ -28,7 +28,6 @@ use crate::printer::Printer; use crate::settings::ResolverInstallerSettings; /// Install a tool. -#[allow(clippy::too_many_arguments)] pub(crate) async fn install( package: String, from: Option, diff --git a/crates/uv/src/commands/tool/list.rs b/crates/uv/src/commands/tool/list.rs index 6f6a3a9e4..2a7997535 100644 --- a/crates/uv/src/commands/tool/list.rs +++ b/crates/uv/src/commands/tool/list.rs @@ -10,7 +10,6 @@ use crate::commands::ExitStatus; use crate::printer::Printer; /// List installed tools. -#[allow(clippy::too_many_arguments)] pub(crate) async fn list(preview: PreviewMode, printer: Printer) -> Result { if preview.is_disabled() { warn_user_once!("`uv tool list` is experimental and may change without warning."); diff --git a/crates/uv/src/commands/tool/run.rs b/crates/uv/src/commands/tool/run.rs index 59d066bee..09c7d9815 100644 --- a/crates/uv/src/commands/tool/run.rs +++ b/crates/uv/src/commands/tool/run.rs @@ -25,7 +25,6 @@ use crate::printer::Printer; use crate::settings::ResolverInstallerSettings; /// Run a command. -#[allow(clippy::too_many_arguments)] pub(crate) async fn run( command: ExternalCommand, python: Option, diff --git a/crates/uv/src/commands/tool/uninstall.rs b/crates/uv/src/commands/tool/uninstall.rs index ad7b57be3..bfd2eb3f6 100644 --- a/crates/uv/src/commands/tool/uninstall.rs +++ b/crates/uv/src/commands/tool/uninstall.rs @@ -13,7 +13,6 @@ use crate::commands::ExitStatus; use crate::printer::Printer; /// Uninstall a tool. -#[allow(clippy::too_many_arguments)] pub(crate) async fn uninstall( name: String, preview: PreviewMode,