1
1
mirror of https://github.com/casey/just.git synced 2024-11-22 10:26:26 +03:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Sibi Prabakaran
6c66f35c4e
Merge 6fc9e54577 into beb275ac30 2024-11-21 09:03:00 +05:30
Casey Rodarmor
beb275ac30
Release 1.37.0 (#2474)
* Release 1.37.0

- Bump version: 1.36.0 → 1.37.0
- Update changelog
- Update changelog contributor credits
- Update dependencies
- Update version references in readme
- Update zsh completion replacements
2024-11-20 22:04:51 +00:00
Sibi Prabakaran
6fc9e54577
Fix remaining failing tests 2024-11-18 08:53:55 +05:30
Sibi Prabakaran
3593976837
Use canonicalize to resolve macos failures 2024-11-18 08:50:28 +05:30
Sibi Prabakaran
1676f0b901
Remove duplicate test 2024-11-17 22:41:31 +05:30
Sibi Prabakaran
516fac504c
Add source information as path of the information
Motivation: To add support for module integration in justl which is an
Emacs extension for driving justfiles within Emacs.

This would allow me to easily discover the file locations of different
just modules and allow the ability to individually open justl buffers
for them within the editor.
2024-11-17 22:29:06 +05:30
9 changed files with 1219 additions and 1068 deletions

View File

@ -1,6 +1,47 @@
Changelog Changelog
========= =========
[1.37.0](https://github.com/casey/just/releases/tag/1.37.0) - 2024-11-20
------------------------------------------------------------------------
### Added
- Add `style()` function ([#2462](https://github.com/casey/just/pull/2462) by [casey](https://github.com/casey))
- Terminal escape sequence constants ([#2461](https://github.com/casey/just/pull/2461) by [casey](https://github.com/casey))
- Add `&&` and `||` operators ([#2444](https://github.com/casey/just/pull/2444) by [casey](https://github.com/casey))
### Changed
- Make recipe doc attribute override comment ([#2470](https://github.com/casey/just/pull/2470) by [casey](https://github.com/casey))
- Don't export constants ([#2449](https://github.com/casey/just/pull/2449) by [casey](https://github.com/casey))
- Allow duplicate imports ([#2437](https://github.com/casey/just/pull/2437) by [casey](https://github.com/casey))
- Publish single SHA256SUM file with releases ([#2417](https://github.com/casey/just/pull/2417) by [casey](https://github.com/casey))
- Mark recipes with private attribute as private in JSON dump ([#2415](https://github.com/casey/just/pull/2415) by [casey](https://github.com/casey))
- Forbid invalid attributes on assignments ([#2412](https://github.com/casey/just/pull/2412) by [casey](https://github.com/casey))
### Misc
- Update `softprops/action-gh-release` ([#2471](https://github.com/casey/just/pull/2471) by [app/dependabot](https://github.com/app/dependabot))
- Add `-g` to `rust-just` install instructions ([#2459](https://github.com/casey/just/pull/2459) by [gnpaone](https://github.com/gnpaone))
- Change doc backtick color to cyan ([#2469](https://github.com/casey/just/pull/2469) by [casey](https://github.com/casey))
- Note that `set shell` is not used for `[script]` recipes ([#2468](https://github.com/casey/just/pull/2468) by [iloveitaly](https://github.com/iloveitaly))
- Replace `derivative` with `derive-where` ([#2465](https://github.com/casey/just/pull/2465) by [laniakea64](https://github.com/laniakea64))
- Highlight backticks in docs when listing recipes ([#2423](https://github.com/casey/just/pull/2423) by [neunenak](https://github.com/neunenak))
- Update setup-just version in README ([#2456](https://github.com/casey/just/pull/2456) by [Julian](https://github.com/Julian))
- Fix shell function example in readme ([#2454](https://github.com/casey/just/pull/2454) by [casey](https://github.com/casey))
- Update softprops/action-gh-release ([#2450](https://github.com/casey/just/pull/2450) by [app/dependabot](https://github.com/app/dependabot))
- Use `justfile` instead of `mf` on invalid examples in readme ([#2447](https://github.com/casey/just/pull/2447) by [casey](https://github.com/casey))
- Add advice on printing complex strings ([#2446](https://github.com/casey/just/pull/2446) by [casey](https://github.com/casey))
- Document using functions in variable assignments ([#2431](https://github.com/casey/just/pull/2431) by [offby1](https://github.com/offby1))
- Use prettier string comparison in tests ([#2435](https://github.com/casey/just/pull/2435) by [neunenak](https://github.com/neunenak))
- Note `shell(…)` as an alternative to backticks ([#2430](https://github.com/casey/just/pull/2430) by [offby1](https://github.com/offby1))
- Update nix package links ([#2441](https://github.com/casey/just/pull/2441) by [yunusey](https://github.com/yunusey))
- Update README.中文.md ([#2424](https://github.com/casey/just/pull/2424) by [Jannchie](https://github.com/Jannchie))
- Add Recipe::subsequents ([#2428](https://github.com/casey/just/pull/2428) by [casey](https://github.com/casey))
- Add subsequents to grammar ([#2427](https://github.com/casey/just/pull/2427) by [casey](https://github.com/casey))
- Document checking releases hashes ([#2418](https://github.com/casey/just/pull/2418) by [casey](https://github.com/casey))
- Show how to access positional arguments with powershell ([#2405](https://github.com/casey/just/pull/2405) by [casey](https://github.com/casey))
- Use `-CommandWithArgs` instead of `-cwa` ([#2404](https://github.com/casey/just/pull/2404) by [casey](https://github.com/casey))
- Document `-cwa` flag for PowerShell positional arguments ([#2403](https://github.com/casey/just/pull/2403) by [casey](https://github.com/casey))
- Use `unwrap_or` when creating relative path in loader ([#2400](https://github.com/casey/just/pull/2400) by [casey](https://github.com/casey))
[1.36.0](https://github.com/casey/just/releases/tag/1.36.0) - 2024-09-30 [1.36.0](https://github.com/casey/just/releases/tag/1.36.0) - 2024-09-30
------------------------------------------------------------------------ ------------------------------------------------------------------------

184
Cargo.lock generated
View File

@ -37,9 +37,9 @@ dependencies = [
[[package]] [[package]]
name = "anstream" name = "anstream"
version = "0.6.15" version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"anstyle-parse", "anstyle-parse",
@ -52,36 +52,36 @@ dependencies = [
[[package]] [[package]]
name = "anstyle" name = "anstyle"
version = "1.0.8" version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]] [[package]]
name = "anstyle-parse" name = "anstyle-parse"
version = "0.2.5" version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
dependencies = [ dependencies = [
"utf8parse", "utf8parse",
] ]
[[package]] [[package]]
name = "anstyle-query" name = "anstyle-query"
version = "1.1.1" version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
dependencies = [ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
name = "anstyle-wincon" name = "anstyle-wincon"
version = "3.0.4" version = "3.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"windows-sys 0.52.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
@ -134,9 +134,9 @@ dependencies = [
[[package]] [[package]]
name = "bstr" name = "bstr"
version = "1.10.0" version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22"
dependencies = [ dependencies = [
"memchr", "memchr",
"regex-automata", "regex-automata",
@ -163,9 +163,9 @@ checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.1.23" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bbb537bb4a30b90362caddba8f360c0a56bc13d3a5570028e7197204cb54a17" checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47"
dependencies = [ dependencies = [
"shlex", "shlex",
] ]
@ -198,9 +198,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.18" version = "4.5.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -208,9 +208,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.18" version = "4.5.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -221,9 +221,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_complete" name = "clap_complete"
version = "4.5.29" version = "4.5.38"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e" checksum = "d9647a559c112175f17cf724dc72d3645680a883c58481332779192b0d8e7a01"
dependencies = [ dependencies = [
"clap", "clap",
] ]
@ -242,15 +242,15 @@ dependencies = [
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7"
[[package]] [[package]]
name = "clap_mangen" name = "clap_mangen"
version = "0.2.23" version = "0.2.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17415fd4dfbea46e3274fcd8d368284519b358654772afb700dc2e8d2b24eeb" checksum = "fbae9cbfdc5d4fa8711c09bd7b83f644cb48281ac35bf97af3e47b0675864bdf"
dependencies = [ dependencies = [
"clap", "clap",
"roff", "roff",
@ -258,9 +258,9 @@ dependencies = [
[[package]] [[package]]
name = "colorchoice" name = "colorchoice"
version = "1.0.2" version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]] [[package]]
name = "constant_time_eq" name = "constant_time_eq"
@ -276,9 +276,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]] [[package]]
name = "cpufeatures" name = "cpufeatures"
version = "0.2.14" version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@ -412,9 +412,9 @@ checksum = "3ebc5a6d89e3c90b84e8f33c8737933dda8f1c106b5415900b38b9d433841478"
[[package]] [[package]]
name = "fastrand" name = "fastrand"
version = "2.1.1" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4"
[[package]] [[package]]
name = "generate-book" name = "generate-book"
@ -506,22 +506,22 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "1.0.11" version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2"
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.70" version = "0.3.72"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9"
dependencies = [ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]] [[package]]
name = "just" name = "just"
version = "1.36.0" version = "1.37.0"
dependencies = [ dependencies = [
"ansi_term", "ansi_term",
"blake3", "blake3",
@ -570,9 +570,9 @@ checksum = "441225017b106b9f902e97947a6d31e44ebcf274b91bdbfb51e5c477fcd468e5"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.159" version = "0.2.164"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f"
[[package]] [[package]]
name = "libredox" name = "libredox"
@ -644,12 +644,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.20.1" version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
dependencies = [
"portable-atomic",
]
[[package]] [[package]]
name = "option-ext" name = "option-ext"
@ -663,12 +660,6 @@ version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "portable-atomic"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2"
[[package]] [[package]]
name = "ppv-lite86" name = "ppv-lite86"
version = "0.2.20" version = "0.2.20"
@ -690,9 +681,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.86" version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -780,9 +771,9 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.11.0" version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -792,9 +783,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.4.8" version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -815,9 +806,9 @@ checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3"
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.37" version = "0.38.41"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"errno", "errno",
@ -828,9 +819,9 @@ dependencies = [
[[package]] [[package]]
name = "rustversion" name = "rustversion"
version = "1.0.17" version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248"
[[package]] [[package]]
name = "ryu" name = "ryu"
@ -846,18 +837,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.210" version = "1.0.215"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.210" version = "1.0.215"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -866,9 +857,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.128" version = "1.0.133"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@ -963,9 +954,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.79" version = "2.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -980,9 +971,9 @@ checksum = "1e8f05f774b2db35bdad5a8237a90be1102669f8ea013fea9777b366d34ab145"
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.13.0" version = "3.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"fastrand", "fastrand",
@ -1002,28 +993,28 @@ dependencies = [
[[package]] [[package]]
name = "terminal_size" name = "terminal_size"
version = "0.3.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef"
dependencies = [ dependencies = [
"rustix", "rustix",
"windows-sys 0.48.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.64" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.64" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1044,18 +1035,15 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
[[package]] [[package]]
name = "unicase" name = "unicase"
version = "2.7.0" version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df"
dependencies = [
"version_check",
]
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.13" version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]] [[package]]
name = "unicode-segmentation" name = "unicode-segmentation"
@ -1090,9 +1078,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]] [[package]]
name = "uuid" name = "uuid"
version = "1.10.0" version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a"
dependencies = [ dependencies = [
"getrandom", "getrandom",
] ]
@ -1111,9 +1099,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.93" version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
@ -1122,9 +1110,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.93" version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
@ -1137,9 +1125,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.93" version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@ -1147,9 +1135,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.93" version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1160,15 +1148,15 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.93" version = "0.2.95"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d"
[[package]] [[package]]
name = "which" name = "which"
version = "6.0.3" version = "7.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" checksum = "c9cad3279ade7346b96e38731a641d7343dd6a53d55083dd54eadfa5a1b38c6b"
dependencies = [ dependencies = [
"either", "either",
"home", "home",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "just" name = "just"
version = "1.36.0" version = "1.37.0"
authors = ["Casey Rodarmor <casey@rodarmor.com>"] authors = ["Casey Rodarmor <casey@rodarmor.com>"]
autotests = false autotests = false
categories = ["command-line-utilities", "development-tools"] categories = ["command-line-utilities", "development-tools"]
@ -56,7 +56,7 @@ uuid = { version = "1.0.0", features = ["v4"] }
executable-path = "1.0.0" executable-path = "1.0.0"
pretty_assertions = "1.0.0" pretty_assertions = "1.0.0"
temptree = "0.2.0" temptree = "0.2.0"
which = "6.0.0" which = "7.0.0"
[lints.rust] [lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }

View File

@ -1324,7 +1324,7 @@ foobar := 'foo' + 'bar'
#### Logical Operators #### Logical Operators
The logical operators `&&` and `||` can be used to coalesce string The logical operators `&&` and `||` can be used to coalesce string
values<sup>master</sup>, similar to Python's `and` and `or`. These operators values<sup>1.37.0</sup>, similar to Python's `and` and `or`. These operators
consider the empty string `''` to be false, and all other strings to be true. consider the empty string `''` to be false, and all other strings to be true.
These operators are currently unstable. These operators are currently unstable.
@ -1853,7 +1853,7 @@ for details.
#### Style #### Style
- `style(name)`<sup>master</sup> - Return a named terminal display attribute - `style(name)`<sup>1.37.0</sup> - Return a named terminal display attribute
escape sequence used by `just`. Unlike terminal display attribute escape escape sequence used by `just`. Unlike terminal display attribute escape
sequence constants, which contain standard colors and styles, `style(name)` sequence constants, which contain standard colors and styles, `style(name)`
returns an escape sequence used by `just` itself, and can be used to make returns an escape sequence used by `just` itself, and can be used to make
@ -1895,30 +1895,30 @@ A number of constants are predefined:
| `HEX`<sup>1.27.0</sup> | `"0123456789abcdef"` | | `HEX`<sup>1.27.0</sup> | `"0123456789abcdef"` |
| `HEXLOWER`<sup>1.27.0</sup> | `"0123456789abcdef"` | | `HEXLOWER`<sup>1.27.0</sup> | `"0123456789abcdef"` |
| `HEXUPPER`<sup>1.27.0</sup> | `"0123456789ABCDEF"` | | `HEXUPPER`<sup>1.27.0</sup> | `"0123456789ABCDEF"` |
| `CLEAR`<sup>master</sup> | `"\ec"` | | `CLEAR`<sup>1.37.0</sup> | `"\ec"` |
| `NORMAL`<sup>master</sup> | `"\e[0m"` | | `NORMAL`<sup>1.37.0</sup> | `"\e[0m"` |
| `BOLD`<sup>master</sup> | `"\e[1m"` | | `BOLD`<sup>1.37.0</sup> | `"\e[1m"` |
| `ITALIC`<sup>master</sup> | `"\e[3m"` | | `ITALIC`<sup>1.37.0</sup> | `"\e[3m"` |
| `UNDERLINE`<sup>master</sup> | `"\e[4m"` | | `UNDERLINE`<sup>1.37.0</sup> | `"\e[4m"` |
| `INVERT`<sup>master</sup> | `"\e[7m"` | | `INVERT`<sup>1.37.0</sup> | `"\e[7m"` |
| `HIDE`<sup>master</sup> | `"\e[8m"` | | `HIDE`<sup>1.37.0</sup> | `"\e[8m"` |
| `STRIKETHROUGH`<sup>master</sup> | `"\e[9m"` | | `STRIKETHROUGH`<sup>1.37.0</sup> | `"\e[9m"` |
| `BLACK`<sup>master</sup> | `"\e[30m"` | | `BLACK`<sup>1.37.0</sup> | `"\e[30m"` |
| `RED`<sup>master</sup> | `"\e[31m"` | | `RED`<sup>1.37.0</sup> | `"\e[31m"` |
| `GREEN`<sup>master</sup> | `"\e[32m"` | | `GREEN`<sup>1.37.0</sup> | `"\e[32m"` |
| `YELLOW`<sup>master</sup> | `"\e[33m"` | | `YELLOW`<sup>1.37.0</sup> | `"\e[33m"` |
| `BLUE`<sup>master</sup> | `"\e[34m"` | | `BLUE`<sup>1.37.0</sup> | `"\e[34m"` |
| `MAGENTA`<sup>master</sup> | `"\e[35m"` | | `MAGENTA`<sup>1.37.0</sup> | `"\e[35m"` |
| `CYAN`<sup>master</sup> | `"\e[36m"` | | `CYAN`<sup>1.37.0</sup> | `"\e[36m"` |
| `WHITE`<sup>master</sup> | `"\e[37m"` | | `WHITE`<sup>1.37.0</sup> | `"\e[37m"` |
| `BG_BLACK`<sup>master</sup> | `"\e[40m"` | | `BG_BLACK`<sup>1.37.0</sup> | `"\e[40m"` |
| `BG_RED`<sup>master</sup> | `"\e[41m"` | | `BG_RED`<sup>1.37.0</sup> | `"\e[41m"` |
| `BG_GREEN`<sup>master</sup> | `"\e[42m"` | | `BG_GREEN`<sup>1.37.0</sup> | `"\e[42m"` |
| `BG_YELLOW`<sup>master</sup> | `"\e[43m"` | | `BG_YELLOW`<sup>1.37.0</sup> | `"\e[43m"` |
| `BG_BLUE`<sup>master</sup> | `"\e[44m"` | | `BG_BLUE`<sup>1.37.0</sup> | `"\e[44m"` |
| `BG_MAGENTA`<sup>master</sup> | `"\e[45m"` | | `BG_MAGENTA`<sup>1.37.0</sup> | `"\e[45m"` |
| `BG_CYAN`<sup>master</sup> | `"\e[46m"` | | `BG_CYAN`<sup>1.37.0</sup> | `"\e[46m"` |
| `BG_WHITE`<sup>master</sup> | `"\e[47m"` | | `BG_WHITE`<sup>1.37.0</sup> | `"\e[47m"` |
```just ```just
@foo: @foo:
@ -3421,7 +3421,7 @@ Imports may be made optional by putting a `?` after the `import` keyword:
import? 'foo/bar.just' import? 'foo/bar.just'
``` ```
Importing the same source file multiple times is not an error<sup>master</sup>. Importing the same source file multiple times is not an error<sup>1.37.0</sup>.
This allows importing multiple justfiles, for example `foo.just` and This allows importing multiple justfiles, for example `foo.just` and
`bar.just`, which both import a third justfile containing shared recipes, for `bar.just`, which both import a third justfile containing shared recipes, for
example `baz.just`, without the duplicate import of `baz.just` being an error: example `baz.just`, without the duplicate import of `baz.just` being an error:

View File

@ -182,6 +182,7 @@ impl<'run, 'src> Analyzer<'run, 'src> {
unstable_features.insert(UnstableFeature::ScriptInterpreterSetting); unstable_features.insert(UnstableFeature::ScriptInterpreterSetting);
} }
let source = root.canonicalize().unwrap();
let root = paths.get(root).unwrap(); let root = paths.get(root).unwrap();
Ok(Justfile { Ok(Justfile {
@ -205,7 +206,7 @@ impl<'run, 'src> Analyzer<'run, 'src> {
name, name,
recipes, recipes,
settings, settings,
source: root.into(), source,
unexports: self.unexports, unexports: self.unexports,
unstable_features, unstable_features,
warnings: self.warnings, warnings: self.warnings,

View File

@ -141,18 +141,18 @@ const ZSH_COMPLETION_REPLACEMENTS: &[(&str, &str)] = &[
r" local common=(", r" local common=(",
), ),
( (
r"'*--set=[Override <VARIABLE> with <VALUE>]:VARIABLE: :VARIABLE: ' \", r"'*--set=[Override <VARIABLE> with <VALUE>]:VARIABLE:_default:VARIABLE:_default' \",
r"'*--set=[Override <VARIABLE> with <VALUE>]: :(_just_variables)' \", r"'*--set=[Override <VARIABLE> with <VALUE>]: :(_just_variables)' \",
), ),
( (
r"'()-s+[Show recipe at <PATH>]:PATH: ' \ r"'()-s+[Show recipe at <PATH>]:PATH:_default' \
'()--show=[Show recipe at <PATH>]:PATH: ' \", '()--show=[Show recipe at <PATH>]:PATH:_default' \",
r"'-s+[Show recipe at <PATH>]: :(_just_commands)' \ r"'-s+[Show recipe at <PATH>]: :(_just_commands)' \
'--show=[Show recipe at <PATH>]: :(_just_commands)' \", '--show=[Show recipe at <PATH>]: :(_just_commands)' \",
), ),
( (
"'*::ARGUMENTS -- Overrides and recipe(s) to run, defaulting to the first recipe in the \ "'*::ARGUMENTS -- Overrides and recipe(s) to run, defaulting to the first recipe in the \
justfile:' \\ justfile:_default' \\
&& ret=0", && ret=0",
r#") r#")

View File

@ -23,7 +23,6 @@ pub(crate) struct Justfile<'src> {
pub(crate) name: Option<Name<'src>>, pub(crate) name: Option<Name<'src>>,
pub(crate) recipes: Table<'src, Rc<Recipe<'src>>>, pub(crate) recipes: Table<'src, Rc<Recipe<'src>>>,
pub(crate) settings: Settings<'src>, pub(crate) settings: Settings<'src>,
#[serde(skip)]
pub(crate) source: PathBuf, pub(crate) source: PathBuf,
pub(crate) unexports: HashSet<String>, pub(crate) unexports: HashSet<String>,
#[serde(skip)] #[serde(skip)]

View File

@ -1,22 +1,37 @@
use super::*; use super::*;
fn case(justfile: &str, value: Value) { fn case<F: Fn(&Path) -> Value>(justfile: &str, value: F) {
Test::new() Test::new()
.justfile(justfile) .justfile(justfile)
.args(["--dump", "--dump-format", "json"]) .args(["--dump", "--dump-format", "json"])
.stdout(format!("{}\n", serde_json::to_string(&value).unwrap())) .stdout_with_tempdir(|dir| {
format!(
"{}\n",
serde_json::to_string(&value(&dir.path().canonicalize().unwrap())).unwrap()
)
})
.run(); .run();
} }
#[test] #[test]
fn alias() { fn alias() {
case( let test = Test::new().justfile(
" "
alias f := foo alias f := foo
foo: foo:
", ",
json!({ );
let source = test
.tempdir
.path()
.canonicalize()
.unwrap()
.join("justfile")
.to_str()
.unwrap()
.to_owned();
let json = json!({
"first": "foo", "first": "foo",
"doc": null, "doc": null,
"aliases": { "aliases": {
@ -66,14 +81,18 @@ fn alias() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
); });
test
.args(["--dump", "--dump-format", "json"])
.stdout(format!("{}\n", serde_json::to_string(&json).unwrap()))
.run();
} }
#[test] #[test]
fn assignment() { fn assignment() {
case( case("foo := 'bar'", |dir| {
"foo := 'bar'", let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": { "assignments": {
@ -110,8 +129,9 @@ fn assignment() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
); })
});
} }
#[test] #[test]
@ -122,6 +142,8 @@ fn private_assignment() {
[private] [private]
bar := 'bar' bar := 'bar'
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": { "assignments": {
@ -164,7 +186,9 @@ fn private_assignment() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -176,6 +200,8 @@ fn body() {
bar bar
abc{{ 'xyz' }}def abc{{ 'xyz' }}def
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -222,7 +248,9 @@ fn body() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -233,6 +261,8 @@ fn dependencies() {
foo: foo:
bar: foo bar: foo
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -292,7 +322,9 @@ fn dependencies() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -316,6 +348,8 @@ fn dependency_argument() {
replace('a', 'b', 'c') replace('a', 'b', 'c')
) )
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"first": "foo", "first": "foo",
@ -400,7 +434,9 @@ fn dependency_argument() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -414,6 +450,8 @@ fn duplicate_recipes() {
foo: foo:
foo bar: foo bar:
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"first": "foo", "first": "foo",
"doc": null, "doc": null,
@ -470,7 +508,9 @@ fn duplicate_recipes() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -482,6 +522,8 @@ fn duplicate_variables() {
x := 'foo' x := 'foo'
x := 'bar' x := 'bar'
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": { "assignments": {
@ -518,14 +560,16 @@ fn duplicate_variables() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
#[test] #[test]
fn doc_comment() { fn doc_comment() {
case( case("# hello\nfoo:", |dir| {
"# hello\nfoo:", let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"first": "foo", "first": "foo",
@ -569,14 +613,15 @@ fn doc_comment() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
); })
});
} }
#[test] #[test]
fn empty_justfile() { fn empty_justfile() {
case( case("", |dir| {
"", let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -606,8 +651,9 @@ fn empty_justfile() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
); })
});
} }
#[test] #[test]
@ -621,6 +667,8 @@ fn parameters() {
e *x: e *x:
f $x: f $x:
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"first": "a", "first": "a",
@ -764,7 +812,9 @@ fn parameters() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -776,6 +826,8 @@ fn priors() {
b: a && c b: a && c
c: c:
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -855,14 +907,16 @@ fn priors() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
#[test] #[test]
fn private() { fn private() {
case( case("_foo:", |dir| {
"_foo:", let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -906,14 +960,15 @@ fn private() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
); })
});
} }
#[test] #[test]
fn quiet() { fn quiet() {
case( case("@foo:", |dir| {
"@foo:", let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -957,8 +1012,9 @@ fn quiet() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
); })
});
} }
#[test] #[test]
@ -977,6 +1033,8 @@ fn settings() {
foo: foo:
#!bar #!bar
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -1023,7 +1081,9 @@ fn settings() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -1034,6 +1094,8 @@ fn shebang() {
foo: foo:
#!bar #!bar
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -1077,14 +1139,16 @@ fn shebang() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
#[test] #[test]
fn simple() { fn simple() {
case( case("foo:", |dir| {
"foo:", let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -1128,8 +1192,9 @@ fn simple() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
); })
});
} }
#[test] #[test]
@ -1139,6 +1204,8 @@ fn attribute() {
[no-exit-message] [no-exit-message]
foo: foo:
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -1182,7 +1249,9 @@ fn attribute() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -1199,7 +1268,24 @@ fn module() {
"foo.just": "bar:", "foo.just": "bar:",
}) })
.args(["--dump", "--dump-format", "json"]) .args(["--dump", "--dump-format", "json"])
.stdout(format!( .stdout_with_tempdir(|dir| {
let source = dir
.path()
.canonicalize()
.unwrap()
.join("justfile")
.to_str()
.unwrap()
.to_owned();
let foo_just = dir
.path()
.canonicalize()
.unwrap()
.join("foo.just")
.to_str()
.unwrap()
.to_owned();
format!(
"{}\n", "{}\n",
serde_json::to_string(&json!({ serde_json::to_string(&json!({
"aliases": {}, "aliases": {},
@ -1251,6 +1337,7 @@ fn module() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
"source": foo_just
}, },
}, },
"recipes": {}, "recipes": {},
@ -1275,9 +1362,11 @@ fn module() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
"source": source
})) }))
.unwrap() .unwrap()
)) )
})
.run(); .run();
} }
@ -1294,7 +1383,24 @@ fn module_group() {
"foo.just": "bar:", "foo.just": "bar:",
}) })
.args(["--dump", "--dump-format", "json"]) .args(["--dump", "--dump-format", "json"])
.stdout(format!( .stdout_with_tempdir(|dir| {
let source = dir
.path()
.canonicalize()
.unwrap()
.join("justfile")
.to_str()
.unwrap()
.to_owned();
let foo_just = dir
.path()
.canonicalize()
.unwrap()
.join("foo.just")
.to_str()
.unwrap()
.to_owned();
format!(
"{}\n", "{}\n",
serde_json::to_string(&json!({ serde_json::to_string(&json!({
"aliases": {}, "aliases": {},
@ -1346,6 +1452,7 @@ fn module_group() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
"source": foo_just,
}, },
}, },
"recipes": {}, "recipes": {},
@ -1370,9 +1477,11 @@ fn module_group() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
"source": source,
})) }))
.unwrap() .unwrap()
)) )
})
.run(); .run();
} }
@ -1383,6 +1492,8 @@ fn recipes_with_private_attribute_are_private() {
[private] [private]
foo: foo:
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -1426,7 +1537,9 @@ fn recipes_with_private_attribute_are_private() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source,
})
},
); );
} }
@ -1438,6 +1551,8 @@ fn doc_attribute_overrides_comment() {
[doc('ATTRIBUTE')] [doc('ATTRIBUTE')]
foo: foo:
", ",
|dir| {
let source = dir.join("justfile").to_str().unwrap().to_owned();
json!({ json!({
"aliases": {}, "aliases": {},
"assignments": {}, "assignments": {},
@ -1481,6 +1596,8 @@ fn doc_attribute_overrides_comment() {
}, },
"unexports": [], "unexports": [],
"warnings": [], "warnings": [],
}), "source": source
})
},
); );
} }

View File

@ -167,6 +167,11 @@ impl Test {
self self
} }
pub(crate) fn stdout_with_tempdir(mut self, stdout_fn: impl Fn(&TempDir) -> String) -> Self {
self.stdout = stdout_fn(&self.tempdir);
self
}
pub(crate) fn stdout_regex(mut self, stdout_regex: impl AsRef<str>) -> Self { pub(crate) fn stdout_regex(mut self, stdout_regex: impl AsRef<str>) -> Self {
self.stdout_regex = Some(Regex::new(&format!("^{}$", stdout_regex.as_ref())).unwrap()); self.stdout_regex = Some(Regex::new(&format!("^{}$", stdout_regex.as_ref())).unwrap());
self self