From aa09aa3f19a37d315ac570508315e7071184419e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:30:09 +0000 Subject: [PATCH 1/7] build(deps): update rust crate git-repository to 0.32.0 --- Cargo.lock | 64 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43ae6d679..265fcd2a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -868,9 +868,9 @@ dependencies = [ [[package]] name = "git-actor" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "599cb75eb7c3bf03149b7ab70c66bc0b9a432a092b1154b49d21b49fc7e4bd93" +checksum = "d9e5fd7bc63ad527d64584f8d01f99b89c051f5fbb8144b58ae5f812775065cf" dependencies = [ "bstr", "btoi", @@ -925,9 +925,9 @@ dependencies = [ [[package]] name = "git-config" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1b95089db62159d7d24c13ddfb4bf949c508521d0bb25331744ef500295ceb8" +checksum = "c9da662fd64ac69772158dcf04777da6266f0f36bc9a310b3eb2d805bb696315" dependencies = [ "bstr", "git-config-value", @@ -975,9 +975,9 @@ dependencies = [ [[package]] name = "git-date" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2874ce2f3a77cb144167901ea830969e5c991eac7bfee85e6e3f53ef9fcdf2" +checksum = "412c9b89026505bd24d5f8acafa578de6eea3b271ece307a73b8e646e671302a" dependencies = [ "bstr", "itoa", @@ -987,9 +987,9 @@ dependencies = [ [[package]] name = "git-diff" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8ae775956f509fe115b173d79e539f97539d40c1d5c5c63a61d10eaf79c857a" +checksum = "ca87474422d26d606d04cec6bedfabcd92a0a74102cd7936785358ced6a4a25a" dependencies = [ "git-hash", "git-object", @@ -999,9 +999,9 @@ dependencies = [ [[package]] name = "git-discover" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab20ca6af631c2bb10d59e63377ca9c9c74908586e6018ab15377967432e68b" +checksum = "1e9e26e0bc434643228cd418185bd28ca5c7cf831bde1da434807391c27ac40e" dependencies = [ "bstr", "git-hash", @@ -1066,9 +1066,9 @@ dependencies = [ [[package]] name = "git-index" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "430f5d9302a2dd5e50b6b04a3b9d0df6b3423e55908fde18333fe9cd51312027" +checksum = "485da97dd4f69c7d9a8dc238cd6f4a726387ffc34573489e8e0d2bee266e3454" dependencies = [ "atoi", "bitflags", @@ -1099,9 +1099,9 @@ dependencies = [ [[package]] name = "git-mailmap" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396cef08d4ec18ea35fed043f5b003e46957603a01349dd429a4773c146fefca" +checksum = "0316b4346f3e162ade368209efb8a609b587793c74aa3b8de0ec01a4f3580120" dependencies = [ "bstr", "git-actor", @@ -1110,9 +1110,9 @@ dependencies = [ [[package]] name = "git-object" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad6c2ddb376b99172dc8b651e11be4cb49cef423de4fad563ebbda4fee3fcf6" +checksum = "3f8563e2d6f524d7053f3106714f99ecdc3adbba2cb7108c09d71a02579f2e19" dependencies = [ "bstr", "btoi", @@ -1129,9 +1129,9 @@ dependencies = [ [[package]] name = "git-odb" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ea84e47ae48b95e108664d2991013507694b1b722e4183ed1c9309251b9b10" +checksum = "616115a0e3daff6e08842758d24547b37a6eb6d0e2eedd95a740c3aaa2750333" dependencies = [ "arc-swap", "git-features", @@ -1147,9 +1147,9 @@ dependencies = [ [[package]] name = "git-pack" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692e9c78c57212aa76c71be9a319f80d42fe8191735b3aff5b97b8f034295774" +checksum = "7cd16b88f4b66041f41ca510c28bd81c4ee7363c5a544b3d62b4170432965871" dependencies = [ "bytesize", "clru", @@ -1206,9 +1206,9 @@ dependencies = [ [[package]] name = "git-ref" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b351af399166a5506369e36389d6b9aee744cfa672d0e2ea93d2b01223b1cfbe" +checksum = "5e6767925a6fc4af5c5a81e348d1d851c1b3ab2b512bd7f562ac11be37c14468" dependencies = [ "git-actor", "git-features", @@ -1225,9 +1225,9 @@ dependencies = [ [[package]] name = "git-refspec" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf699f310ba8530708f599b1ce730eb557ebc0af1a1a57b882ce3d685571092" +checksum = "ddf310ed5f2829ac0af96e7d4aebd4ae4b89f0718a7ae3666d09b02b2c5a1dfd" dependencies = [ "bstr", "git-hash", @@ -1239,9 +1239,9 @@ dependencies = [ [[package]] name = "git-repository" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e21852e326233c5f3f034a44b66215c166506e5ccf227de7e28ccdfbcfb47a" +checksum = "993277960cb7e2d3991a11c1ec6951c1d142de052c26a18d2db64304e52d3741" dependencies = [ "git-actor", "git-attributes", @@ -1282,9 +1282,9 @@ dependencies = [ [[package]] name = "git-revision" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b64c0d2e37eb24c8897d11a2f77371a817c3d40dc744d4a2f048f33236eef6b" +checksum = "4f9a6bd28c9d1676bb96f428cd09614ae18a0087d7cea1cebfd177e25f99b2af" dependencies = [ "bstr", "git-date", @@ -1323,9 +1323,9 @@ dependencies = [ [[package]] name = "git-traverse" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b91ed45b561161ba56b85a83865825b7d17a6b1c6f981e831a78b93cf2cc5f" +checksum = "bd356da21ec00f69b9d4f105df4cb85543c746b18f4b7fc81529ce77713cdb29" dependencies = [ "git-hash", "git-hashtable", @@ -1359,9 +1359,9 @@ dependencies = [ [[package]] name = "git-worktree" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc45b5ac445d0f8719def12303f037966f810cf399ebe0daf29217865df9a49" +checksum = "ca3bc63878f134e08ed52dba5d82422798c01a3f2e48c38ae9a2f7ff9194f362" dependencies = [ "bstr", "git-attributes", diff --git a/Cargo.toml b/Cargo.toml index 28ecac27c..4bd09fd52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ dunce = "1.0.3" gethostname = "0.4.1" git-features = { version = "0.26.0", optional = true } # default feature restriction addresses https://github.com/starship/starship/issues/4251 -git-repository = { version = "0.31.0", default-features = false, features = ["max-performance-safe"] } +git-repository = { version = "0.32.0", default-features = false, features = ["max-performance-safe"] } indexmap = { version = "1.9.2", features = ["serde"] } log = { version = "0.4.17", features = ["std"] } # nofity-rust is optional (on by default) because the crate doesn't currently build for darwin with nix From 8845c7168bdbf2715ac4425d4f90067287ed9482 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 18:16:01 +0000 Subject: [PATCH 2/7] build(deps): update rust crate regex to 1.7.1 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 265fcd2a9..755beb9a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2467,9 +2467,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 4bd09fd52..d9258605d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,7 @@ pest_derive = "2.5.2" quick-xml = "0.27.1" rand = "0.8.5" rayon = "1.6.1" -regex = "1.7.0" +regex = "1.7.1" rust-ini = "0.18.0" semver = "1.0.16" serde = { version = "1.0.152", features = ["derive"] } From af5e50619272a716bcb692a264e84f1db407db27 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 15:17:05 +0000 Subject: [PATCH 3/7] build(deps): update gitoxide crates --- Cargo.lock | 139 ++++++++++++++++------------------------------------- Cargo.toml | 4 +- 2 files changed, 43 insertions(+), 100 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 755beb9a7..40c7926b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -882,9 +882,9 @@ dependencies = [ [[package]] name = "git-attributes" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8013dfce47c1e29236d732308933e2c77af5355ec5105755d26faf7764d3f7b" +checksum = "b2c9687a890892650e8574e123b4b633d277b99953cb877dc02aba852a0139fa" dependencies = [ "bstr", "compact_str", @@ -925,9 +925,9 @@ dependencies = [ [[package]] name = "git-config" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9da662fd64ac69772158dcf04777da6266f0f36bc9a310b3eb2d805bb696315" +checksum = "500cc0517781f9f573c4dc26feb3ae0cdc28ae7160a81ef104590943984f6a8e" dependencies = [ "bstr", "git-config-value", @@ -975,9 +975,9 @@ dependencies = [ [[package]] name = "git-date" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "412c9b89026505bd24d5f8acafa578de6eea3b271ece307a73b8e646e671302a" +checksum = "3777ed3a92334193bc5032d468dee2ddb7d1101263e58e0d2edcc308c06948b5" dependencies = [ "bstr", "itoa", @@ -999,9 +999,9 @@ dependencies = [ [[package]] name = "git-discover" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9e26e0bc434643228cd418185bd28ca5c7cf831bde1da434807391c27ac40e" +checksum = "a2738a9941f1411cff31e6ea4399a6c7304cc3ea34fb8c1c6f1aef1f667d46cc" dependencies = [ "bstr", "git-hash", @@ -1013,9 +1013,9 @@ dependencies = [ [[package]] name = "git-features" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ff74064fa007c5beefa89a64bb72834f32b3c497750a56c79c6802bbdb311f9" +checksum = "0019327672cb759f851d1b18fdcc36bb797dc62b925cb93c8c881b54735eb2c2" dependencies = [ "crc32fast", "crossbeam-channel", @@ -1036,9 +1036,9 @@ dependencies = [ [[package]] name = "git-glob" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3908404c9b76ac7b3f636a104142378d3eaa78623cbc6eb7c7f0651979d48e8a" +checksum = "aa73cf9c9c1a66e28de1cf250fc1ebe323e7c7c59768c1a2331e3b3308e783a3" dependencies = [ "bitflags", "bstr", @@ -1066,9 +1066,9 @@ dependencies = [ [[package]] name = "git-index" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "485da97dd4f69c7d9a8dc238cd6f4a726387ffc34573489e8e0d2bee266e3454" +checksum = "b82fd3d70ed6fbceb7573f145fbf79371e4d0c8dbdf7ad46f3a03328239ddda7" dependencies = [ "atoi", "bitflags", @@ -1099,9 +1099,9 @@ dependencies = [ [[package]] name = "git-mailmap" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0316b4346f3e162ade368209efb8a609b587793c74aa3b8de0ec01a4f3580120" +checksum = "1957f2f550e345f70cb0615d390fb0446d41eeb5bc87824b7bae31efd8cfc2da" dependencies = [ "bstr", "git-actor", @@ -1129,9 +1129,9 @@ dependencies = [ [[package]] name = "git-odb" -version = "0.40.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616115a0e3daff6e08842758d24547b37a6eb6d0e2eedd95a740c3aaa2750333" +checksum = "b43514e1d1062613352a10f96d48e69967f4c420776596e1af9a6f368df2eea2" dependencies = [ "arc-swap", "git-features", @@ -1147,9 +1147,9 @@ dependencies = [ [[package]] name = "git-pack" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd16b88f4b66041f41ca510c28bd81c4ee7363c5a544b3d62b4170432965871" +checksum = "9e124d13e4e4b53ca7544e9786f30dafe2e76b4a75ba62b2156ee0656b356c71" dependencies = [ "bytesize", "clru", @@ -1182,9 +1182,9 @@ dependencies = [ [[package]] name = "git-prompt" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3612a486e507dd431ef0f7108eeaafc8fd1ed7bd0f205a88554f6f91fe5dccbf" +checksum = "ad3f84ec28896f6a4b3f3174a1125117ac91788b1c64d96f25eabcd8d01cc7e3" dependencies = [ "git-command", "git-config-value", @@ -1206,9 +1206,9 @@ dependencies = [ [[package]] name = "git-ref" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6767925a6fc4af5c5a81e348d1d851c1b3ab2b512bd7f562ac11be37c14468" +checksum = "2a2c29bab109acaf626d49a54f1f85ab7f0911268fbf62c2b39680ef4ef19069" dependencies = [ "git-actor", "git-features", @@ -1225,9 +1225,9 @@ dependencies = [ [[package]] name = "git-refspec" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf310ed5f2829ac0af96e7d4aebd4ae4b89f0718a7ae3666d09b02b2c5a1dfd" +checksum = "419fba469ca7dca4746de8b2be6a21990b276f3974acaa94314f39d4c2bbfc0a" dependencies = [ "bstr", "git-hash", @@ -1239,9 +1239,9 @@ dependencies = [ [[package]] name = "git-repository" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993277960cb7e2d3991a11c1ec6951c1d142de052c26a18d2db64304e52d3741" +checksum = "1a958d3fa83660d15c6535765477a8895156bdd6a922dbd0fc445afa42f4b534" dependencies = [ "git-actor", "git-attributes", @@ -1282,9 +1282,9 @@ dependencies = [ [[package]] name = "git-revision" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9a6bd28c9d1676bb96f428cd09614ae18a0087d7cea1cebfd177e25f99b2af" +checksum = "bfc3f7c901777f8318f059dbdf73dbda05acdb36c631fe12465bd955e230a205" dependencies = [ "bstr", "git-date", @@ -1296,15 +1296,15 @@ dependencies = [ [[package]] name = "git-sec" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1802e8252fa223b0ad89a393aed461132174ced1e6842a41f56dc92a3fc14f" +checksum = "6696a816445a51f76995d579a3122f98247377cc45cd681764f740f3a2666004" dependencies = [ "bitflags", "dirs 4.0.0", "git-path", "libc", - "windows 0.40.0", + "windows 0.43.0", ] [[package]] @@ -1335,9 +1335,9 @@ dependencies = [ [[package]] name = "git-url" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85af407ed0dbb8d8da2a7241827d2fd5681186d9dab3570fc8dd8d6152ec48f" +checksum = "cc9a3df0498c511cf34739eab2692352939b54075c2fc96e8f688d402f3f1250" dependencies = [ "bstr", "git-features", @@ -1359,9 +1359,9 @@ dependencies = [ [[package]] name = "git-worktree" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3bc63878f134e08ed52dba5d82422798c01a3f2e48c38ae9a2f7ff9194f362" +checksum = "0c28b292694c98bba8225c39d4e86605843882ba7117ca98491841761e710547" dependencies = [ "bstr", "git-attributes", @@ -3423,33 +3423,18 @@ dependencies = [ "windows_x86_64_msvc 0.39.0", ] -[[package]] -name = "windows" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30acc718a52fb130fec72b1cb5f55ffeeec9253e1b785e94db222178a6acaa1" -dependencies = [ - "windows_aarch64_gnullvm 0.40.0", - "windows_aarch64_msvc 0.40.0", - "windows_i686_gnu 0.40.0", - "windows_i686_msvc 0.40.0", - "windows_x86_64_gnu 0.40.0", - "windows_x86_64_gnullvm 0.40.0", - "windows_x86_64_msvc 0.40.0", -] - [[package]] name = "windows" version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244" dependencies = [ - "windows_aarch64_gnullvm 0.42.0", + "windows_aarch64_gnullvm", "windows_aarch64_msvc 0.42.0", "windows_i686_gnu 0.42.0", "windows_i686_msvc 0.42.0", "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm 0.42.0", + "windows_x86_64_gnullvm", "windows_x86_64_msvc 0.42.0", ] @@ -3472,21 +3457,15 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm 0.42.0", + "windows_aarch64_gnullvm", "windows_aarch64_msvc 0.42.0", "windows_i686_gnu 0.42.0", "windows_i686_msvc 0.42.0", "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm 0.42.0", + "windows_x86_64_gnullvm", "windows_x86_64_msvc 0.42.0", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3caa4a1a16561b714323ca6b0817403738583033a6a92e04c5d10d4ba37ca10" - [[package]] name = "windows_aarch64_gnullvm" version = "0.42.0" @@ -3505,12 +3484,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" -[[package]] -name = "windows_aarch64_msvc" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328973c62dfcc50fb1aaa8e7100676e0b642fe56bac6bafff3327902db843ab4" - [[package]] name = "windows_aarch64_msvc" version = "0.42.0" @@ -3529,12 +3502,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" -[[package]] -name = "windows_i686_gnu" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa5b09fad70f0df85dea2ac2a525537e415e2bf63ee31cf9b8e263645ee9f3c1" - [[package]] name = "windows_i686_gnu" version = "0.42.0" @@ -3553,12 +3520,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" -[[package]] -name = "windows_i686_msvc" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1ad4031c1a98491fa195d8d43d7489cb749f135f2e5c4eed58da094bd0d876" - [[package]] name = "windows_i686_msvc" version = "0.42.0" @@ -3577,24 +3538,12 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" -[[package]] -name = "windows_x86_64_gnu" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520ff37edd72da8064b49d2281182898e17f0688ae9f4070bca27e4b5c162ac7" - [[package]] name = "windows_x86_64_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046e5b82215102c44fd75f488f1b9158973d02aa34d06ed85c23d6f5520a2853" - [[package]] name = "windows_x86_64_gnullvm" version = "0.42.0" @@ -3613,12 +3562,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" -[[package]] -name = "windows_x86_64_msvc" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0c9c6df55dd1bfa76e131cef44bdd8ec9c819ef3611f04dfe453fd5bfeda28" - [[package]] name = "windows_x86_64_msvc" version = "0.42.0" diff --git a/Cargo.toml b/Cargo.toml index d9258605d..b5ad015f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,9 +48,9 @@ clap_complete = "4.0.7" dirs-next = "2.0.0" dunce = "1.0.3" gethostname = "0.4.1" -git-features = { version = "0.26.0", optional = true } +git-features = { version = "0.26.1", optional = true } # default feature restriction addresses https://github.com/starship/starship/issues/4251 -git-repository = { version = "0.32.0", default-features = false, features = ["max-performance-safe"] } +git-repository = { version = "0.33.0", default-features = false, features = ["max-performance-safe"] } indexmap = { version = "1.9.2", features = ["serde"] } log = { version = "0.4.17", features = ["std"] } # nofity-rust is optional (on by default) because the crate doesn't currently build for darwin with nix From e88484d5674b7c038346ff1c89089e535d2e2d6d Mon Sep 17 00:00:00 2001 From: Andre Ribeiro <33375224+Andree37@users.noreply.github.com> Date: Tue, 10 Jan 2023 22:00:09 +0000 Subject: [PATCH 4/7] fix(nodejs): apply `style` even if node version is unavailable (#4713) * correct nodejs color * Update src/modules/nodejs.rs Co-authored-by: David Knaack * Update src/modules/nodejs.rs Co-authored-by: David Knaack * fix: removed unecessary unwraps * test: no node installed * test: no node installed Co-authored-by: David Knaack --- src/modules/nodejs.rs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/modules/nodejs.rs b/src/modules/nodejs.rs index 635cfb3f2..0a4e3c5be 100644 --- a/src/modules/nodejs.rs +++ b/src/modules/nodejs.rs @@ -45,7 +45,7 @@ pub fn module<'a>(context: &'a Context) -> Option> { "style" => { let engines_version = get_engines_version(context); let in_engines_range = - check_engines_version(nodejs_version.deref().as_ref()?, engines_version); + check_engines_version(nodejs_version.as_deref(), engines_version); if in_engines_range { Some(Ok(config.style)) } else { @@ -92,11 +92,12 @@ fn get_engines_version(context: &Context) -> Option { Some(raw_version.to_string()) } -fn check_engines_version(nodejs_version: &str, engines_version: Option) -> bool { - if engines_version.is_none() { - return true; - } - let r = match VersionReq::parse(&engines_version.unwrap()) { +fn check_engines_version(nodejs_version: Option<&str>, engines_version: Option) -> bool { + let (nodejs_version, engines_version) = match (nodejs_version, engines_version) { + (Some(nv), Some(ev)) => (nv, ev), + _ => return true, + }; + let r = match VersionReq::parse(&engines_version) { Ok(r) => r, Err(_e) => return true, }; @@ -270,4 +271,16 @@ mod tests { assert_eq!(expected, actual); dir.close() } + #[test] + fn no_node_installed() -> io::Result<()> { + let dir = tempfile::tempdir()?; + File::create(dir.path().join("index.js"))?.sync_all()?; + let actual = ModuleRenderer::new("nodejs") + .path(dir.path()) + .cmd("node --version", None) + .collect(); + let expected = Some(format!("via {}", Color::Green.bold().paint(" "))); + assert_eq!(expected, actual); + dir.close() + } } From 64e0208708736185d2e4a23d9c2b98684dd480b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=82=8F=E3=81=88=E3=82=82=E3=82=93?= Date: Wed, 11 Jan 2023 18:51:39 +0900 Subject: [PATCH 5/7] chore(aws): fix unintended test failure of `aws::missing_any_credentials` (#4805) chore(aws): fix unintended test failure of `aws::missing_any_credentials` Because its mocking is not enough, The test may unintentionally fail if `~/.aws/credentials` exists. This commit fixes this issue by mocking `credentials` file as well. --- src/modules/aws.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/aws.rs b/src/modules/aws.rs index 014f6b779..ec21408e3 100644 --- a/src/modules/aws.rs +++ b/src/modules/aws.rs @@ -802,10 +802,14 @@ aws_secret_access_key=dummy #[test] fn missing_any_credentials() -> io::Result<()> { let dir = tempfile::tempdir()?; - let config_path = dir.path().join("config"); - let mut file = File::create(&config_path)?; - file.write_all( + let credential_path = dir.path().join("credentials"); + File::create(&credential_path)?; + + let config_path = dir.path().join("config"); + let mut config_file = File::create(&config_path)?; + + config_file.write_all( "[default] region = us-east-1 output = json @@ -818,6 +822,10 @@ region = us-east-2 let actual = ModuleRenderer::new("aws") .env("AWS_CONFIG_FILE", config_path.to_string_lossy().as_ref()) + .env( + "AWS_CREDENTIALS_FILE", + credential_path.to_string_lossy().as_ref(), + ) .collect(); let expected = None; From bb549e665ebdb5b45256023e22be4330ba1a2a4c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 15:21:36 +0000 Subject: [PATCH 6/7] build(deps): update pest crates to 2.5.3 --- Cargo.lock | 31 +++++++++++++++++++++---------- Cargo.toml | 4 ++-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 40c7926b1..eb3dac628 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2093,9 +2093,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pest" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4" +checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a" dependencies = [ "thiserror", "ucd-trie", @@ -2103,9 +2103,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96504449aa860c8dcde14f9fba5c58dc6658688ca1fe363589d6327b8662c603" +checksum = "241cda393b0cdd65e62e07e12454f1f25d57017dcc514b1514cd3c4645e3a0a6" dependencies = [ "pest", "pest_generator", @@ -2113,9 +2113,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "798e0220d1111ae63d66cb66a5dcb3fc2d986d520b98e49e1852bfdb11d7c5e7" +checksum = "46b53634d8c8196302953c74d5352f33d0c512a9499bd2ce468fc9f4128fa27c" dependencies = [ "pest", "pest_meta", @@ -2126,13 +2126,13 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "984298b75898e30a843e278a9f2452c31e349a073a0ce6fd950a12a74464e065" +checksum = "0ef4f1332a8d4678b41966bb4cc1d0676880e84183a1ecc3f4b69f03e99c7a51" dependencies = [ "once_cell", "pest", - "sha1", + "sha2 0.10.6", ] [[package]] @@ -2690,6 +2690,17 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.6", +] + [[package]] name = "shadow-rs" version = "0.20.0" @@ -3002,7 +3013,7 @@ dependencies = [ "ordered-float", "regex", "semver 0.11.0", - "sha2", + "sha2 0.9.9", "signal-hook 0.1.17", "terminfo", "termios", diff --git a/Cargo.toml b/Cargo.toml index b5ad015f3..0d406c5ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,8 +62,8 @@ open = "3.2.0" # update os module config and tests when upgrading os_info os_info = "3.5.1" path-slash = "0.2.1" -pest = "2.5.2" -pest_derive = "2.5.2" +pest = "2.5.3" +pest_derive = "2.5.3" quick-xml = "0.27.1" rand = "0.8.5" rayon = "1.6.1" From 10433e31effb4040c47d02d565d1643bcf984fa6 Mon Sep 17 00:00:00 2001 From: Florent Vilmart <364568+flovilmart@users.noreply.github.com> Date: Wed, 11 Jan 2023 22:25:36 -0500 Subject: [PATCH 7/7] feat(config): Adds support for --profile (#3467) Co-authored-by: Kevin Song Co-authored-by: David Knaack --- .github/config-schema.json | 7 +++ src/configs/starship_root.rs | 3 + src/context.rs | 3 +- src/main.rs | 15 +++-- src/print.rs | 107 ++++++++++++++++++++++++++++++----- 5 files changed, 115 insertions(+), 20 deletions(-) diff --git a/.github/config-schema.json b/.github/config-schema.json index 702d57cb8..b23233787 100644 --- a/.github/config-schema.json +++ b/.github/config-schema.json @@ -1744,6 +1744,13 @@ "type": "string" } } + }, + "profiles": { + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } } }, "additionalProperties": false, diff --git a/src/configs/starship_root.rs b/src/configs/starship_root.rs index d857ae55f..3f29d0f6b 100644 --- a/src/configs/starship_root.rs +++ b/src/configs/starship_root.rs @@ -1,3 +1,4 @@ +use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -20,6 +21,7 @@ pub struct StarshipRootConfig { #[serde(skip_serializing_if = "Option::is_none")] pub palette: Option, pub palettes: HashMap, + pub profiles: IndexMap, } pub type Palette = HashMap; @@ -125,6 +127,7 @@ impl Default for StarshipRootConfig { format: "$all".to_string(), right_format: String::new(), continuation_prompt: "[∙](bright-black) ".to_string(), + profiles: Default::default(), scan_timeout: 30, command_timeout: 500, add_newline: true, diff --git a/src/context.rs b/src/context.rs index 702837647..0a20ea7c6 100644 --- a/src/context.rs +++ b/src/context.rs @@ -647,11 +647,12 @@ pub enum Shell { } /// Which kind of prompt target to print (main prompt, rprompt, ...) -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Target { Main, Right, Continuation, + Profile(String), } /// Properties as passed on from the shell as arguments diff --git a/src/main.rs b/src/main.rs index 92cbe8c17..17312f86c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,8 +85,11 @@ enum Commands { /// Print the right prompt (instead of the standard left prompt) #[clap(long)] right: bool, - /// Print the continuation prompt (instead of the standard left prompt) + /// Print the prompt with the specified profile name (instead of the standard left prompt) #[clap(long, conflicts_with = "right")] + profile: Option, + /// Print the continuation prompt (instead of the standard left prompt) + #[clap(long, conflicts_with = "right", conflicts_with = "profile")] continuation: bool, #[clap(flatten)] properties: Properties, @@ -172,12 +175,14 @@ fn main() { Commands::Prompt { properties, right, + profile, continuation, } => { - let target = match (right, continuation) { - (true, _) => Target::Right, - (_, true) => Target::Continuation, - (_, _) => Target::Main, + let target = match (right, profile, continuation) { + (true, _, _) => Target::Right, + (_, Some(profile_name), _) => Target::Profile(profile_name), + (_, _, true) => Target::Continuation, + (_, _, _) => Target::Main, }; print::prompt(properties, target) } diff --git a/src/print.rs b/src/print.rs index 5702cf4e0..6ff16d61d 100644 --- a/src/print.rs +++ b/src/print.rs @@ -11,6 +11,7 @@ use unicode_width::UnicodeWidthChar; use crate::configs::PROMPT_ORDER; use crate::context::{Context, Properties, Shell, Target}; +use crate::formatter::string_formatter::StringFormatterError; use crate::formatter::{StringFormatter, VariableHolder}; use crate::module::Module; use crate::module::ALL_MODULES; @@ -403,32 +404,42 @@ fn all_modules_uniq(module_list: &BTreeSet) -> Vec { /// and the list of all modules used in a format string fn load_formatter_and_modules<'a>(context: &'a Context) -> (StringFormatter<'a>, BTreeSet) { let config = &context.root_config; + let (formatter, config_param) = match &context.target { + Target::Main => (StringFormatter::new(&config.format), "format".to_string()), + Target::Right => ( + StringFormatter::new(&config.right_format), + "right_format".to_string(), + ), + Target::Continuation => ( + StringFormatter::new(&config.continuation_prompt), + "continuation_prompt".to_string(), + ), + Target::Profile(name) => ( + match config.profiles.get(name) { + Some(format) => StringFormatter::new(format), + _ => Err(StringFormatterError::Custom("Invalid Profile".to_string())), + }, + format!("profile: {}", &name), + ), + }; - let lformatter = StringFormatter::new(&config.format); let rformatter = StringFormatter::new(&config.right_format); - let cformatter = StringFormatter::new(&config.continuation_prompt); - if lformatter.is_err() { - log::error!("Error parsing `format`") + + if formatter.is_err() { + log::error!("Error parsing `{}`", config_param); } if rformatter.is_err() { log::error!("Error parsing `right_format`") } - if cformatter.is_err() { - log::error!("Error parsing `continuation_prompt`") - } - match (lformatter, rformatter, cformatter) { - (Ok(lf), Ok(rf), Ok(cf)) => { + match (formatter, rformatter) { + (Ok(lf), Ok(rf)) => { let mut modules: BTreeSet = BTreeSet::new(); if context.target != Target::Continuation { modules.extend(lf.get_variables()); modules.extend(rf.get_variables()); } - match context.target { - Target::Main => (lf, modules), - Target::Right => (rf, modules), - Target::Continuation => (cf, modules), - } + (lf, modules) } _ => (StringFormatter::raw(">"), BTreeSet::new()), } @@ -475,6 +486,26 @@ mod test { use crate::config::StarshipConfig; use crate::test::default_context; + #[test] + fn main_prompt() { + let mut context = default_context(); + context.config = StarshipConfig { + config: Some(toml::toml! { + add_newline=false + format="$character" + [character] + format=">\n>" + }), + }; + context.root_config.format = "$character".to_string(); + context.target = Target::Main; + context.root_config.add_newline = false; + + let expected = String::from(">\n>"); + let actual = get_prompt(context); + assert_eq!(expected, actual); + } + #[test] fn right_prompt() { let mut context = default_context(); @@ -493,6 +524,54 @@ mod test { assert_eq!(expected, actual); } + #[test] + fn custom_prompt() { + let mut context = default_context(); + context.config = StarshipConfig { + config: Some(toml::toml! { + add_newline = false + [profiles] + test="0_0$character" + [character] + format=">>" + }), + }; + context + .root_config + .profiles + .insert("test".to_string(), "0_0$character".to_string()); + context.target = Target::Profile("test".to_string()); + context.root_config.add_newline = false; + + let expected = String::from("0_0>>"); + let actual = get_prompt(context); + assert_eq!(expected, actual); + } + + #[test] + fn custom_prompt_fallback() { + let mut context = default_context(); + context.config = StarshipConfig { + config: Some(toml::toml! { + add_newline=false + [profiles] + test="0_0$character" + [character] + format=">>" + }), + }; + context + .root_config + .profiles + .insert("test".to_string(), "0_0$character".to_string()); + context.target = Target::Profile("wrong_prompt".to_string()); + context.root_config.add_newline = false; + + let expected = String::from(">"); + let actual = get_prompt(context); + assert_eq!(expected, actual); + } + #[test] fn continuation_prompt() { let mut context = default_context();