diff --git a/xtask/Cargo.lock b/xtask/Cargo.lock index d74a4076d3..5ced3553de 100644 --- a/xtask/Cargo.lock +++ b/xtask/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.0.1" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] @@ -28,58 +28,49 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" dependencies = [ "anstyle", "anstyle-parse", - "anstyle-query", "anstyle-wincon", - "colorchoice", + "concolor-override", + "concolor-query", "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.0" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" dependencies = [ "utf8parse", ] -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.45.0", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "ascii" @@ -101,9 +92,9 @@ checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bitflags" @@ -111,11 +102,20 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byteorder" @@ -125,9 +125,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "camino" @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" dependencies = [ "clap_builder", "clap_derive", @@ -198,9 +198,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" dependencies = [ "anstream", "anstyle", @@ -211,27 +211,31 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.17", + "syn 2.0.13", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] -name = "colorchoice" -version = "1.0.0" +name = "codespan-reporting" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] [[package]] name = "combine" @@ -246,17 +250,32 @@ dependencies = [ "unreachable", ] +[[package]] +name = "concolor-override" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" + +[[package]] +name = "concolor-query" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" +dependencies = [ + "windows-sys 0.45.0", +] + [[package]] name = "console" -version = "0.15.7" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.42.0", ] [[package]] @@ -275,6 +294,15 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -293,11 +321,65 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cxx" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.13", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.13", +] + [[package]] name = "dialoguer" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +checksum = "af3c796f3b0b408d9fd581611b47fa850821fcb84aa640b83a3c1a5be2d691f2" dependencies = [ "console", "shell-words", @@ -305,6 +387,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + [[package]] name = "either" version = "1.8.1" @@ -328,13 +420,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys 0.45.0", ] [[package]] @@ -358,21 +450,21 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" dependencies = [ "cfg-if", "libc", "redox_syscall 0.2.16", - "windows-sys 0.48.0", + "windows-sys 0.45.0", ] [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "miniz_oxide", @@ -386,10 +478,11 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ + "matches", "percent-encoding", ] @@ -441,6 +534,16 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -513,9 +616,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.19" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" dependencies = [ "bytes", "fnv", @@ -593,9 +696,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -617,9 +720,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", @@ -644,19 +747,21 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" dependencies = [ - "cc", + "cxx", + "cxx-build", ] [[package]] name = "idna" -version = "0.3.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ + "matches", "unicode-bidi", "unicode-normalization", ] @@ -671,6 +776,22 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "insta" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a28d25139df397cbca21408bb742cf6837e04cdbebf1b07b760caf971d6a972" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "pest", + "pest_derive", + "serde", + "similar", + "yaml-rust", +] + [[package]] name = "instant" version = "0.1.12" @@ -682,9 +803,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.11" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" dependencies = [ "hermit-abi 0.3.1", "libc", @@ -699,14 +820,14 @@ checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "256017f749ab3117e93acb91063009e1f1bb56d03965b14c2c8df4eb02c524d8" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.45.0", ] [[package]] @@ -726,9 +847,9 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -741,15 +862,30 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.141" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" + +[[package]] +name = "link-cplusplus" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" [[package]] name = "log" @@ -760,6 +896,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + [[package]] name = "memchr" version = "2.5.0" @@ -783,9 +925,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -854,9 +996,53 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pest" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.13", +] + +[[package]] +name = "pest_meta" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" +dependencies = [ + "once_cell", + "pest", + "sha2", +] [[package]] name = "pin-project-lite" @@ -878,18 +1064,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.28" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -955,9 +1141,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.3" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -966,17 +1152,17 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" dependencies = [ - "base64 0.21.2", + "base64 0.21.0", "bytes", "encoding_rs", "futures-core", @@ -1027,28 +1213,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.19" +version = "0.37.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.45.0", ] [[package]] name = "rustls" -version = "0.21.1" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", - "rustls-webpki", "sct", + "webpki", ] [[package]] @@ -1069,17 +1255,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.2", -] - -[[package]] -name = "rustls-webpki" -version = "0.100.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" -dependencies = [ - "ring", - "untrusted", + "base64 0.21.0", ] [[package]] @@ -1106,6 +1282,12 @@ dependencies = [ "windows-sys 0.42.0", ] +[[package]] +name = "scratch" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" + [[package]] name = "sct" version = "0.7.0" @@ -1118,9 +1300,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags", "core-foundation", @@ -1131,9 +1313,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -1150,29 +1332,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.163" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ "proc-macro2", "quote", - "syn 2.0.17", + "syn 2.0.13", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" dependencies = [ "itoa", "ryu", @@ -1197,12 +1379,29 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shell-words" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + [[package]] name = "slab" version = "0.4.8" @@ -1247,9 +1446,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.17" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45b6ddbb36c5b969c182aec3c4a0bce7df3fbad4b77114706a49aacc80567388" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" dependencies = [ "proc-macro2", "quote", @@ -1286,6 +1485,15 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.40" @@ -1303,7 +1511,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.17", + "syn 2.0.13", ] [[package]] @@ -1333,9 +1541,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.1" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg", "bytes", @@ -1344,24 +1552,25 @@ dependencies = [ "num_cpus", "pin-project-lite", "socket2", - "windows-sys 0.48.0", + "windows-sys 0.45.0", ] [[package]] name = "tokio-rustls" -version = "0.24.0" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls", "tokio", + "webpki", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", @@ -1390,9 +1599,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", ] @@ -1403,6 +1612,18 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + [[package]] name = "unicode-bidi" version = "0.3.13" @@ -1411,9 +1632,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-normalization" @@ -1447,9 +1668,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" dependencies = [ "form_urlencoded", "idna", @@ -1462,6 +1683,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + [[package]] name = "void" version = "1.0.2" @@ -1502,9 +1729,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1512,24 +1739,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.17", + "syn 1.0.109", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.36" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -1539,9 +1766,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1549,28 +1776,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.17", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -1825,6 +2052,7 @@ dependencies = [ "dialoguer", "flate2", "graphql_client", + "insta", "itertools", "libc", "memorable-wordlist", @@ -1845,6 +2073,15 @@ dependencies = [ "zip", ] +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -1853,9 +2090,9 @@ checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" [[package]] name = "zip" -version = "0.6.6" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "0445d0fbc924bb93539b4316c11afb121ea39296f99a3c4c9edad09e3658cdef" dependencies = [ "byteorder", "crc32fast", diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index b6cce1399d..0d94015cfc 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -44,3 +44,6 @@ tokio = "1.25.0" which = "4" zip = { version = "0.6", default-features = false } walkdir = "2.3.2" + +[dev-dependencies] +insta = { version = "1.26.0", features = ["json", "redactions", "yaml"] } diff --git a/xtask/src/commands/changeset/mod.rs b/xtask/src/commands/changeset/mod.rs index 4b4aa57848..005e2ea446 100644 --- a/xtask/src/commands/changeset/mod.rs +++ b/xtask/src/commands/changeset/mod.rs @@ -66,15 +66,29 @@ struct TemplateContext { const REPO_WITH_OWNER: &'static str = "apollographql/router"; -const EXAMPLE_TEMPLATE: &'static str = "### {title} {{ for issue in issues -}} -([Issue #{issue.number}]({issue.url})){{ if not @last }}, {{ endif }} -{{- endfor }} +const EXAMPLE_TEMPLATE: &'static str = "### { title } +{{- if issues -}} + {{- if issues }} {{ endif -}} + {{- for issue in issues -}} + ([Issue #{issue.number}]({issue.url})) + {{- if not @last }}, {{ endif -}} + {{- endfor -}} +{{ else -}} + {{- if pulls -}} + {{- if pulls }} {{ endif -}} + {{- for pull in pulls -}} + ([PR #{pull.number}]({pull.url})) + {{- if not @last }}, {{ endif -}} + {{- endfor -}} + {{- else -}} + {{- endif -}} +{{- endif }} {body} -By [@{author}](https://github.com/{author}) in {{ for pull in pulls -}} +By [@{author}](https://github.com/{author}){{ if pulls }} in {{ for pull in pulls -}} {pull.url}{{ if not @last }}, {{ endif }} -{{- endfor }} +{{- endfor }}{{ endif }} "; impl Command { @@ -610,3 +624,218 @@ impl TryFrom<&DirEntry> for Changeset { }) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_templatizes_with_multiple_issues_in_title_and_multiple_prs_in_footer() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![ + TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER1", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER1"), + }, + TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER2", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER2"), + }, + ], + pulls: vec![ + TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER1", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER1"), + }, + TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER2", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER2"), + }, + ], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_with_multiple_prs_in_footer() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER"), + }], + pulls: vec![ + TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER1", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER1"), + }, + TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER2", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER2"), + }, + ], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_with_multiple_issues_in_title() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![ + TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER1", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER1"), + }, + TemplateResource { + url: format!( + "https://github.com/{}/issues/ISSUE_NUMBER2", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER2"), + }, + ], + pulls: vec![TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER"), + }], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_with_prs_in_title_when_empty_issues() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![], + pulls: vec![TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER"), + }], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_without_prs_in_title_when_issues_present() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![TemplateResource { + url: format!( + "https://github.com/{}/pull/ISSUE_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("ISSUE_NUMBER"), + }], + pulls: vec![TemplateResource { + url: format!( + "https://github.com/{}/pull/PULL_NUMBER", + String::from("REPO_WITH_OWNER") + ), + number: String::from("PULL_NUMBER"), + }], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } + + #[test] + fn it_templatizes_with_neither_issues_or_prs() { + let test_context = TemplateContext { + title: String::from("TITLE"), + issues: vec![], + pulls: vec![], + author: String::from("AUTHOR"), + body: String::from("BODY"), + }; + + let mut tt = TinyTemplate::new(); + tt.add_template("message", EXAMPLE_TEMPLATE).unwrap(); + tt.set_default_formatter(&format_unescaped); + let rendered_template = tt + .render("message", &test_context) + .unwrap() + .replace('\r', ""); + insta::assert_snapshot!(rendered_template); + } +} diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title.snap new file mode 100644 index 0000000000..da70c69e35 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Issue #ISSUE_NUMBER1](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER1)), ([Issue #ISSUE_NUMBER2](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER2)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title_and_multiple_prs_in_footer.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title_and_multiple_prs_in_footer.snap new file mode 100644 index 0000000000..eebeb051aa --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_issues_in_title_and_multiple_prs_in_footer.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Issue #ISSUE_NUMBER1](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER1)), ([Issue #ISSUE_NUMBER2](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER2)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER1, https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER2 + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_prs_in_footer.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_prs_in_footer.snap new file mode 100644 index 0000000000..03483bda37 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_multiple_prs_in_footer.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Issue #ISSUE_NUMBER](https://github.com/REPO_WITH_OWNER/issues/ISSUE_NUMBER)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER1, https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER2 + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_neither_issues_or_prs.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_neither_issues_or_prs.snap new file mode 100644 index 0000000000..11751d066f --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_neither_issues_or_prs.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_in_title_when_empty_issues.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_in_title_when_empty_issues.snap new file mode 100644 index 0000000000..c9c293d684 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_in_title_when_empty_issues.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([PR #PULL_NUMBER](https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_when_empty_issues.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_when_empty_issues.snap new file mode 100644 index 0000000000..e0f310c4ae --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_with_prs_when_empty_issues.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Pull #PULL_NUMBER](https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER + diff --git a/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_without_prs_in_title_when_issues_present.snap b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_without_prs_in_title_when_issues_present.snap new file mode 100644 index 0000000000..06e4c08b51 --- /dev/null +++ b/xtask/src/commands/changeset/snapshots/xtask__commands__changeset__tests__it_templatizes_without_prs_in_title_when_issues_present.snap @@ -0,0 +1,10 @@ +--- +source: src/commands/changeset/mod.rs +expression: rendered_template +--- +### TITLE ([Issue #ISSUE_NUMBER](https://github.com/REPO_WITH_OWNER/pull/ISSUE_NUMBER)) + +BODY + +By [@AUTHOR](https://github.com/AUTHOR) in https://github.com/REPO_WITH_OWNER/pull/PULL_NUMBER +