From 9de49c8a606209a4904aea8fd572f82959ba4a27 Mon Sep 17 00:00:00 2001 From: konsti Date: Mon, 6 May 2024 11:10:37 +0200 Subject: [PATCH] Make pubgrub an allowed ident (#3399) Followup to #3361, fix some backtick-quoting. --- clippy.toml | 3 ++- crates/uv-resolver/src/pubgrub/dependencies.rs | 4 ++-- crates/uv-resolver/src/pubgrub/package.rs | 8 ++++---- crates/uv-resolver/src/pubgrub/priority.rs | 4 ++-- crates/uv-resolver/src/pubgrub/specifier.rs | 4 ++-- crates/uv-resolver/src/resolution.rs | 2 +- crates/uv-resolver/src/resolver/mod.rs | 2 +- crates/uv/src/shell.rs | 11 ++++++----- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/clippy.toml b/clippy.toml index c82e7aefe32e..a4ada71d8d79 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,5 +1,6 @@ doc-valid-idents = [ "PyPI", + "PubGrub", ".." # Include the defaults ] @@ -29,4 +30,4 @@ disallowed-methods = [ "std::fs::soft_link", "std::fs::symlink_metadata", "std::fs::write", -] \ No newline at end of file +] diff --git a/crates/uv-resolver/src/pubgrub/dependencies.rs b/crates/uv-resolver/src/pubgrub/dependencies.rs index c61e533c89c0..f91e5acace2a 100644 --- a/crates/uv-resolver/src/pubgrub/dependencies.rs +++ b/crates/uv-resolver/src/pubgrub/dependencies.rs @@ -18,7 +18,7 @@ use crate::ResolveError; pub struct PubGrubDependencies(Vec<(PubGrubPackage, Range)>); impl PubGrubDependencies { - /// Generate a set of `PubGrub` dependencies from a set of requirements. + /// Generate a set of PubGrub dependencies from a set of requirements. #[allow(clippy::too_many_arguments)] pub(crate) fn from_requirements( requirements: &[Requirement], @@ -178,7 +178,7 @@ impl From for Vec<(PubGrubPackage, Range)> { } } -/// Convert a [`Requirement`] to a `PubGrub`-compatible package and range. +/// Convert a [`Requirement`] to a PubGrub-compatible package and range. fn to_pubgrub( requirement: &Requirement, extra: Option, diff --git a/crates/uv-resolver/src/pubgrub/package.rs b/crates/uv-resolver/src/pubgrub/package.rs index e0da2cae9885..36b39fe5a967 100644 --- a/crates/uv-resolver/src/pubgrub/package.rs +++ b/crates/uv-resolver/src/pubgrub/package.rs @@ -7,7 +7,7 @@ use crate::resolver::Urls; /// A PubGrub-compatible wrapper around a "Python package", with two notable characteristics: /// -/// 1. Includes a [`PubGrubPackage::Root`] variant, to satisfy `PubGrub`'s requirement that a +/// 1. Includes a [`PubGrubPackage::Root`] variant, to satisfy PubGrub's requirement that a /// resolution starts from a single root. /// 2. Uses the same strategy as pip and posy to handle extras: for each extra, we create a virtual /// package (e.g., `black[colorama]`), and mark it as a dependency of the real package (e.g., @@ -26,7 +26,7 @@ pub enum PubGrubPackage { /// The URL of the package, if it was specified in the requirement. /// /// There are a few challenges that come with URL-based packages, and how they map to - /// `PubGrub`. + /// PubGrub. /// /// If the user declares a direct URL dependency, and then a transitive dependency /// appears for the same package, we need to ensure that the direct URL dependency can @@ -70,9 +70,9 @@ pub enum PubGrubPackage { /// /// The benefit of the proxy package (versus `PubGrubPackage::Package("black", Some("colorama")` /// on its own) is that it enables us to avoid attempting to retrieve metadata for irrelevant - /// versions the extra variants by making it clear to `PubGrub` that the extra variant must match + /// versions the extra variants by making it clear to PubGrub that the extra variant must match /// the exact same version of the base variant. Without the proxy package, then when provided - /// requirements like `black==23.0.1` and `black[colorama]`, `PubGrub` may attempt to retrieve + /// requirements like `black==23.0.1` and `black[colorama]`, PubGrub may attempt to retrieve /// metadata for `black[colorama]` versions other than `23.0.1`. Extra(PackageName, ExtraName, Option), } diff --git a/crates/uv-resolver/src/pubgrub/priority.rs b/crates/uv-resolver/src/pubgrub/priority.rs index 388e35a27a23..25c45f75d2f2 100644 --- a/crates/uv-resolver/src/pubgrub/priority.rs +++ b/crates/uv-resolver/src/pubgrub/priority.rs @@ -8,9 +8,9 @@ use uv_normalize::PackageName; use crate::pubgrub::package::PubGrubPackage; -/// A prioritization map to guide the `PubGrub` resolution process. +/// A prioritization map to guide the PubGrub resolution process. /// -/// During resolution, `PubGrub` needs to decide which package to consider next. The priorities +/// During resolution, PubGrub needs to decide which package to consider next. The priorities /// encoded here are used to guide that decision. /// /// Like `pip`, we prefer packages that are pinned to direct URLs over packages pinned to a single diff --git a/crates/uv-resolver/src/pubgrub/specifier.rs b/crates/uv-resolver/src/pubgrub/specifier.rs index 69ca6eb3399b..623b32b94592 100644 --- a/crates/uv-resolver/src/pubgrub/specifier.rs +++ b/crates/uv-resolver/src/pubgrub/specifier.rs @@ -10,7 +10,7 @@ use crate::ResolveError; pub(crate) struct PubGrubSpecifier(Range); impl From for Range { - /// Convert a `PubGrub` specifier to a range of versions. + /// Convert a PubGrub specifier to a range of versions. fn from(specifier: PubGrubSpecifier) -> Self { specifier.0 } @@ -19,7 +19,7 @@ impl From for Range { impl TryFrom<&VersionSpecifier> for PubGrubSpecifier { type Error = ResolveError; - /// Convert a PEP 508 specifier to a `PubGrub`-compatible version range. + /// Convert a PEP 508 specifier to a PubGrub-compatible version range. fn try_from(specifier: &VersionSpecifier) -> Result { let ranges = match specifier.operator() { Operator::Equal => { diff --git a/crates/uv-resolver/src/resolution.rs b/crates/uv-resolver/src/resolution.rs index 98062b0e12a9..adcfe6285661 100644 --- a/crates/uv-resolver/src/resolution.rs +++ b/crates/uv-resolver/src/resolution.rs @@ -64,7 +64,7 @@ pub struct ResolutionGraph { } impl ResolutionGraph { - /// Create a new graph from the resolved `PubGrub` state. + /// Create a new graph from the resolved PubGrub state. #[allow(clippy::too_many_arguments)] pub(crate) fn from_state( selection: &SelectedDependencies, diff --git a/crates/uv-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs index a817bc73d1a8..38e9f3338df8 100644 --- a/crates/uv-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -281,7 +281,7 @@ impl< } } - /// Run the `PubGrub` solver. + /// Run the PubGrub solver. #[instrument(skip_all)] async fn solve( &self, diff --git a/crates/uv/src/shell.rs b/crates/uv/src/shell.rs index b015d4845197..f1e3bf599e9e 100644 --- a/crates/uv/src/shell.rs +++ b/crates/uv/src/shell.rs @@ -2,20 +2,21 @@ use std::path::Path; /// Shells for which virtualenv activation scripts are available. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[allow(clippy::doc_markdown)] pub(crate) enum Shell { - /// Bourne Again `SHell` (bash) + /// Bourne Again SHell (bash) Bash, - /// Friendly Interactive `SHell` (fish) + /// Friendly Interactive SHell (fish) Fish, - /// `PowerShell` + /// PowerShell Powershell, /// Cmd (Command Prompt) Cmd, - /// Z `SHell` (zsh) + /// Z SHell (zsh) Zsh, /// Nushell Nushell, - /// C `SHell` (csh) + /// C SHell (csh) Csh, }