From 8ce768f08fd8da095f4c5e5ac206cb4987e3c130 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 1 Sep 2024 00:49:06 +0000 Subject: [PATCH 1/2] chore(deps): Update Rust crate derive_more to v1 --- Cargo.lock | 51 +++++++++++++++------------------- crates/committed/Cargo.toml | 2 +- crates/committed/src/report.rs | 33 +++++++++------------- 3 files changed, 36 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab18fa8..86214cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -189,7 +189,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.58", ] [[package]] @@ -244,22 +244,24 @@ dependencies = [ ] [[package]] -name = "convert_case" -version = "0.4.0" +name = "derive_more" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] [[package]] -name = "derive_more" -version = "0.99.17" +name = "derive_more-impl" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", - "syn 1.0.109", + "syn 2.0.58", + "unicode-xid", ] [[package]] @@ -616,9 +618,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.26" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -674,15 +676,6 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "ryu" version = "1.0.13" @@ -698,12 +691,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "semver" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" - [[package]] name = "serde" version = "1.0.154" @@ -769,9 +756,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.12" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79d9531f94112cfc3e4c8f5f02cb2b58f72c97b7efd85f70203cc6d8efda5927" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -872,6 +859,12 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "unicode-xid" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" + [[package]] name = "url" version = "2.3.1" diff --git a/crates/committed/Cargo.toml b/crates/committed/Cargo.toml index 24f2833..97f3878 100644 --- a/crates/committed/Cargo.toml +++ b/crates/committed/Cargo.toml @@ -43,7 +43,7 @@ clap-verbosity-flag = "2.2" colorchoice-clap = "1.0.3" grep-cli = "0.1" imperative = "1.0.5" -derive_more = "0.99.17" +derive_more = { version = "1.0.0", features = ["from", "display"] } itertools = "0.13.0" proc-exit = "2.0" human-panic = "2.0.0" diff --git a/crates/committed/src/report.rs b/crates/committed/src/report.rs index ca30820..9e8c3e9 100644 --- a/crates/committed/src/report.rs +++ b/crates/committed/src/report.rs @@ -31,7 +31,7 @@ pub(crate) enum Source<'s> { #[serde(serialize_with = "serialize_oid")] Oid(git2::Oid), ShortId(&'s str), - #[display(fmt = "{}", "_0.display()")] + #[display("{}", "_0.display()")] Path(&'s std::path::Path), } @@ -47,7 +47,7 @@ where #[serde(rename_all = "snake_case")] #[non_exhaustive] pub(crate) enum Severity { - #[display(fmt = "error")] + #[display("error")] Error, } @@ -73,7 +73,7 @@ pub(crate) enum Content<'s> { #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] #[display( - fmt = "Commit subject is too long, {} exceeds the max length of {}", + "Commit subject is too long, {} exceeds the max length of {}", actual_length, max_length )] @@ -86,7 +86,7 @@ pub(crate) struct SubjectTooLong { #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] #[display( - fmt = "Line is too long, {} exceeds the max length of {}", + "Line is too long, {} exceeds the max length of {}", actual_length, max_length )] @@ -98,7 +98,7 @@ pub(crate) struct LineTooLong { #[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display(fmt = "Subject should be capitalized but found `{}`", first_word)] +#[display("Subject should be capitalized but found `{}`", first_word)] pub(crate) struct CapitalizeSubject<'s> { pub(crate) first_word: &'s str, } @@ -106,7 +106,7 @@ pub(crate) struct CapitalizeSubject<'s> { #[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display(fmt = "Subject should not be punctuated but found `{}`", punctuation)] +#[display("Subject should not be punctuated but found `{}`", punctuation)] pub(crate) struct NoPunctuation { pub(crate) punctuation: char, } @@ -114,10 +114,7 @@ pub(crate) struct NoPunctuation { #[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display( - fmt = "Subject should be in the imperative mood but found `{}`", - first_word -)] +#[display("Subject should be in the imperative mood but found `{}`", first_word)] pub(crate) struct Imperative<'s> { pub(crate) first_word: &'s str, } @@ -125,19 +122,19 @@ pub(crate) struct Imperative<'s> { #[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display(fmt = "Work-in-progress commits must be cleaned up")] +#[display("Work-in-progress commits must be cleaned up")] pub(crate) struct Wip {} #[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display(fmt = "Fixup commits must be squashed")] +#[display("Fixup commits must be squashed")] pub(crate) struct Fixup {} #[derive(Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display(fmt = "Commit is not in {} format: {}", style, error)] +#[display("Commit is not in {} format: {}", style, error)] pub(crate) struct InvalidCommitFormat { #[serde(serialize_with = "serialize_error")] pub(crate) error: anyhow::Error, @@ -155,11 +152,7 @@ where #[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display( - fmt = "Disallowed type `{}` used, please use one of {:?}", - used, - allowed -)] +#[display("Disallowed type `{}` used, please use one of {:?}", used, allowed)] pub(crate) struct DisallowedCommitType { pub(crate) used: String, pub(crate) allowed: Vec, @@ -168,13 +161,13 @@ pub(crate) struct DisallowedCommitType { #[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display(fmt = "Merge commits are disallowed")] +#[display("Merge commits are disallowed")] pub(crate) struct MergeCommitDisallowed {} #[derive(Clone, Debug, serde::Serialize)] #[serde(rename_all = "snake_case")] #[derive(derive_more::Display)] -#[display(fmt = "Empty commits are disallowed")] +#[display("Empty commits are disallowed")] pub(crate) struct EmptyCommit {} pub(crate) type Report = fn(msg: Message<'_>); From 56787191880fd5246b2867d0282649a7d82dc124 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 3 Sep 2024 12:41:36 -0500 Subject: [PATCH 2/2] chore: Bump MSRV to 1.75 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 038718e..e4f0206 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ resolver = "2" repository = "https://github.com/crate-ci/committed" license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.74" # MSRV +rust-version = "1.75" # MSRV include = [ "build.rs", "src/**/*",