diff --git a/crates/uv-build-backend/src/metadata.rs b/crates/uv-build-backend/src/metadata.rs index d2d86603f..363a7c4e9 100644 --- a/crates/uv-build-backend/src/metadata.rs +++ b/crates/uv-build-backend/src/metadata.rs @@ -428,7 +428,7 @@ impl PyProjectToml { } /// Parse and validate the old (PEP 621) and new (PEP 639) license files. - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] fn license_metadata( &self, root: &Path, diff --git a/crates/uv-cache-info/src/glob.rs b/crates/uv-cache-info/src/glob.rs index 35cf51607..c9e2132d6 100644 --- a/crates/uv-cache-info/src/glob.rs +++ b/crates/uv-cache-info/src/glob.rs @@ -81,7 +81,7 @@ impl<'a> Trie<'a> { } } - #[allow(clippy::needless_pass_by_value)] + #[expect(clippy::needless_pass_by_value)] fn collect_patterns( &self, pattern_prefix: PathBuf, @@ -109,7 +109,6 @@ impl<'a> Trie<'a> { } } - #[allow(clippy::needless_pass_by_value)] fn collect_groups(&self, prefix: PathBuf, groups: &mut Vec<(PathBuf, Vec)>) { // LCP-style grouping of patterns if self.patterns.is_empty() { diff --git a/crates/uv-cache/src/removal.rs b/crates/uv-cache/src/removal.rs index 5521da5c8..8fbf041fb 100644 --- a/crates/uv-cache/src/removal.rs +++ b/crates/uv-cache/src/removal.rs @@ -204,7 +204,7 @@ fn set_not_readonly(path: &Path) -> io::Result { } // We're about to delete the file, so it's fine to set the permissions to world-writable. - #[allow(clippy::permissions_set_readonly_false)] + #[expect(clippy::permissions_set_readonly_false)] perms.set_readonly(false); fs_err::set_permissions(path, perms)?; diff --git a/crates/uv-cli/build.rs b/crates/uv-cli/build.rs index 4fba83daa..82e3e9010 100644 --- a/crates/uv-cli/build.rs +++ b/crates/uv-cli/build.rs @@ -19,7 +19,6 @@ fn main() { commit_info(&workspace_root); - #[allow(clippy::disallowed_methods)] let target = std::env::var(EnvVars::TARGET).unwrap(); println!("cargo:rustc-env=RUST_HOST_TARGET={target}"); } diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index f135870a0..c9d282727 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -189,12 +189,12 @@ pub struct GlobalArgs { )] pub no_managed_python: bool, - #[allow(clippy::doc_markdown)] + #[expect(clippy::doc_markdown)] /// Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] #[arg(global = true, long, help_heading = "Python options", hide = true)] pub allow_python_downloads: bool, - #[allow(clippy::doc_markdown)] + #[expect(clippy::doc_markdown)] /// Disable automatic downloads of Python. [env: "UV_PYTHON_DOWNLOADS=never"] #[arg(global = true, long, help_heading = "Python options")] pub no_python_downloads: bool, @@ -399,7 +399,6 @@ impl From for anstream::ColorChoice { } #[derive(Subcommand)] -#[allow(clippy::large_enum_variant)] pub enum Commands { /// Manage authentication. #[command( @@ -1331,7 +1330,7 @@ fn parse_maybe_file_path(input: &str) -> Result, String> { } // Parse a string, mapping the empty string to `None`. -#[allow(clippy::unnecessary_wraps)] +#[expect(clippy::unnecessary_wraps)] fn parse_maybe_string(input: &str) -> Result, String> { if input.is_empty() { Ok(Maybe::None) @@ -4761,7 +4760,7 @@ pub struct TreeArgs { #[derive(Args)] pub struct ExportArgs { - #[allow(clippy::doc_markdown)] + #[expect(clippy::doc_markdown)] /// The format to which `uv.lock` should be exported. /// /// Supports `requirements.txt`, `pylock.toml` (PEP 751) and CycloneDX v1.5 JSON output formats. diff --git a/crates/uv-cli/src/options.rs b/crates/uv-cli/src/options.rs index 7917e42c2..eaa25c265 100644 --- a/crates/uv-cli/src/options.rs +++ b/crates/uv-cli/src/options.rs @@ -31,7 +31,7 @@ pub fn flag(yes: bool, no: bool, name: &str) -> Option { format!("--no-{name}").green(), ); // No error forwarding since should eventually be solved on the clap side. - #[allow(clippy::exit)] + #[expect(clippy::exit)] { std::process::exit(2); } @@ -176,7 +176,7 @@ pub fn check_conflicts(flag_a: Flag, flag_b: Flag) { display_a.green(), display_b.green(), ); - #[allow(clippy::exit)] + #[expect(clippy::exit)] { std::process::exit(2); } diff --git a/crates/uv-client/src/flat_index.rs b/crates/uv-client/src/flat_index.rs index fc5316ce5..8d8954c03 100644 --- a/crates/uv-client/src/flat_index.rs +++ b/crates/uv-client/src/flat_index.rs @@ -263,7 +263,7 @@ impl<'a> FlatIndexClient<'a> { flat_index: &IndexUrl, ) -> Result { // The path context is provided by the caller. - #[allow(clippy::disallowed_methods)] + #[expect(clippy::disallowed_methods)] let entries = std::fs::read_dir(path)?; let mut dists = Vec::new(); diff --git a/crates/uv-client/src/httpcache/mod.rs b/crates/uv-client/src/httpcache/mod.rs index 7f82731e6..eea0ea896 100644 --- a/crates/uv-client/src/httpcache/mod.rs +++ b/crates/uv-client/src/httpcache/mod.rs @@ -992,7 +992,7 @@ impl ArchivedCachePolicy { /// This dictates what the caller should do next by indicating whether the /// cached response is stale or not. #[derive(Debug)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub enum BeforeRequest { /// The cached response is still fresh, and the caller may return the /// cached response without issuing an HTTP requests. diff --git a/crates/uv-configuration/src/dependency_groups.rs b/crates/uv-configuration/src/dependency_groups.rs index 40205323a..ca19a27cf 100644 --- a/crates/uv-configuration/src/dependency_groups.rs +++ b/crates/uv-configuration/src/dependency_groups.rs @@ -86,7 +86,7 @@ impl DependencyGroups { } /// Create from raw CLI args - #[allow(clippy::fn_params_excessive_bools)] + #[expect(clippy::fn_params_excessive_bools)] pub fn from_args( dev: bool, no_dev: bool, diff --git a/crates/uv-configuration/src/extras.rs b/crates/uv-configuration/src/extras.rs index 511f1daa9..744fe2e23 100644 --- a/crates/uv-configuration/src/extras.rs +++ b/crates/uv-configuration/src/extras.rs @@ -76,7 +76,6 @@ impl ExtrasSpecification { } /// Create from raw CLI args - #[allow(clippy::fn_params_excessive_bools)] pub fn from_args( extra: Vec, no_extra: Vec, diff --git a/crates/uv-configuration/src/install_options.rs b/crates/uv-configuration/src/install_options.rs index db8edeaf0..964d4ed06 100644 --- a/crates/uv-configuration/src/install_options.rs +++ b/crates/uv-configuration/src/install_options.rs @@ -34,7 +34,7 @@ pub struct InstallOptions { } impl InstallOptions { - #[allow(clippy::fn_params_excessive_bools)] + #[expect(clippy::fn_params_excessive_bools)] pub fn new( no_install_project: bool, only_install_project: bool, diff --git a/crates/uv-configuration/src/threading.rs b/crates/uv-configuration/src/threading.rs index 2f70b5d81..749f4eddd 100644 --- a/crates/uv-configuration/src/threading.rs +++ b/crates/uv-configuration/src/threading.rs @@ -7,7 +7,7 @@ use uv_static::EnvVars; /// The default minimum stack size for uv threads. pub const UV_DEFAULT_STACK_SIZE: usize = 4 * 1024 * 1024; /// We don't allow setting a smaller stack size than 1MB. -#[allow(clippy::identity_op)] +#[expect(clippy::identity_op)] pub const UV_MIN_STACK_SIZE: usize = 1 * 1024 * 1024; /// Running out of stack has been an issue for us. We box types and futures in various places diff --git a/crates/uv-console/src/lib.rs b/crates/uv-console/src/lib.rs index f008c4c03..35a9dc724 100644 --- a/crates/uv-console/src/lib.rs +++ b/crates/uv-console/src/lib.rs @@ -61,7 +61,7 @@ fn confirm_inner( term.write_str("\n")?; term.flush()?; - #[allow(clippy::exit, clippy::cast_possible_wrap)] + #[expect(clippy::exit, clippy::cast_possible_wrap)] std::process::exit(if cfg!(windows) { 0xC000_013A_u32 as i32 } else { diff --git a/crates/uv-dev/src/generate_cli_reference.rs b/crates/uv-dev/src/generate_cli_reference.rs index 17781b7ec..1ef499d81 100644 --- a/crates/uv-dev/src/generate_cli_reference.rs +++ b/crates/uv-dev/src/generate_cli_reference.rs @@ -115,7 +115,7 @@ fn generate() -> String { output } -#[allow(clippy::format_push_string)] +#[expect(clippy::format_push_string)] fn generate_command<'a>(output: &mut String, command: &'a Command, parents: &mut Vec<&'a Command>) { if command.is_hide_set() && !SHOW_HIDDEN_COMMANDS.contains(&command.get_name()) { return; diff --git a/crates/uv-dev/src/generate_options_reference.rs b/crates/uv-dev/src/generate_options_reference.rs index 29e6e9bab..bc61b76ac 100644 --- a/crates/uv-dev/src/generate_options_reference.rs +++ b/crates/uv-dev/src/generate_options_reference.rs @@ -206,7 +206,7 @@ impl Set { } } -#[allow(clippy::format_push_string)] +#[expect(clippy::format_push_string)] fn emit_field(output: &mut String, name: &str, field: &OptionField, parents: &[Set]) { let header_level = if parents.len() > 1 { "####" } else { "###" }; let parents_anchor = parents.iter().filter_map(|parent| parent.name()).join("_"); diff --git a/crates/uv-distribution-filename/src/splitter.rs b/crates/uv-distribution-filename/src/splitter.rs index b692bd1fa..06e2bc60a 100644 --- a/crates/uv-distribution-filename/src/splitter.rs +++ b/crates/uv-distribution-filename/src/splitter.rs @@ -20,7 +20,7 @@ impl<'a> Iterator for MemchrSplitter<'a> { type Item = &'a str; #[inline(always)] - #[allow(clippy::inline_always)] + #[expect(clippy::inline_always)] fn next(&mut self) -> Option { match self.memchr.next() { Some(index) => { diff --git a/crates/uv-distribution-filename/src/wheel_tag.rs b/crates/uv-distribution-filename/src/wheel_tag.rs index de277ae75..1a344faa3 100644 --- a/crates/uv-distribution-filename/src/wheel_tag.rs +++ b/crates/uv-distribution-filename/src/wheel_tag.rs @@ -92,8 +92,8 @@ impl Display for WheelTag { rkyv::Deserialize, rkyv::Serialize, )] -#[rkyv(derive(Debug), attr(allow(clippy::struct_field_names)))] -#[allow(clippy::struct_field_names)] +#[rkyv(derive(Debug), attr(expect(clippy::struct_field_names)))] +#[expect(clippy::struct_field_names)] pub(crate) struct WheelTagSmall { /// The Python tag, e.g., `py3` in `1.2.3-py3-none-any`. pub(crate) python_tag: LanguageTag, @@ -125,8 +125,7 @@ impl Display for WheelTagSmall { rkyv::Deserialize, rkyv::Serialize, )] -#[rkyv(derive(Debug), attr(allow(clippy::struct_field_names)))] -#[allow(clippy::struct_field_names)] +#[rkyv(derive(Debug))] pub(crate) struct WheelTagLarge { /// The optional build tag, e.g., `73` in `1.2.3-73-py3-none-any`. pub(crate) build_tag: Option, diff --git a/crates/uv-distribution-types/src/any.rs b/crates/uv-distribution-types/src/any.rs index a545d1500..ef9fc3e5d 100644 --- a/crates/uv-distribution-types/src/any.rs +++ b/crates/uv-distribution-types/src/any.rs @@ -13,7 +13,6 @@ use crate::{InstalledMetadata, InstalledVersion, Name}; /// Note equality and hash operations are only based on the name and canonical version, not the /// kind. #[derive(Debug, Clone, Eq)] -#[allow(clippy::large_enum_variant)] pub enum LocalDist { Cached(CachedDist, CanonicalVersion), Installed(InstalledDist, CanonicalVersion), diff --git a/crates/uv-distribution-types/src/cached.rs b/crates/uv-distribution-types/src/cached.rs index 9c768b535..11f914ba2 100644 --- a/crates/uv-distribution-types/src/cached.rs +++ b/crates/uv-distribution-types/src/cached.rs @@ -12,7 +12,7 @@ use crate::{ /// A built distribution (wheel) that exists in the local cache. #[derive(Debug, Clone, Hash, PartialEq, Eq)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub enum CachedDist { /// The distribution exists in a registry, like `PyPI`. Registry(CachedRegistryDist), diff --git a/crates/uv-distribution-types/src/lib.rs b/crates/uv-distribution-types/src/lib.rs index cbe7668ec..6d91e9d36 100644 --- a/crates/uv-distribution-types/src/lib.rs +++ b/crates/uv-distribution-types/src/lib.rs @@ -204,7 +204,6 @@ pub enum DistRef<'a> { /// A wheel, with its three possible origins (index, url, path) #[derive(Debug, Clone, Hash, PartialEq, Eq)] -#[allow(clippy::large_enum_variant)] pub enum BuiltDist { Registry(RegistryBuiltDist), DirectUrl(DirectUrlBuiltDist), @@ -213,7 +212,6 @@ pub enum BuiltDist { /// A source distribution, with its possible origins (index, url, path, git) #[derive(Debug, Clone, Hash, PartialEq, Eq)] -#[allow(clippy::large_enum_variant)] pub enum SourceDist { Registry(RegistrySourceDist), DirectUrl(DirectUrlSourceDist), diff --git a/crates/uv-distribution-types/src/prioritized_distribution.rs b/crates/uv-distribution-types/src/prioritized_distribution.rs index 9c1b61bd1..7ccfe5cac 100644 --- a/crates/uv-distribution-types/src/prioritized_distribution.rs +++ b/crates/uv-distribution-types/src/prioritized_distribution.rs @@ -757,7 +757,6 @@ impl IncompatibleSource { } impl IncompatibleWheel { - #[allow(clippy::match_like_matches_macro)] fn is_more_compatible(&self, other: &Self) -> bool { match self { Self::ExcludeNewer(timestamp_self) => match other { diff --git a/crates/uv-distribution-types/src/requested.rs b/crates/uv-distribution-types/src/requested.rs index de3b4936d..7ab8c2348 100644 --- a/crates/uv-distribution-types/src/requested.rs +++ b/crates/uv-distribution-types/src/requested.rs @@ -11,7 +11,7 @@ use uv_pep440::Version; /// /// Either an already-installed distribution or a distribution that can be installed. #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub enum RequestedDist { Installed(InstalledDist), Installable(Dist), diff --git a/crates/uv-distribution-types/src/resolved.rs b/crates/uv-distribution-types/src/resolved.rs index c212ee6dd..cf2f35150 100644 --- a/crates/uv-distribution-types/src/resolved.rs +++ b/crates/uv-distribution-types/src/resolved.rs @@ -16,7 +16,6 @@ use crate::{ /// /// Either an already-installed distribution or a distribution that can be installed. #[derive(Debug, Clone, Hash)] -#[allow(clippy::large_enum_variant)] pub enum ResolvedDist { Installed { dist: Arc, diff --git a/crates/uv-distribution-types/src/specified_requirement.rs b/crates/uv-distribution-types/src/specified_requirement.rs index a35ec7575..b1c678195 100644 --- a/crates/uv-distribution-types/src/specified_requirement.rs +++ b/crates/uv-distribution-types/src/specified_requirement.rs @@ -78,7 +78,7 @@ impl UnresolvedRequirement { lfs: Option, marker: Option, ) -> Self { - #[allow(clippy::manual_map)] + #[expect(clippy::manual_map)] let git_reference = if let Some(rev) = rev { Some(GitReference::from_rev(rev.to_string())) } else if let Some(tag) = tag { diff --git a/crates/uv-extract/src/vendor/cloneable_seekable_reader.rs b/crates/uv-extract/src/vendor/cloneable_seekable_reader.rs index 720b3826d..0de01e515 100644 --- a/crates/uv-extract/src/vendor/cloneable_seekable_reader.rs +++ b/crates/uv-extract/src/vendor/cloneable_seekable_reader.rs @@ -16,7 +16,6 @@ use std::{ /// A trait to represent some reader which has a total length known in /// advance. This is roughly equivalent to the nightly /// [`Seek::stream_len`] API. -#[allow(clippy::len_without_is_empty)] pub trait HasLength { /// Return the current total length of this stream. fn len(&self) -> u64; @@ -117,7 +116,7 @@ impl HasLength for BufReader { } } -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] impl HasLength for std::fs::File { fn len(&self) -> u64 { self.metadata().unwrap().len() diff --git a/crates/uv-flags/src/lib.rs b/crates/uv-flags/src/lib.rs index d896dfcfe..543a0eab2 100644 --- a/crates/uv-flags/src/lib.rs +++ b/crates/uv-flags/src/lib.rs @@ -11,7 +11,7 @@ bitflags::bitflags! { } /// Initialize the environment flags. -#[allow(clippy::result_unit_err)] +#[expect(clippy::result_unit_err)] pub fn init(flags: EnvironmentFlags) -> Result<(), ()> { FLAGS.set(flags).map_err(|_| ()) } diff --git a/crates/uv-fs/src/locked_file.rs b/crates/uv-fs/src/locked_file.rs index 46a913dd2..c85c5e5d0 100644 --- a/crates/uv-fs/src/locked_file.rs +++ b/crates/uv-fs/src/locked_file.rs @@ -235,14 +235,14 @@ impl LockedFile { #[cfg(unix)] fn create(path: impl AsRef) -> Result { use rustix::io::Errno; - #[allow(clippy::disallowed_types)] + #[expect(clippy::disallowed_types)] use std::{fs::File, os::unix::fs::PermissionsExt}; use tempfile::NamedTempFile; /// The permissions the lockfile should end up with const DESIRED_MODE: u32 = 0o666; - #[allow(clippy::disallowed_types)] + #[expect(clippy::disallowed_types)] fn try_set_permissions(file: &File, path: &Path) { if let Err(err) = file.set_permissions(std::fs::Permissions::from_mode(DESIRED_MODE)) { warn!( diff --git a/crates/uv-fs/src/path.rs b/crates/uv-fs/src/path.rs index 231255f87..9253a24bb 100644 --- a/crates/uv-fs/src/path.rs +++ b/crates/uv-fs/src/path.rs @@ -6,7 +6,7 @@ use either::Either; use path_slash::PathExt; /// The current working directory. -#[allow(clippy::exit, clippy::print_stderr)] +#[expect(clippy::print_stderr)] pub static CWD: LazyLock = LazyLock::new(|| { std::env::current_dir().unwrap_or_else(|_e| { eprintln!("Current directory does not exist"); diff --git a/crates/uv-git/src/git.rs b/crates/uv-git/src/git.rs index 54ebd9231..a14dab4c1 100644 --- a/crates/uv-git/src/git.rs +++ b/crates/uv-git/src/git.rs @@ -330,7 +330,7 @@ impl GitRemote { } /// Creates a [`GitDatabase`] of this remote at `db_path`. - #[allow(clippy::unused_self)] + #[expect(clippy::unused_self)] pub(crate) fn db_at(&self, db_path: &Path) -> Result { let repo = GitRepository::open(db_path)?; Ok(GitDatabase { diff --git a/crates/uv-install-wheel/src/linker.rs b/crates/uv-install-wheel/src/linker.rs index d78a4e247..a24a7e4fc 100644 --- a/crates/uv-install-wheel/src/linker.rs +++ b/crates/uv-install-wheel/src/linker.rs @@ -19,7 +19,7 @@ use uv_warnings::{warn_user, warn_user_once}; use crate::Error; -#[allow(clippy::struct_field_names)] +#[expect(clippy::struct_field_names)] #[derive(Debug, Default)] pub struct Locks { /// The parent directory of a file in a synchronized copy diff --git a/crates/uv-keyring/src/windows.rs b/crates/uv-keyring/src/windows.rs index 30c8d918a..4d2bbbf0e 100644 --- a/crates/uv-keyring/src/windows.rs +++ b/crates/uv-keyring/src/windows.rs @@ -241,7 +241,7 @@ impl WinCredential { /// Write this credential into the underlying store as a Generic credential /// /// You must always have validated attributes before you call this! - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] async fn save_credential(&self, secret: &[u8]) -> Result<()> { let mut username = to_wstr(&self.username); let mut target_name = to_wstr(&self.target_name); @@ -328,7 +328,7 @@ impl WinCredential { .await } - #[allow(clippy::unnecessary_wraps)] + #[expect(clippy::unnecessary_wraps)] fn extract_credential(w_credential: &CREDENTIALW) -> Result { Ok(Self { username: unsafe { from_wstr(w_credential.UserName.as_ptr()) }, @@ -428,7 +428,7 @@ fn extract_password(credential: &CREDENTIALW) -> Result { result } -#[allow(clippy::unnecessary_wraps)] +#[expect(clippy::unnecessary_wraps)] fn extract_secret(credential: &CREDENTIALW) -> Result> { let blob_pointer: *const u8 = credential.CredentialBlob; let blob_len: usize = credential.CredentialBlobSize as usize; @@ -457,7 +457,7 @@ fn to_wstr_no_null(s: &str) -> Vec { s.encode_utf16().collect() } -#[allow(clippy::maybe_infinite_iter)] +#[expect(clippy::maybe_infinite_iter)] unsafe fn from_wstr(ws: *const u16) -> String { // null pointer case, return empty string if ws.is_null() { @@ -539,7 +539,7 @@ mod tests { crate::tests::entry_from_constructor(WinCredential::new_with_target, service, user) } - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] #[test] fn test_bad_password() { fn make_platform_credential(password: &mut Vec) -> CREDENTIALW { diff --git a/crates/uv-metadata/src/lib.rs b/crates/uv-metadata/src/lib.rs index bac88cf32..b68dca47a 100644 --- a/crates/uv-metadata/src/lib.rs +++ b/crates/uv-metadata/src/lib.rs @@ -140,7 +140,7 @@ pub fn read_archive_metadata( let mut file = archive.by_name(&format!("{dist_info_prefix}.dist-info/METADATA"))?; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let mut buffer = Vec::with_capacity(file.size() as usize); file.read_to_end(&mut buffer).map_err(Error::Io)?; diff --git a/crates/uv-normalize/src/extra_name.rs b/crates/uv-normalize/src/extra_name.rs index 7b9000ac6..7529030d4 100644 --- a/crates/uv-normalize/src/extra_name.rs +++ b/crates/uv-normalize/src/extra_name.rs @@ -118,7 +118,7 @@ impl ExtraName { /// Create a validated, normalized extra name. /// /// At present, this is no more efficient than calling [`ExtraName::from_str`]. - #[allow(clippy::needless_pass_by_value)] + #[expect(clippy::needless_pass_by_value)] pub fn from_owned(name: String) -> Result { validate_and_normalize_ref(&name).map(Self) } diff --git a/crates/uv-normalize/src/group_name.rs b/crates/uv-normalize/src/group_name.rs index 10bd94b55..d7d8cef97 100644 --- a/crates/uv-normalize/src/group_name.rs +++ b/crates/uv-normalize/src/group_name.rs @@ -38,7 +38,7 @@ impl GroupName { /// Create a validated, normalized group name. /// /// At present, this is no more efficient than calling [`GroupName::from_str`]. - #[allow(clippy::needless_pass_by_value)] + #[expect(clippy::needless_pass_by_value)] pub fn from_owned(name: String) -> Result { validate_and_normalize_ref(&name).map(Self) } diff --git a/crates/uv-normalize/src/package_name.rs b/crates/uv-normalize/src/package_name.rs index 4bd9fbec6..60f8bb215 100644 --- a/crates/uv-normalize/src/package_name.rs +++ b/crates/uv-normalize/src/package_name.rs @@ -35,7 +35,7 @@ impl PackageName { /// Create a validated, normalized package name. /// /// At present, this is no more efficient than calling [`PackageName::from_str`]. - #[allow(clippy::needless_pass_by_value)] + #[expect(clippy::needless_pass_by_value)] pub fn from_owned(name: String) -> Result { validate_and_normalize_ref(&name).map(Self) } diff --git a/crates/uv-pep440/src/version.rs b/crates/uv-pep440/src/version.rs index 5c27806e8..77a33e0d9 100644 --- a/crates/uv-pep440/src/version.rs +++ b/crates/uv-pep440/src/version.rs @@ -1206,13 +1206,13 @@ impl VersionSmall { } #[inline] - #[allow(clippy::unused_self)] + #[expect(clippy::unused_self)] fn epoch(&self) -> u64 { 0 } #[inline] - #[allow(clippy::unused_self)] + #[expect(clippy::unused_self)] fn set_epoch(&mut self, value: u64) -> bool { if value != 0 { return false; @@ -1940,7 +1940,7 @@ struct Parser<'a> { impl<'a> Parser<'a> { /// The "separators" that are allowed in several different parts of a /// version. - #[allow(clippy::byte_char_slices)] + #[expect(clippy::byte_char_slices)] const SEPARATOR: ByteSet = ByteSet::new(&[b'.', b'_', b'-']); /// Create a new `Parser` for parsing the version in the given byte string. diff --git a/crates/uv-pep508/src/marker/algebra.rs b/crates/uv-pep508/src/marker/algebra.rs index 4051fe88b..8a170202e 100644 --- a/crates/uv-pep508/src/marker/algebra.rs +++ b/crates/uv-pep508/src/marker/algebra.rs @@ -1161,7 +1161,6 @@ type SmallVec = smallvec::SmallVec<[T; 5]>; /// The edges of a decision node. #[derive(PartialEq, Eq, Hash, Clone, Debug)] -#[allow(clippy::large_enum_variant)] // Nodes are interned. pub(crate) enum Edges { // The edges of a version variable, representing a disjoint set of ranges that cover // the output space. diff --git a/crates/uv-pep508/src/marker/lowering.rs b/crates/uv-pep508/src/marker/lowering.rs index e52669840..34e301772 100644 --- a/crates/uv-pep508/src/marker/lowering.rs +++ b/crates/uv-pep508/src/marker/lowering.rs @@ -7,7 +7,6 @@ use crate::{MarkerValueExtra, MarkerValueString, MarkerValueVersion}; /// Those environment markers with a PEP 440 version as value such as `python_version` #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] -#[allow(clippy::enum_variant_names)] pub enum CanonicalMarkerValueVersion { /// `implementation_version` ImplementationVersion, diff --git a/crates/uv-pep508/src/marker/parse.rs b/crates/uv-pep508/src/marker/parse.rs index 8e4a39078..b9cff5d73 100644 --- a/crates/uv-pep508/src/marker/parse.rs +++ b/crates/uv-pep508/src/marker/parse.rs @@ -607,7 +607,7 @@ fn parse_marker_or( } /// Parses both `marker_and` and `marker_or` -#[allow(clippy::type_complexity)] +#[expect(clippy::type_complexity)] fn parse_marker_op( cursor: &mut Cursor, op: &str, diff --git a/crates/uv-pep508/src/marker/tree.rs b/crates/uv-pep508/src/marker/tree.rs index 10dd843f7..37cd72f64 100644 --- a/crates/uv-pep508/src/marker/tree.rs +++ b/crates/uv-pep508/src/marker/tree.rs @@ -51,7 +51,6 @@ pub enum MarkerWarningKind { /// Those environment markers with a PEP 440 version as value such as `python_version` #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] -#[allow(clippy::enum_variant_names)] pub enum MarkerValueVersion { /// `implementation_version` ImplementationVersion, @@ -655,7 +654,7 @@ impl MarkerExpression { /// /// Returns `None` if the expression consists entirely of meaningless expressions /// that are ignored, such as `os_name ~= 'foo'`. - #[allow(clippy::should_implement_trait)] + #[expect(clippy::should_implement_trait)] pub fn from_str(s: &str) -> Result, Pep508Error> { Self::parse_reporter(s, &mut TracingReporter) } diff --git a/crates/uv-platform-tags/src/abi_tag.rs b/crates/uv-platform-tags/src/abi_tag.rs index ddc618f9d..816cac75b 100644 --- a/crates/uv-platform-tags/src/abi_tag.rs +++ b/crates/uv-platform-tags/src/abi_tag.rs @@ -133,7 +133,6 @@ impl FromStr for AbiTag { type Err = ParseAbiTagError; /// Parse an [`AbiTag`] from a string. - #[allow(clippy::cast_possible_truncation)] fn from_str(s: &str) -> Result { /// Parse a Python version from a string (e.g., convert `39` into `(3, 9)`). fn parse_python_version( diff --git a/crates/uv-platform-tags/src/language_tag.rs b/crates/uv-platform-tags/src/language_tag.rs index 54b9442fd..5c88b77bb 100644 --- a/crates/uv-platform-tags/src/language_tag.rs +++ b/crates/uv-platform-tags/src/language_tag.rs @@ -102,7 +102,7 @@ impl FromStr for LanguageTag { type Err = ParseLanguageTagError; /// Parse a [`LanguageTag`] from a string. - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] fn from_str(s: &str) -> Result { /// Parse a Python version from a string (e.g., convert `39` into `(3, 9)`). fn parse_python_version( diff --git a/crates/uv-platform-tags/src/tags.rs b/crates/uv-platform-tags/src/tags.rs index 8449692bc..005bc0eac 100644 --- a/crates/uv-platform-tags/src/tags.rs +++ b/crates/uv-platform-tags/src/tags.rs @@ -77,7 +77,7 @@ impl TagCompatibility { #[derive(Debug, Clone)] pub struct Tags { /// `python_tag` |--> `abi_tag` |--> `platform_tag` |--> priority - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] map: Arc>>>, /// The highest-priority tag for the Python version and platform. best: Option<(LanguageTag, AbiTag, PlatformTag)>, diff --git a/crates/uv-platform/src/cpuinfo.rs b/crates/uv-platform/src/cpuinfo.rs index 89a4f89e9..a18c0d809 100644 --- a/crates/uv-platform/src/cpuinfo.rs +++ b/crates/uv-platform/src/cpuinfo.rs @@ -27,7 +27,7 @@ pub(crate) fn detect_hardware_floating_point_support() -> Result { /// For non-Linux systems or architectures, the function will return `false` as hardware floating-point detection /// is not applicable outside of Linux ARM architectures. #[cfg(not(target_os = "linux"))] -#[allow(clippy::unnecessary_wraps)] +#[expect(clippy::unnecessary_wraps)] pub(crate) fn detect_hardware_floating_point_support() -> Result { Ok(false) // Non-Linux or non-ARM systems: hardware floating-point detection is not applicable } diff --git a/crates/uv-platform/src/lib.rs b/crates/uv-platform/src/lib.rs index d0e6fdd4b..e3055ea8e 100644 --- a/crates/uv-platform/src/lib.rs +++ b/crates/uv-platform/src/lib.rs @@ -92,7 +92,7 @@ impl Platform { return true; } - #[allow(clippy::unnested_or_patterns)] + #[expect(clippy::unnested_or_patterns)] if self.os.is_windows() && matches!( (self.arch.family(), other.arch.family()), diff --git a/crates/uv-publish/src/lib.rs b/crates/uv-publish/src/lib.rs index 6ee6c2d04..1f1886eb8 100644 --- a/crates/uv-publish/src/lib.rs +++ b/crates/uv-publish/src/lib.rs @@ -330,7 +330,7 @@ fn group_files(files: Vec, no_attestations: bool) -> Vec(vec: &mut [T]) { let n: usize = vec.len(); for i in 0..(n - 1) { - #[allow(clippy::cast_possible_truncation)] let j = (fastrand::usize(..)) % (n - i) + i; vec.swap(i, j); } diff --git a/crates/uv-publish/src/trusted_publishing.rs b/crates/uv-publish/src/trusted_publishing.rs index b93271125..c5741c45e 100644 --- a/crates/uv-publish/src/trusted_publishing.rs +++ b/crates/uv-publish/src/trusted_publishing.rs @@ -121,7 +121,7 @@ pub(crate) async fn get_token( let publish_token = service.publish_token(oidc_token).await?; // If we're on GitHub Actions, mask the exchanged token in logs. - #[allow(clippy::print_stdout)] + #[expect(clippy::print_stdout)] if env::var(EnvVars::GITHUB_ACTIONS) == Ok("true".to_string()) { println!("::add-mask::{publish_token}"); } diff --git a/crates/uv-pypi-types/src/metadata/pyproject_toml.rs b/crates/uv-pypi-types/src/metadata/pyproject_toml.rs index d8b877e5f..0d3b0ec77 100644 --- a/crates/uv-pypi-types/src/metadata/pyproject_toml.rs +++ b/crates/uv-pypi-types/src/metadata/pyproject_toml.rs @@ -86,5 +86,5 @@ pub(super) struct Tool { #[derive(Deserialize, Debug, Clone)] #[serde(rename_all = "kebab-case")] -#[allow(clippy::empty_structs_with_brackets)] +#[expect(clippy::empty_structs_with_brackets)] pub(super) struct ToolPoetry {} diff --git a/crates/uv-python/build.rs b/crates/uv-python/build.rs index c3efba02b..5604e63c7 100644 --- a/crates/uv-python/build.rs +++ b/crates/uv-python/build.rs @@ -1,4 +1,4 @@ -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] use std::fs::{File, FileTimes}; use std::io::Write; use std::path::PathBuf; @@ -40,18 +40,17 @@ fn main() { ); let json_data: serde_json::Value = serde_json::from_str( - #[allow(clippy::disallowed_methods)] + #[expect(clippy::disallowed_methods)] &fs::read_to_string(&version_metadata).expect("Failed to read download-metadata.json"), ) .expect("Failed to parse JSON"); let filtered_data = process_json(&json_data); - #[allow(clippy::disallowed_types)] + #[expect(clippy::disallowed_types)] let mut out_file = File::create(version_metadata_minified) .expect("failed to open download-metadata-minified.json"); - #[allow(clippy::disallowed_methods)] out_file .write_all( serde_json::to_string(&filtered_data) @@ -63,7 +62,7 @@ fn main() { // Cargo uses the modified times of the paths specified in // `rerun-if-changed`, so fetch the current file times and set them the same // on the output file. - #[allow(clippy::disallowed_methods)] + #[expect(clippy::disallowed_methods)] let meta = fs::metadata(version_metadata).expect("failed to read metadata for download-metadata.json"); diff --git a/crates/uv-python/src/downloads.rs b/crates/uv-python/src/downloads.rs index a7230fa5e..4e2b867fd 100644 --- a/crates/uv-python/src/downloads.rs +++ b/crates/uv-python/src/downloads.rs @@ -1023,7 +1023,7 @@ impl ManagedPythonDownloadList { // this by parsing into a Map which allows any valid JSON on the // value side. (Because it's zero-sized, Clippy suggests Set, but that won't // have the same parsing effect.) - #[allow(clippy::zero_sized_map_values)] + #[expect(clippy::zero_sized_map_values)] |e| { let source = match json_source { Source::BuiltIn => "EMBEDDED IN THE BINARY".to_owned(), diff --git a/crates/uv-python/src/interpreter.rs b/crates/uv-python/src/interpreter.rs index bb65e9bf2..a1f0814f1 100644 --- a/crates/uv-python/src/interpreter.rs +++ b/crates/uv-python/src/interpreter.rs @@ -40,7 +40,7 @@ use crate::{ use windows::Win32::Foundation::{APPMODEL_ERROR_NO_PACKAGE, ERROR_CANT_ACCESS_FILE, WIN32_ERROR}; /// A Python executable and its associated platform markers. -#[allow(clippy::struct_excessive_bools)] +#[expect(clippy::struct_excessive_bools)] #[derive(Debug, Clone)] pub struct Interpreter { platform: Platform, @@ -920,7 +920,7 @@ pub enum InterpreterInfoError { EmscriptenNotPyodide, } -#[allow(clippy::struct_excessive_bools)] +#[expect(clippy::struct_excessive_bools)] #[derive(Debug, Deserialize, Serialize, Clone)] struct InterpreterInfo { platform: Platform, diff --git a/crates/uv-python/src/managed.rs b/crates/uv-python/src/managed.rs index d1fea9d30..670f8366a 100644 --- a/crates/uv-python/src/managed.rs +++ b/crates/uv-python/src/managed.rs @@ -937,7 +937,7 @@ pub fn create_link_to_executable(link: &Path, executable: &Path) -> Result<(), E // OK to use `std::fs` here, `fs_err` does not support `File::create_new` and we attach // error context anyway - #[allow(clippy::disallowed_types)] + #[expect(clippy::disallowed_types)] { std::fs::File::create_new(link) .and_then(|mut file| file.write_all(launcher.as_ref())) diff --git a/crates/uv-redacted/src/lib.rs b/crates/uv-redacted/src/lib.rs index 7819d030c..9f5905a01 100644 --- a/crates/uv-redacted/src/lib.rs +++ b/crates/uv-redacted/src/lib.rs @@ -181,7 +181,7 @@ impl DisplaySafeUrl { Ok(Self(Url::deserialize_internal(deserializer)?)) } - #[allow(clippy::result_unit_err)] + #[expect(clippy::result_unit_err)] pub fn from_file_path>(path: P) -> Result { Ok(Self(Url::from_file_path(path)?)) } diff --git a/crates/uv-requirements-txt/src/lib.rs b/crates/uv-requirements-txt/src/lib.rs index 598ccb3f6..f4d2a61c7 100644 --- a/crates/uv-requirements-txt/src/lib.rs +++ b/crates/uv-requirements-txt/src/lib.rs @@ -982,7 +982,7 @@ fn parse_requirement_and_hashes( // // While `requirements.txt` is a valid package name (per the spec), PyPI disallows // `requirements.txt` and some other variants anyway. - #[allow(clippy::case_sensitive_file_extension_comparisons)] + #[expect(clippy::case_sensitive_file_extension_comparisons)] if requirement.ends_with(".txt") || requirement.ends_with(".in") { let path = Path::new(requirement); let path = if path.is_absolute() { diff --git a/crates/uv-requirements/src/sources.rs b/crates/uv-requirements/src/sources.rs index d3b898f9a..7f6394ca5 100644 --- a/crates/uv-requirements/src/sources.rs +++ b/crates/uv-requirements/src/sources.rs @@ -192,7 +192,7 @@ impl RequirementsSource { pub fn from_package_argument(name: &str) -> Result { // If the user provided a `requirements.txt` file without `-r` (as in // `uv pip install requirements.txt`), prompt them to correct it. - #[allow(clippy::case_sensitive_file_extension_comparisons)] + #[expect(clippy::case_sensitive_file_extension_comparisons)] if (name.ends_with(".txt") || name.ends_with(".in")) && Path::new(&name).is_file() { let term = Term::stderr(); if term.is_term() { @@ -242,7 +242,7 @@ impl RequirementsSource { pub fn from_with_package_argument(name: &str) -> Result { // If the user provided a `requirements.txt` file without `--with-requirements` (as in // `uvx --with requirements.txt ruff`), prompt them to correct it. - #[allow(clippy::case_sensitive_file_extension_comparisons)] + #[expect(clippy::case_sensitive_file_extension_comparisons)] if (name.ends_with(".txt") || name.ends_with(".in")) && Path::new(&name).is_file() { let term = Term::stderr(); if term.is_term() { @@ -334,7 +334,7 @@ impl std::fmt::Display for RequirementsSource { } /// Returns `true` if a file name matches the `pylock.toml` pattern defined in PEP 751. -#[allow(clippy::case_sensitive_file_extension_comparisons)] +#[expect(clippy::case_sensitive_file_extension_comparisons)] pub fn is_pylock_toml(file_name: &str) -> bool { file_name.starts_with("pylock.") && file_name.ends_with(".toml") } diff --git a/crates/uv-resolver/src/candidate_selector.rs b/crates/uv-resolver/src/candidate_selector.rs index 6f92a3f6b..385533c02 100644 --- a/crates/uv-resolver/src/candidate_selector.rs +++ b/crates/uv-resolver/src/candidate_selector.rs @@ -21,7 +21,7 @@ use crate::version_map::{VersionMap, VersionMapDistHandle}; use crate::{Exclusions, Manifest, Options, ResolverEnvironment}; #[derive(Debug, Clone)] -#[allow(clippy::struct_field_names)] +#[expect(clippy::struct_field_names)] pub(crate) struct CandidateSelector { resolution_strategy: ResolutionStrategy, prerelease_strategy: PrereleaseStrategy, diff --git a/crates/uv-resolver/src/error.rs b/crates/uv-resolver/src/error.rs index 1a68a0555..039df5c2a 100644 --- a/crates/uv-resolver/src/error.rs +++ b/crates/uv-resolver/src/error.rs @@ -513,7 +513,7 @@ impl std::fmt::Display for NoSolutionError { } } -#[allow(clippy::print_stderr)] +#[expect(clippy::print_stderr)] fn display_tree( error: &DerivationTree, UnavailableReason>, name: &str, diff --git a/crates/uv-resolver/src/lock/export/pylock_toml.rs b/crates/uv-resolver/src/lock/export/pylock_toml.rs index c84db55a5..a6b669b17 100644 --- a/crates/uv-resolver/src/lock/export/pylock_toml.rs +++ b/crates/uv-resolver/src/lock/export/pylock_toml.rs @@ -231,7 +231,7 @@ pub struct PylockTomlPackage { #[derive(Debug, serde::Serialize, serde::Deserialize)] #[serde(rename_all = "kebab-case")] -#[allow(clippy::empty_structs_with_brackets)] +#[expect(clippy::empty_structs_with_brackets)] struct PylockTomlDependency {} #[derive(Debug, serde::Serialize, serde::Deserialize)] @@ -1691,7 +1691,7 @@ impl PylockTomlArchive { } /// Convert a Jiff timestamp to a TOML datetime. -#[allow(clippy::ref_option)] +#[expect(clippy::ref_option)] fn timestamp_to_toml_datetime( timestamp: &Option, serializer: S, diff --git a/crates/uv-resolver/src/lock/mod.rs b/crates/uv-resolver/src/lock/mod.rs index 82f60cac0..78ea1d02c 100644 --- a/crates/uv-resolver/src/lock/mod.rs +++ b/crates/uv-resolver/src/lock/mod.rs @@ -1563,7 +1563,6 @@ impl Lock { } /// Return a [`SatisfiesResult`] if the given requirements do not match the [`Package`] metadata. - #[allow(clippy::unused_self)] fn satisfies_requires_dist<'lock>( &self, requires_dist: Box<[Requirement]>, @@ -2339,7 +2338,7 @@ struct ResolverOptions { exclude_newer: ExcludeNewerWire, } -#[allow(clippy::struct_field_names)] +#[expect(clippy::struct_field_names)] #[derive(Clone, Debug, Default, serde::Deserialize, PartialEq, Eq)] #[serde(rename_all = "kebab-case")] struct ExcludeNewerWire { @@ -5551,7 +5550,7 @@ where } #[derive(Debug, Clone, PartialEq, Eq)] -#[allow(clippy::enum_variant_names)] +#[expect(clippy::enum_variant_names)] enum WheelTagHint { /// None of the available wheels for a package have a compatible Python language tag (e.g., /// `cp310` in `cp310-abi3-manylinux_2_17_x86_64.whl`). diff --git a/crates/uv-resolver/src/resolution/display.rs b/crates/uv-resolver/src/resolution/display.rs index e5b5dfef5..2be6e756e 100644 --- a/crates/uv-resolver/src/resolution/display.rs +++ b/crates/uv-resolver/src/resolution/display.rs @@ -50,7 +50,7 @@ impl<'a> DisplayResolutionGraph<'a> { /// output contain non-empty conflicting groups. That is, when using `uv /// pip compile`, specifying conflicts is not supported because their /// conditional logic cannot be encoded into a `requirements.txt`. - #[allow(clippy::fn_params_excessive_bools)] + #[expect(clippy::fn_params_excessive_bools)] pub fn new( underlying: &'a ResolverOutput, env: &'a ResolverEnvironment, diff --git a/crates/uv-resolver/src/resolution/output.rs b/crates/uv-resolver/src/resolution/output.rs index edea7911e..f389a790b 100644 --- a/crates/uv-resolver/src/resolution/output.rs +++ b/crates/uv-resolver/src/resolution/output.rs @@ -59,7 +59,7 @@ pub struct ResolverOutput { } #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(crate) enum ResolutionGraphNode { Root, Dist(AnnotatedDist), diff --git a/crates/uv-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs index bb75f5b00..495bc80c5 100644 --- a/crates/uv-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -913,7 +913,7 @@ impl ResolverState), @@ -3583,7 +3583,7 @@ impl Display for Request { } #[derive(Debug)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] enum Response { /// The returned metadata for a package hosted on a registry. Package(PackageName, Option, VersionsResponse), diff --git a/crates/uv-resolver/src/version_map.rs b/crates/uv-resolver/src/version_map.rs index a35e47220..b0f334336 100644 --- a/crates/uv-resolver/src/version_map.rs +++ b/crates/uv-resolver/src/version_map.rs @@ -333,7 +333,7 @@ impl<'a> VersionMapDistHandle<'a> { /// The kind of internal version map we have. #[derive(Debug)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] enum VersionMapInner { /// All distributions are fully materialized in memory. /// diff --git a/crates/uv-shell/src/lib.rs b/crates/uv-shell/src/lib.rs index aa2a2febd..b5b298847 100644 --- a/crates/uv-shell/src/lib.rs +++ b/crates/uv-shell/src/lib.rs @@ -15,7 +15,7 @@ use tracing::debug; /// Shells for which virtualenv activation scripts are available. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] -#[allow(clippy::doc_markdown)] +#[expect(clippy::doc_markdown)] pub enum Shell { /// Bourne Again SHell (bash) Bash, diff --git a/crates/uv-tool/src/lib.rs b/crates/uv-tool/src/lib.rs index 0b044f6cc..8c6f0a6a8 100644 --- a/crates/uv-tool/src/lib.rs +++ b/crates/uv-tool/src/lib.rs @@ -153,7 +153,7 @@ impl InstalledTools { /// included with an error. /// /// Note it is generally incorrect to use this without [`Self::acquire_lock`]. - #[allow(clippy::type_complexity)] + #[expect(clippy::type_complexity)] pub fn tools(&self) -> Result)>, Error> { let mut tools = Vec::new(); for directory in uv_fs::directories(self.root())? { diff --git a/crates/uv-trampoline-builder/src/lib.rs b/crates/uv-trampoline-builder/src/lib.rs index 23067f34b..489eb2c03 100644 --- a/crates/uv-trampoline-builder/src/lib.rs +++ b/crates/uv-trampoline-builder/src/lib.rs @@ -479,7 +479,7 @@ pub fn windows_python_launcher( } #[cfg(all(test, windows))] -#[allow(clippy::print_stdout)] +#[expect(clippy::print_stdout)] mod test { use std::io::Write; use std::path::Path; diff --git a/crates/uv-trampoline/src/bounce.rs b/crates/uv-trampoline/src/bounce.rs index 23ee6b8f0..b49cd3500 100644 --- a/crates/uv-trampoline/src/bounce.rs +++ b/crates/uv-trampoline/src/bounce.rs @@ -340,7 +340,6 @@ fn spawn_child(si: &STARTUPINFOA, child_cmdline: CString) -> HANDLE { // processes, by using the .lpReserved2 field. We want to close those file descriptors too. // The UCRT source code has details on the memory layout (see also initialize_inherited_file_handles_nolock): // https://github.com/huangqinjin/ucrt/blob/10.0.19041.0/lowio/ioinit.cpp#L190-L223 -#[allow(clippy::ptr_eq)] fn close_handles(si: &STARTUPINFOA) { // See distlib/PC/launcher.c::cleanup_standard_io() // Unlike cleanup_standard_io(), we don't close STD_ERROR_HANDLE to retain warn! diff --git a/crates/uv-unix/src/resource_limits.rs b/crates/uv-unix/src/resource_limits.rs index b28729964..1ea8a0421 100644 --- a/crates/uv-unix/src/resource_limits.rs +++ b/crates/uv-unix/src/resource_limits.rs @@ -76,7 +76,7 @@ pub fn adjust_open_file_limit() -> Result { // Cap the target limit to avoid issues with extremely high values. // If hard is negative or exceeds MAX_NOFILE_LIMIT, use MAX_NOFILE_LIMIT. - #[allow(clippy::unnecessary_cast)] + #[expect(clippy::unnecessary_cast)] let target = rlim_t_to_u64(hard.min(MAX_NOFILE_LIMIT)).unwrap_or(MAX_NOFILE_LIMIT as u64); if soft >= target { @@ -105,7 +105,7 @@ pub fn adjust_open_file_limit() -> Result { /// /// On Linux/macOS, `rlim_t` is `u64` so this always succeeds. /// On FreeBSD, `rlim_t` is `i64` so negative values return `None`. -#[allow(clippy::unnecessary_cast, clippy::useless_conversion)] +#[expect(clippy::useless_conversion)] fn rlim_t_to_u64(value: rlim_t) -> Option { u64::try_from(value).ok() } diff --git a/crates/uv-virtualenv/src/lib.rs b/crates/uv-virtualenv/src/lib.rs index f15977f92..a8fdba792 100644 --- a/crates/uv-virtualenv/src/lib.rs +++ b/crates/uv-virtualenv/src/lib.rs @@ -46,7 +46,7 @@ impl Prompt { } /// Create a virtualenv. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub fn create_venv( location: &Path, interpreter: Interpreter, diff --git a/crates/uv-virtualenv/src/virtualenv.rs b/crates/uv-virtualenv/src/virtualenv.rs index 3f4dca4d4..c5f457f8f 100644 --- a/crates/uv-virtualenv/src/virtualenv.rs +++ b/crates/uv-virtualenv/src/virtualenv.rs @@ -48,7 +48,7 @@ fn write_cfg(f: &mut impl Write, data: &[(String, String)]) -> io::Result<()> { } /// Create a [`VirtualEnvironment`] at the given location. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) fn create( location: &Path, interpreter: &Interpreter, diff --git a/crates/uv-workspace/src/pyproject.rs b/crates/uv-workspace/src/pyproject.rs index e12559a9c..9caf24ec0 100644 --- a/crates/uv-workspace/src/pyproject.rs +++ b/crates/uv-workspace/src/pyproject.rs @@ -1009,7 +1009,6 @@ impl IntoIterator for Sources { #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema), schemars(untagged))] -#[allow(clippy::large_enum_variant)] enum SourcesWire { One(Source), Many(Vec), diff --git a/crates/uv/src/bin/uvw.rs b/crates/uv/src/bin/uvw.rs index 3b4ea2288..0bb2f2a42 100644 --- a/crates/uv/src/bin/uvw.rs +++ b/crates/uv/src/bin/uvw.rs @@ -21,7 +21,7 @@ fn exec_spawn(cmd: &mut Command) -> std::io::Result { cmd.stdin(std::process::Stdio::inherit()); let status = cmd.creation_flags(CREATE_NO_WINDOW).status()?; - #[allow(clippy::exit)] + #[expect(clippy::exit)] std::process::exit(status.code().unwrap()) } } @@ -40,7 +40,7 @@ fn get_uv_path(current_exe_parent: &Path, uvw_suffix: Option<&str>) -> std::io:: // First try to find a matching suffixed `uv`, e.g. `uv@1.2.3(.exe)` let uv_with_suffix = uvw_suffix.map(|suffix| current_exe_parent.join(format!("uv{suffix}"))); if let Some(uv_with_suffix) = &uv_with_suffix { - #[allow(clippy::print_stderr, reason = "printing a very rare warning")] + #[expect(clippy::print_stderr, reason = "printing a very rare warning")] match uv_with_suffix.try_exists() { Ok(true) => return Ok(uv_with_suffix.to_owned()), Ok(false) => { /* definitely not there, proceed to fallback */ } @@ -97,7 +97,7 @@ fn run() -> std::io::Result { match exec_spawn(&mut cmd)? {} } -#[allow(clippy::print_stderr)] +#[expect(clippy::print_stderr)] fn main() -> ExitCode { let result = run(); match result { diff --git a/crates/uv/src/bin/uvx.rs b/crates/uv/src/bin/uvx.rs index 5673d2706..6bb819e88 100644 --- a/crates/uv/src/bin/uvx.rs +++ b/crates/uv/src/bin/uvx.rs @@ -18,7 +18,7 @@ fn exec_spawn(cmd: &mut Command) -> std::io::Result { cmd.stdin(std::process::Stdio::inherit()); let status = cmd.status()?; - #[allow(clippy::exit)] + #[expect(clippy::exit)] std::process::exit(status.code().unwrap()) } } @@ -37,7 +37,7 @@ fn get_uv_path(current_exe_parent: &Path, uvx_suffix: Option<&str>) -> std::io:: // First try to find a matching suffixed `uv`, e.g. `uv@1.2.3(.exe)` let uv_with_suffix = uvx_suffix.map(|suffix| current_exe_parent.join(format!("uv{suffix}"))); if let Some(uv_with_suffix) = &uv_with_suffix { - #[allow(clippy::print_stderr, reason = "printing a very rare warning")] + #[expect(clippy::print_stderr, reason = "printing a very rare warning")] match uv_with_suffix.try_exists() { Ok(true) => return Ok(uv_with_suffix.to_owned()), Ok(false) => { /* definitely not there, proceed to fallback */ } @@ -96,7 +96,7 @@ fn run() -> std::io::Result { match exec_spawn(&mut cmd)? {} } -#[allow(clippy::print_stderr)] +#[expect(clippy::print_stderr)] fn main() -> ExitCode { let result = run(); match result { diff --git a/crates/uv/src/child.rs b/crates/uv/src/child.rs index 5df6a1b0c..e8546cb69 100644 --- a/crates/uv/src/child.rs +++ b/crates/uv/src/child.rs @@ -286,7 +286,7 @@ pub(crate) async fn run_to_completion(mut handle: Child) -> anyhow::Result, @@ -170,7 +170,7 @@ enum BuildResult { // https://github.com/rust-lang/rust/issues/147648 #[allow(unused_assignments)] -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] async fn build_impl( project_dir: &Path, src: Option<&Path>, @@ -442,7 +442,7 @@ async fn build_impl( } } -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] async fn build_package( source: AnnotatedSource<'_>, output_dir: Option<&Path>, diff --git a/crates/uv/src/commands/mod.rs b/crates/uv/src/commands/mod.rs index b2a755bc0..76c92b675 100644 --- a/crates/uv/src/commands/mod.rs +++ b/crates/uv/src/commands/mod.rs @@ -202,14 +202,12 @@ pub(super) async fn compile_bytecode( } /// A multicasting writer that writes to both the standard output and an output file, if present. -#[allow(clippy::disallowed_types)] struct OutputWriter<'a> { stdout: Option>, output_file: Option<&'a Path>, buffer: Vec, } -#[allow(clippy::disallowed_types)] impl<'a> OutputWriter<'a> { /// Create a new output writer. fn new(include_stdout: bool, output_file: Option<&'a Path>) -> Self { @@ -301,7 +299,7 @@ pub(super) fn capitalize(s: &str) -> String { /// A Python file that may or may not include an existing PEP 723 script tag. #[derive(Debug)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(crate) enum ScriptPath { /// The Python file already includes a PEP 723 script tag. Script(Pep723Script), diff --git a/crates/uv/src/commands/pip/compile.rs b/crates/uv/src/commands/pip/compile.rs index 6a45b2b2a..5c7900c10 100644 --- a/crates/uv/src/commands/pip/compile.rs +++ b/crates/uv/src/commands/pip/compile.rs @@ -60,7 +60,7 @@ use crate::commands::{ExitStatus, OutputWriter, diagnostics}; use crate::printer::Printer; /// Resolve a set of requirements into a set of pinned versions. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn pip_compile( requirements: &[RequirementsSource], constraints: &[RequirementsSource], @@ -794,7 +794,6 @@ pub(crate) async fn pip_compile( } /// Format the uv command used to generate the output file. -#[allow(clippy::fn_params_excessive_bools)] fn cmd( include_index_url: bool, include_find_links: bool, diff --git a/crates/uv/src/commands/pip/install.rs b/crates/uv/src/commands/pip/install.rs index a62d67dc3..297e72fe9 100644 --- a/crates/uv/src/commands/pip/install.rs +++ b/crates/uv/src/commands/pip/install.rs @@ -50,7 +50,7 @@ use crate::commands::{ExitStatus, diagnostics}; use crate::printer::Printer; /// Install packages into the current environment. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn pip_install( requirements: &[RequirementsSource], constraints: &[RequirementsSource], diff --git a/crates/uv/src/commands/pip/list.rs b/crates/uv/src/commands/pip/list.rs index 8d53ef383..2dfe6db1f 100644 --- a/crates/uv/src/commands/pip/list.rs +++ b/crates/uv/src/commands/pip/list.rs @@ -36,7 +36,6 @@ use crate::commands::reporters::LatestVersionReporter; use crate::printer::Printer; /// Enumerate the installed packages in the current environment. -#[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn pip_list( editable: Option, exclude: &FxHashSet, diff --git a/crates/uv/src/commands/pip/operations.rs b/crates/uv/src/commands/pip/operations.rs index fcd4ac4e5..d9404504a 100644 --- a/crates/uv/src/commands/pip/operations.rs +++ b/crates/uv/src/commands/pip/operations.rs @@ -385,7 +385,7 @@ pub(crate) enum Modifications { /// A distribution which was or would be modified #[derive(Debug, Clone, PartialEq, Eq, Hash)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(crate) enum ChangedDist { Local(LocalDist), Remote(Arc), @@ -483,7 +483,7 @@ impl Changelog { { // SAFETY: This is allowed because `LocalDist` implements `Hash` and `Eq` based solely on // the inner `kind`, and omits the types that rely on internal mutability. - #[allow(clippy::mutable_key_type)] + #[expect(clippy::mutable_key_type)] let mut uninstalled: HashSet<_> = uninstalled.into_iter().collect(); let (reinstalled, installed): (HashSet<_>, HashSet<_>) = installed .into_iter() @@ -832,7 +832,7 @@ async fn execute_plan( } /// Display a message about the interpreter that was selected for the operation. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn report_interpreter( python: &PythonInstallation, dimmed: bool, @@ -894,7 +894,7 @@ pub(crate) fn report_interpreter( } /// Display a message about the target environment for the operation. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn report_target_environment( env: &PythonEnvironment, cache: &Cache, @@ -937,7 +937,7 @@ pub(crate) fn report_target_environment( } /// Report on the results of a dry-run installation. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] fn report_dry_run( dry_run: DryRun, resolution: &Resolution, @@ -1010,7 +1010,7 @@ fn report_dry_run( } /// Report any diagnostics on resolved distributions. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn diagnose_resolution( diagnostics: &[ResolutionDiagnostic], printer: Printer, @@ -1028,7 +1028,7 @@ pub(crate) fn diagnose_resolution( } /// Report any diagnostics on installed distributions in the Python environment. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn diagnose_environment( resolution: &Resolution, venv: &PythonEnvironment, diff --git a/crates/uv/src/commands/pip/show.rs b/crates/uv/src/commands/pip/show.rs index 15a4b30ee..00b8550be 100644 --- a/crates/uv/src/commands/pip/show.rs +++ b/crates/uv/src/commands/pip/show.rs @@ -36,7 +36,6 @@ pub(crate) fn pip_show( preview: Preview, ) -> Result { if packages.is_empty() { - #[allow(clippy::print_stderr)] { writeln!( printer.stderr(), diff --git a/crates/uv/src/commands/pip/sync.rs b/crates/uv/src/commands/pip/sync.rs index 8d8d69bc1..64d7d75db 100644 --- a/crates/uv/src/commands/pip/sync.rs +++ b/crates/uv/src/commands/pip/sync.rs @@ -49,7 +49,7 @@ use crate::commands::{ExitStatus, diagnostics}; use crate::printer::Printer; /// Install a set of locked requirements into the current Python environment. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn pip_sync( requirements: &[RequirementsSource], constraints: &[RequirementsSource], diff --git a/crates/uv/src/commands/pip/tree.rs b/crates/uv/src/commands/pip/tree.rs index b87615f08..e1721c749 100644 --- a/crates/uv/src/commands/pip/tree.rs +++ b/crates/uv/src/commands/pip/tree.rs @@ -32,7 +32,7 @@ use crate::commands::reporters::LatestVersionReporter; use crate::printer::Printer; /// Display the installed packages in the current environment as a dependency tree. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn pip_tree( show_version_specifiers: bool, depth: u8, diff --git a/crates/uv/src/commands/pip/uninstall.rs b/crates/uv/src/commands/pip/uninstall.rs index f76d36a32..354083081 100644 --- a/crates/uv/src/commands/pip/uninstall.rs +++ b/crates/uv/src/commands/pip/uninstall.rs @@ -24,7 +24,6 @@ use crate::commands::{ExitStatus, elapsed}; use crate::printer::Printer; /// Uninstall packages from the current environment. -#[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn pip_uninstall( sources: &[RequirementsSource], python: Option, diff --git a/crates/uv/src/commands/project/add.rs b/crates/uv/src/commands/project/add.rs index 7fc97b59e..fcb100a32 100644 --- a/crates/uv/src/commands/project/add.rs +++ b/crates/uv/src/commands/project/add.rs @@ -59,7 +59,7 @@ use crate::printer::Printer; use crate::settings::{FrozenSource, LockCheck, ResolverInstallerSettings}; /// Add one or more packages to the project requirements. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn add( project_dir: &Path, lock_check: LockCheck, @@ -729,7 +729,7 @@ pub(crate) async fn add( let _ = snapshot.revert(); } - #[allow(clippy::exit, clippy::cast_possible_wrap)] + #[expect(clippy::exit, clippy::cast_possible_wrap)] std::process::exit(if cfg!(windows) { 0xC000_013A_u32 as i32 } else { @@ -983,7 +983,7 @@ fn edits( } /// Re-lock and re-sync the project after a series of edits. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] async fn lock_and_sync( mut target: AddTarget, toml: &mut PyProjectTomlMut, @@ -1269,7 +1269,7 @@ fn resolve_requirement( /// A Python [`Interpreter`] or [`PythonEnvironment`] for a project. #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(super) enum PythonTarget { Interpreter(Interpreter), Environment(PythonEnvironment), @@ -1287,7 +1287,7 @@ impl PythonTarget { /// Represents the destination where dependencies are added, either to a project or a script. #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(super) enum AddTarget { /// A PEP 723 script, with inline metadata. Script(Pep723Script, Box), @@ -1351,7 +1351,7 @@ impl AddTarget { } /// Update the target in-memory to incorporate the new content. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] fn update(self, content: &str) -> Result { match self { Self::Script(mut script, interpreter) => { @@ -1388,7 +1388,7 @@ impl AddTarget { } #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] enum AddTargetSnapshot { Script(Pep723Script, Option>), Project(VirtualProject, Option>), diff --git a/crates/uv/src/commands/project/environment.rs b/crates/uv/src/commands/project/environment.rs index e8ecc6bc6..5b47768f9 100644 --- a/crates/uv/src/commands/project/environment.rs +++ b/crates/uv/src/commands/project/environment.rs @@ -37,7 +37,7 @@ impl From for PythonEnvironment { impl EphemeralEnvironment { /// Set the ephemeral overlay for a Python environment. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] pub(crate) fn set_overlay(&self, contents: impl AsRef<[u8]>) -> Result<(), ProjectError> { let site_packages = self .0 @@ -50,7 +50,7 @@ impl EphemeralEnvironment { } /// Enable system site packages for a Python environment. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] pub(crate) fn set_system_site_packages(&self) -> Result<(), ProjectError> { self.0 .set_pyvenv_cfg("include-system-site-packages", "true")?; @@ -69,7 +69,7 @@ impl EphemeralEnvironment { /// `extends-environment` key of the ephemeral environment's `pyvenv.cfg` file, making it /// easier for these tools to statically and reliably understand the relationship between /// the two environments. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] pub(crate) fn set_parent_environment( &self, parent_environment_sys_prefix: &Path, diff --git a/crates/uv/src/commands/project/export.rs b/crates/uv/src/commands/project/export.rs index 542ed9e85..81f39a93a 100644 --- a/crates/uv/src/commands/project/export.rs +++ b/crates/uv/src/commands/project/export.rs @@ -35,7 +35,7 @@ use crate::printer::Printer; use crate::settings::{FrozenSource, LockCheck, ResolverSettings}; #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] enum ExportTarget { /// A PEP 723 script, with inline metadata. Script(Pep723Script), @@ -54,7 +54,7 @@ impl<'lock> From<&'lock ExportTarget> for LockTarget<'lock> { } /// Export the project's `uv.lock` in an alternate format. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn export( project_dir: &Path, format: Option, diff --git a/crates/uv/src/commands/project/init.rs b/crates/uv/src/commands/project/init.rs index 67c9cf676..ec4795f6d 100644 --- a/crates/uv/src/commands/project/init.rs +++ b/crates/uv/src/commands/project/init.rs @@ -39,7 +39,7 @@ use crate::commands::reporters::PythonDownloadReporter; use crate::printer::Printer; /// Add one or more packages to the project requirements. -#[allow(clippy::single_match_else, clippy::fn_params_excessive_bools)] +#[expect(clippy::single_match_else, clippy::fn_params_excessive_bools)] pub(crate) async fn init( project_dir: &Path, explicit_path: Option, @@ -199,7 +199,7 @@ pub(crate) async fn init( Ok(ExitStatus::Success) } -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] async fn init_script( script_path: &Path, bare: bool, @@ -283,7 +283,7 @@ async fn init_script( } /// Initialize a project (and, implicitly, a workspace root) at the given path. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] async fn init_project( path: &Path, name: &PackageName, @@ -748,7 +748,7 @@ impl InitKind { impl InitProjectKind { /// Initialize this project kind at the target path. - #[allow(clippy::fn_params_excessive_bools)] + #[expect(clippy::fn_params_excessive_bools)] fn init( self, name: &PackageName, @@ -794,7 +794,7 @@ impl InitProjectKind { } /// Initialize a Python application at the target path. - #[allow(clippy::fn_params_excessive_bools)] + #[expect(clippy::fn_params_excessive_bools)] fn init_application( name: &PackageName, path: &Path, @@ -877,7 +877,7 @@ impl InitProjectKind { } /// Initialize a library project at the target path. - #[allow(clippy::fn_params_excessive_bools)] + #[expect(clippy::fn_params_excessive_bools)] fn init_library( name: &PackageName, path: &Path, diff --git a/crates/uv/src/commands/project/install_target.rs b/crates/uv/src/commands/project/install_target.rs index d11ae2738..ad5b990a0 100644 --- a/crates/uv/src/commands/project/install_target.rs +++ b/crates/uv/src/commands/project/install_target.rs @@ -261,7 +261,7 @@ impl<'lock> InstallTarget<'lock> { } /// Validate the extras requested by the [`ExtrasSpecification`]. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] pub(crate) fn validate_extras(self, extras: &ExtrasSpecification) -> Result<(), ProjectError> { if extras.is_empty() { return Ok(()); @@ -317,7 +317,7 @@ impl<'lock> InstallTarget<'lock> { } /// Validate the dependency groups requested by the [`DependencyGroupSpecifier`]. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] pub(crate) fn validate_groups( self, groups: &DependencyGroupsWithDefaults, diff --git a/crates/uv/src/commands/project/lock.rs b/crates/uv/src/commands/project/lock.rs index 32e221673..b4b65bd52 100644 --- a/crates/uv/src/commands/project/lock.rs +++ b/crates/uv/src/commands/project/lock.rs @@ -53,7 +53,7 @@ use crate::settings::{FrozenSource, LockCheck, LockCheckSource, ResolverSettings /// The result of running a lock operation. #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(crate) enum LockResult { /// The lock was unchanged. Unchanged(Lock), @@ -78,7 +78,6 @@ impl LockResult { } /// Resolve the project requirements into a lockfile. -#[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn lock( project_dir: &Path, lock_check: LockCheck, diff --git a/crates/uv/src/commands/project/lock_target.rs b/crates/uv/src/commands/project/lock_target.rs index 460cef866..69234ae87 100644 --- a/crates/uv/src/commands/project/lock_target.rs +++ b/crates/uv/src/commands/project/lock_target.rs @@ -243,7 +243,7 @@ impl<'lock> LockTarget<'lock> { } /// Return the `Requires-Python` bound for the [`LockTarget`]. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] pub(crate) fn requires_python(self) -> Result, ProjectError> { match self { Self::Workspace(workspace) => { diff --git a/crates/uv/src/commands/project/mod.rs b/crates/uv/src/commands/project/mod.rs index b121a023f..4f831abf7 100644 --- a/crates/uv/src/commands/project/mod.rs +++ b/crates/uv/src/commands/project/mod.rs @@ -487,7 +487,7 @@ impl PlatformState { /// /// For a [`Workspace`] with multiple packages, the `Requires-Python` bound is the union of the /// `Requires-Python` bounds of all the packages. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn find_requires_python( workspace: &Workspace, groups: &DependencyGroupsWithDefaults, @@ -531,7 +531,7 @@ pub(crate) fn find_requires_python( /// /// If no [`Workspace`] is provided, the `requires-python` will be validated against the originating /// source (e.g., a `.python-version` file or a `--python` command-line argument). -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn validate_project_requires_python( interpreter: &Interpreter, workspace: Option<&Workspace>, @@ -584,7 +584,7 @@ pub(crate) fn validate_project_requires_python( } /// Returns an error if the [`Interpreter`] does not satisfy script or workspace `requires-python`. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] fn validate_script_requires_python( interpreter: &Interpreter, requires_python: &RequiresPython, @@ -618,7 +618,7 @@ fn validate_script_requires_python( /// An interpreter suitable for a PEP 723 script. #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(crate) enum ScriptInterpreter { /// An interpreter to use to create a new script environment. Interpreter(Interpreter), @@ -938,7 +938,7 @@ fn environment_is_usable( /// An interpreter suitable for the project. #[derive(Debug)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(crate) enum ProjectInterpreter { /// An interpreter from outside the project, to create a new project virtual environment. Interpreter(Interpreter), @@ -1501,7 +1501,7 @@ impl ProjectEnvironment { /// /// Returns an error if the environment was created in `--dry-run` mode, as dropping the /// associated temporary directory could lead to errors downstream. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] pub(crate) fn into_environment(self) -> Result { match self { Self::Existing(environment) => Ok(environment), @@ -1697,7 +1697,7 @@ impl ScriptEnvironment { /// /// Returns an error if the environment was created in `--dry-run` mode, as dropping the /// associated temporary directory could lead to errors downstream. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] pub(crate) fn into_environment(self) -> Result { match self { Self::Existing(environment) => Ok(environment), @@ -2625,7 +2625,7 @@ pub(crate) async fn init_script_python_requirement( } /// Returns the default dependency groups from the [`PyProjectToml`]. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn default_dependency_groups( pyproject_toml: &PyProjectToml, ) -> Result { @@ -2653,7 +2653,7 @@ pub(crate) fn default_dependency_groups( /// Validate that we aren't trying to install extras or groups that /// are declared as conflicting. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn detect_conflicts( target: &InstallTarget, extras: &ExtrasSpecification, @@ -2696,7 +2696,7 @@ pub(crate) fn detect_conflicts( } /// Determine the [`RequirementsSpecification`] for a script. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn script_specification( script: Pep723ItemRef<'_>, settings: &ResolverSettings, @@ -2776,7 +2776,7 @@ pub(crate) fn script_specification( } /// Determine the extra build requires for a script. -#[allow(clippy::result_large_err)] +#[expect(clippy::result_large_err)] pub(crate) fn script_extra_build_requires( script: Pep723ItemRef<'_>, settings: &ResolverSettings, diff --git a/crates/uv/src/commands/project/remove.rs b/crates/uv/src/commands/project/remove.rs index c8696b21d..958a61d73 100644 --- a/crates/uv/src/commands/project/remove.rs +++ b/crates/uv/src/commands/project/remove.rs @@ -39,7 +39,6 @@ use crate::printer::Printer; use crate::settings::{FrozenSource, LockCheck, ResolverInstallerSettings}; /// Remove one or more packages from the project requirements. -#[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn remove( project_dir: &Path, lock_check: LockCheck, @@ -389,7 +388,7 @@ pub(crate) async fn remove( /// Represents the destination where dependencies are added, either to a project or a script. #[derive(Debug)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] enum RemoveTarget { /// A PEP 723 script, with inline metadata. Project(VirtualProject), @@ -426,7 +425,7 @@ impl RemoveTarget { } /// Update the target in-memory to incorporate the new content. - #[allow(clippy::result_large_err)] + #[expect(clippy::result_large_err)] fn update(self, content: &str) -> Result { match self { Self::Script(mut script) => { diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index 098d3ab72..233d437ce 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -76,7 +76,7 @@ use crate::printer::Printer; use crate::settings::{FrozenSource, LockCheck, ResolverInstallerSettings, ResolverSettings}; /// Run a command. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn run( project_dir: &Path, script: Option, @@ -1744,7 +1744,6 @@ async fn resolve_gist_url( impl RunCommand { /// Determine the [`RunCommand`] for a given set of arguments. - #[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn from_args( command: &ExternalCommand, client_builder: BaseClientBuilder<'_>, diff --git a/crates/uv/src/commands/project/sync.rs b/crates/uv/src/commands/project/sync.rs index edac803ee..d6aa1ae90 100644 --- a/crates/uv/src/commands/project/sync.rs +++ b/crates/uv/src/commands/project/sync.rs @@ -56,7 +56,6 @@ use crate::settings::{ }; /// Sync the project environment. -#[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn sync( project_dir: &Path, lock_check: LockCheck, @@ -464,7 +463,7 @@ pub(crate) async fn sync( /// The outcome of a `lock` operation within a `sync` operation. #[derive(Debug)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] enum Outcome { /// The `lock` operation was successful. Success(LockResult), @@ -548,7 +547,7 @@ fn identify_installation_target<'a>( } #[derive(Debug, Clone)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] enum SyncTarget { /// Sync a project environment. Project(VirtualProject), @@ -601,7 +600,6 @@ impl Deref for SyncEnvironment { } /// Sync a lockfile with an environment. -#[allow(clippy::fn_params_excessive_bools)] pub(super) async fn do_sync( target: InstallTarget<'_>, venv: &PythonEnvironment, diff --git a/crates/uv/src/commands/project/tree.rs b/crates/uv/src/commands/project/tree.rs index 198b9b653..cfe271281 100644 --- a/crates/uv/src/commands/project/tree.rs +++ b/crates/uv/src/commands/project/tree.rs @@ -34,7 +34,7 @@ use crate::settings::LockCheck; use crate::settings::ResolverSettings; /// Run a command. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn tree( project_dir: &Path, groups: DependencyGroups, diff --git a/crates/uv/src/commands/project/version.rs b/crates/uv/src/commands/project/version.rs index 70744ac25..ae4e84d18 100644 --- a/crates/uv/src/commands/project/version.rs +++ b/crates/uv/src/commands/project/version.rs @@ -53,7 +53,7 @@ pub(crate) fn self_version( } /// Read or update project version (`uv version`) -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn project_version( value: Option, mut bump: Vec, @@ -516,7 +516,6 @@ async fn print_frozen_version( } /// Re-lock and re-sync the project after a series of edits. -#[allow(clippy::fn_params_excessive_bools)] async fn lock_and_sync( project: VirtualProject, project_dir: &Path, diff --git a/crates/uv/src/commands/python/find.rs b/crates/uv/src/commands/python/find.rs index 31e28e6a7..094235284 100644 --- a/crates/uv/src/commands/python/find.rs +++ b/crates/uv/src/commands/python/find.rs @@ -23,7 +23,7 @@ use crate::commands::{ use crate::printer::Printer; /// Find a Python interpreter. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn find( project_dir: &Path, request: Option, diff --git a/crates/uv/src/commands/python/install.rs b/crates/uv/src/commands/python/install.rs index 205091936..2d1999c47 100644 --- a/crates/uv/src/commands/python/install.rs +++ b/crates/uv/src/commands/python/install.rs @@ -177,7 +177,7 @@ pub(crate) enum PythonUpgrade { } /// Download and install Python versions. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn install( project_dir: &Path, install_dir: Option, @@ -283,7 +283,7 @@ pub(crate) async fn install( installer_result } -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] async fn perform_install( project_dir: &Path, install_dir: Option, @@ -953,7 +953,7 @@ async fn perform_install( /// Link the binaries of a managed Python installation to the bin directory. /// /// This function is fallible, but errors are pushed to `errors` instead of being thrown. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] fn create_bin_links( installation: &ManagedPythonInstallation, bin: &Path, diff --git a/crates/uv/src/commands/python/list.rs b/crates/uv/src/commands/python/list.rs index 8259b17a0..cf437d2b8 100644 --- a/crates/uv/src/commands/python/list.rs +++ b/crates/uv/src/commands/python/list.rs @@ -52,7 +52,7 @@ struct PrintData { } /// List available Python installations. -#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)] +#[expect(clippy::too_many_arguments, clippy::fn_params_excessive_bools)] pub(crate) async fn list( request: Option, kinds: PythonListKinds, @@ -252,7 +252,7 @@ pub(crate) async fn list( Ok(PrintData { key: key.to_string(), version: version.version().clone(), - #[allow(clippy::get_first)] + #[expect(clippy::get_first)] version_parts: NamedVersionParts { major: release.get(0).copied().unwrap_or(0), minor: release.get(1).copied().unwrap_or(0), diff --git a/crates/uv/src/commands/python/pin.rs b/crates/uv/src/commands/python/pin.rs index 6f04ef854..b566ec8e7 100644 --- a/crates/uv/src/commands/python/pin.rs +++ b/crates/uv/src/commands/python/pin.rs @@ -26,7 +26,7 @@ use crate::commands::{ use crate::printer::Printer; /// Pin to a specific Python version. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn pin( project_dir: &Path, request: Option, diff --git a/crates/uv/src/commands/tool/install.rs b/crates/uv/src/commands/tool/install.rs index 113efdc87..645cfa9d2 100644 --- a/crates/uv/src/commands/tool/install.rs +++ b/crates/uv/src/commands/tool/install.rs @@ -49,7 +49,6 @@ use crate::printer::Printer; use crate::settings::{ResolverInstallerSettings, ResolverSettings}; /// Install a tool. -#[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn install( package: String, editable: bool, diff --git a/crates/uv/src/commands/tool/list.rs b/crates/uv/src/commands/tool/list.rs index 41c99dc3c..40f1f860a 100644 --- a/crates/uv/src/commands/tool/list.rs +++ b/crates/uv/src/commands/tool/list.rs @@ -14,7 +14,7 @@ use crate::commands::ExitStatus; use crate::printer::Printer; /// List installed tools. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn list( show_paths: bool, show_version_specifiers: bool, diff --git a/crates/uv/src/commands/tool/run.rs b/crates/uv/src/commands/tool/run.rs index b2c3b9a15..14feb8910 100644 --- a/crates/uv/src/commands/tool/run.rs +++ b/crates/uv/src/commands/tool/run.rs @@ -95,7 +95,7 @@ fn find_verbose_flag(args: &[std::ffi::OsString]) -> Option<&str> { } /// Run a command. -#[allow(clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn run( command: Option, from: Option, @@ -682,7 +682,7 @@ impl std::fmt::Display for ExecutableProviderHints<'_> { // Clippy isn't happy about the difference in size between these variants, but // [`ToolRequirement::Package`] is the more common case and it seems annoying to box it. #[derive(Debug)] -#[allow(clippy::large_enum_variant)] +#[expect(clippy::large_enum_variant)] pub(crate) enum ToolRequirement { Python { executable: String, @@ -715,7 +715,6 @@ impl std::fmt::Display for ToolRequirement { /// /// If the target tool is already installed in a compatible environment, returns that /// [`PythonEnvironment`]. Otherwise, gets or creates a [`CachedEnvironment`]. -#[allow(clippy::fn_params_excessive_bools)] async fn get_or_create_environment( request: &ToolRequest<'_>, with: &[RequirementsSource], diff --git a/crates/uv/src/commands/venv.rs b/crates/uv/src/commands/venv.rs index 20e1d1060..9617dd8b0 100644 --- a/crates/uv/src/commands/venv.rs +++ b/crates/uv/src/commands/venv.rs @@ -58,7 +58,7 @@ enum VenvError { } /// Create a virtual environment. -#[allow(clippy::unnecessary_wraps, clippy::fn_params_excessive_bools)] +#[expect(clippy::fn_params_excessive_bools)] pub(crate) async fn venv( project_dir: &Path, path: Option, diff --git a/crates/uv/src/printer.rs b/crates/uv/src/printer.rs index f46093731..234a569c7 100644 --- a/crates/uv/src/printer.rs +++ b/crates/uv/src/printer.rs @@ -74,10 +74,7 @@ impl std::fmt::Write for Stdout { fn write_str(&mut self, s: &str) -> std::fmt::Result { match self { Self::Enabled => { - #[allow(clippy::print_stdout, clippy::ignored_unit_patterns)] - { - print!("{s}"); - } + print!("{s}"); } Self::Disabled => {} } @@ -96,10 +93,7 @@ impl std::fmt::Write for Stderr { fn write_str(&mut self, s: &str) -> std::fmt::Result { match self { Self::Enabled => { - #[allow(clippy::print_stderr, clippy::ignored_unit_patterns)] - { - eprint!("{s}"); - } + eprint!("{s}"); } Self::Disabled => {} } diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index ce3d8f286..68cc35368 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -386,7 +386,6 @@ pub(crate) struct InitSettings { impl InitSettings { /// Resolve the [`InitSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: InitArgs, filesystem: Option, @@ -564,7 +563,6 @@ impl RunSettings { const DEFAULT_MAX_RECURSION_DEPTH: u32 = 100; /// Resolve the [`RunSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: RunArgs, filesystem: Option, @@ -724,7 +722,6 @@ pub(crate) struct ToolRunSettings { impl ToolRunSettings { /// Resolve the [`ToolRunSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: ToolRunArgs, filesystem: Option, @@ -875,7 +872,6 @@ pub(crate) struct ToolInstallSettings { impl ToolInstallSettings { /// Resolve the [`ToolInstallSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: ToolInstallArgs, filesystem: Option, @@ -985,7 +981,6 @@ pub(crate) struct ToolUpgradeSettings { } impl ToolUpgradeSettings { /// Resolve the [`ToolUpgradeSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: ToolUpgradeArgs, filesystem: Option, @@ -1097,7 +1092,7 @@ pub(crate) struct ToolListSettings { impl ToolListSettings { /// Resolve the [`ToolListSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] + #[expect(clippy::needless_pass_by_value)] pub(crate) fn resolve(args: ToolListArgs, _filesystem: Option) -> Self { let ToolListArgs { show_paths, @@ -1127,7 +1122,6 @@ pub(crate) struct ToolUninstallSettings { impl ToolUninstallSettings { /// Resolve the [`ToolUninstallSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve(args: ToolUninstallArgs, _filesystem: Option) -> Self { let ToolUninstallArgs { name, all } = args; @@ -1145,7 +1139,7 @@ pub(crate) struct ToolDirSettings { impl ToolDirSettings { /// Resolve the [`ToolDirSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] + #[expect(clippy::needless_pass_by_value)] pub(crate) fn resolve(args: ToolDirArgs, _filesystem: Option) -> Self { let ToolDirArgs { bin } = args; @@ -1180,7 +1174,7 @@ pub(crate) struct PythonListSettings { impl PythonListSettings { /// Resolve the [`PythonListSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] + #[expect(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: PythonListArgs, filesystem: Option, @@ -1262,7 +1256,7 @@ pub(crate) struct PythonDirSettings { impl PythonDirSettings { /// Resolve the [`PythonDirSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] + #[expect(clippy::needless_pass_by_value)] pub(crate) fn resolve(args: PythonDirArgs, _filesystem: Option) -> Self { let PythonDirArgs { bin } = args; @@ -1289,7 +1283,6 @@ pub(crate) struct PythonInstallSettings { impl PythonInstallSettings { /// Resolve the [`PythonInstallSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: PythonInstallArgs, filesystem: Option, @@ -1355,7 +1348,7 @@ impl PythonInstallSettings { } /// The resolved settings to use for a `python upgrade` invocation. -#[allow(clippy::struct_excessive_bools)] +#[expect(clippy::struct_excessive_bools)] #[derive(Debug, Clone)] pub(crate) struct PythonUpgradeSettings { pub(crate) install_dir: Option, @@ -1373,7 +1366,6 @@ pub(crate) struct PythonUpgradeSettings { impl PythonUpgradeSettings { /// Resolve the [`PythonUpgradeSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: PythonUpgradeArgs, filesystem: Option, @@ -1440,7 +1432,6 @@ pub(crate) struct PythonUninstallSettings { impl PythonUninstallSettings { /// Resolve the [`PythonUninstallSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: PythonUninstallArgs, _filesystem: Option, @@ -1471,7 +1462,6 @@ pub(crate) struct PythonFindSettings { impl PythonFindSettings { /// Resolve the [`PythonFindSettings`] from the CLI and workspace configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: PythonFindArgs, filesystem: Option, @@ -1527,7 +1517,6 @@ pub(crate) struct PythonPinSettings { impl PythonPinSettings { /// Resolve the [`PythonPinSettings`] from the CLI and workspace configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: PythonPinArgs, filesystem: Option, @@ -1560,7 +1549,7 @@ impl PythonPinSettings { } /// The resolved settings to use for a `sync` invocation. -#[allow(clippy::struct_excessive_bools, dead_code)] +#[expect(dead_code)] #[derive(Debug, Clone)] pub(crate) struct SyncSettings { pub(crate) lock_check: LockCheck, @@ -1585,7 +1574,6 @@ pub(crate) struct SyncSettings { impl SyncSettings { /// Resolve the [`SyncSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: SyncArgs, filesystem: Option, @@ -1717,7 +1705,6 @@ impl SyncSettings { } /// The resolved settings to use for a `lock` invocation. -#[allow(clippy::struct_excessive_bools, dead_code)] #[derive(Debug, Clone)] pub(crate) struct LockSettings { pub(crate) lock_check: LockCheck, @@ -1732,7 +1719,6 @@ pub(crate) struct LockSettings { impl LockSettings { /// Resolve the [`LockSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: LockArgs, filesystem: Option, @@ -1784,7 +1770,7 @@ impl LockSettings { } /// The resolved settings to use for a `add` invocation. -#[allow(clippy::struct_excessive_bools, dead_code)] +#[expect(clippy::struct_excessive_bools)] #[derive(Debug, Clone)] pub(crate) struct AddSettings { pub(crate) lock_check: LockCheck, @@ -1824,7 +1810,6 @@ pub(crate) struct AddSettings { impl AddSettings { /// Resolve the [`AddSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: AddArgs, filesystem: Option, @@ -2010,7 +1995,7 @@ impl AddSettings { } /// The resolved settings to use for a `remove` invocation. -#[allow(clippy::struct_excessive_bools, dead_code)] +#[expect(dead_code)] #[derive(Debug, Clone)] pub(crate) struct RemoveSettings { pub(crate) lock_check: LockCheck, @@ -2029,7 +2014,6 @@ pub(crate) struct RemoveSettings { impl RemoveSettings { /// Resolve the [`RemoveSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: RemoveArgs, filesystem: Option, @@ -2110,7 +2094,6 @@ impl RemoveSettings { } /// The resolved settings to use for a `version` invocation. -#[allow(clippy::struct_excessive_bools, dead_code)] #[derive(Debug, Clone)] pub(crate) struct VersionSettings { pub(crate) value: Option, @@ -2131,7 +2114,6 @@ pub(crate) struct VersionSettings { impl VersionSettings { /// Resolve the [`RemoveSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: VersionArgs, filesystem: Option, @@ -2295,7 +2277,7 @@ impl TreeSettings { } /// The resolved settings to use for an `export` invocation. -#[allow(clippy::struct_excessive_bools, dead_code)] +#[expect(clippy::struct_excessive_bools, dead_code)] #[derive(Debug, Clone)] pub(crate) struct ExportSettings { pub(crate) format: Option, @@ -2321,7 +2303,6 @@ pub(crate) struct ExportSettings { impl ExportSettings { /// Resolve the [`ExportSettings`] from the CLI and filesystem configuration. - #[allow(clippy::needless_pass_by_value)] pub(crate) fn resolve( args: ExportArgs, filesystem: Option, @@ -4256,7 +4237,7 @@ where } /// Prints a parse error and exits the process. -#[allow(clippy::exit, clippy::print_stderr)] +#[expect(clippy::exit, clippy::print_stderr)] fn parse_failure(name: &str, expected: &str) -> ! { eprintln!("error: invalid value for {name}, expected {expected}"); process::exit(1) diff --git a/crates/uv/tests/it/auth.rs b/crates/uv/tests/it/auth.rs index fc4918e32..e7d4737e1 100644 --- a/crates/uv/tests/it/auth.rs +++ b/crates/uv/tests/it/auth.rs @@ -1204,7 +1204,7 @@ fn login_text_store() { } #[test] -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] fn login_password_stdin() -> Result<()> { let context = TestContext::new_with_versions(&[]); @@ -1247,7 +1247,7 @@ fn login_password_stdin() -> Result<()> { } #[test] -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] fn login_token_stdin() -> Result<()> { let context = TestContext::new_with_versions(&[]); diff --git a/crates/uv/tests/it/common/mod.rs b/crates/uv/tests/it/common/mod.rs index be543247b..2075420eb 100644 --- a/crates/uv/tests/it/common/mod.rs +++ b/crates/uv/tests/it/common/mod.rs @@ -1257,7 +1257,7 @@ impl TestContext { } /// Create a `uv publish` command with options shared across scenarios. - #[allow(clippy::unused_self)] + #[expect(clippy::unused_self)] pub fn publish(&self) -> Command { let mut command = Self::new_command(); command.arg("publish"); @@ -1632,7 +1632,7 @@ impl TestContext { } /// For when we add pypy to the test suite. - #[allow(clippy::unused_self)] + #[expect(clippy::unused_self)] pub fn python_kind(&self) -> &'static str { "python" } @@ -1935,7 +1935,7 @@ pub fn run_and_format>( /// Execute the command and format its output status, stdout and stderr into a snapshot string. /// /// This function is derived from `insta_cmd`s `spawn_with_info`. -#[allow(clippy::print_stderr)] +#[expect(clippy::print_stderr)] pub fn run_and_format_with_status>( mut command: impl BorrowMut, filters: impl AsRef<[(T, T)]>, diff --git a/crates/uv/tests/it/pip_install.rs b/crates/uv/tests/it/pip_install.rs index c0ff744d2..17b39ae7d 100644 --- a/crates/uv/tests/it/pip_install.rs +++ b/crates/uv/tests/it/pip_install.rs @@ -582,7 +582,7 @@ fn install_requirements_txt() -> Result<()> { /// Install a package from a `requirements.txt` passed via `-r -` into a virtual environment. #[test] -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] fn install_from_stdin() -> Result<()> { let context = TestContext::new("3.12"); @@ -620,7 +620,7 @@ fn install_from_stdin() -> Result<()> { /// Install a package from a `requirements.txt` passed via `-r /dev/stdin` into a virtual environment. #[test] #[cfg(not(windows))] -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] fn install_from_dev_stdin() -> Result<()> { let context = TestContext::new("3.12"); @@ -3624,7 +3624,7 @@ fn install_constraints_txt() -> Result<()> { /// Install a package from a `requirements.txt` file, with a `constraints.txt` file. #[test] -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] fn install_constraints_txt_from_stdin() -> Result<()> { let context = TestContext::new("3.12"); let requirements_txt = context.temp_dir.child("requirements.txt"); @@ -7400,7 +7400,7 @@ fn require_hashes_override() -> Result<()> { /// Install with overrides from stdin. #[test] -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] fn install_with_overrides_from_stdin() -> Result<()> { let context = TestContext::new("3.12"); @@ -7431,7 +7431,7 @@ fn install_with_overrides_from_stdin() -> Result<()> { /// Install with excludes from stdin. #[test] -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] fn install_with_excludes_from_stdin() -> Result<()> { let context = TestContext::new("3.12"); @@ -8757,7 +8757,7 @@ fn incompatible_build_constraint() -> Result<()> { /// Include a `build_constraints.txt` file with an incompatible constraint from stdin. #[test] -#[allow(clippy::disallowed_types)] +#[expect(clippy::disallowed_types)] fn incompatible_build_constraint_from_stdin() -> Result<()> { let context = TestContext::new(DEFAULT_PYTHON_VERSION); diff --git a/crates/uv/tests/it/python_install.rs b/crates/uv/tests/it/python_install.rs index 3de89e76d..429104dee 100644 --- a/crates/uv/tests/it/python_install.rs +++ b/crates/uv/tests/it/python_install.rs @@ -2765,7 +2765,7 @@ fn python_install_emulated_macos() { if !arch_status.is_ok_and(|x| x.success()) { // Rosetta is not available to run the x86_64 interpreter // fail the test in CI, otherwise skip it - #[allow(clippy::manual_assert)] + #[expect(clippy::manual_assert)] if env::var(EnvVars::CI).is_ok() { panic!("x86_64 emulation is not available on this CI runner"); }