-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new setting "ignore-recipe-comments". If set, this causes lines internal to a non-shebang recipe beginning with the character '#' (other than '#!' itself) to be treated as comments of the justfile itself. They will not be echoed to stderr when the recipe executes.
- Loading branch information
Showing
14 changed files
with
140 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ pub(crate) enum Keyword { | |
Export, | ||
False, | ||
If, | ||
IgnoreRecipeComments, | ||
PositionalArguments, | ||
Set, | ||
Shell, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use super::*; | ||
|
||
#[test] | ||
fn ignore_recipe_comments() { | ||
Test::new() | ||
.justfile( | ||
" | ||
set ignore-recipe-comments | ||
some_recipe: | ||
# A recipe-internal comment | ||
echo something-useful | ||
", | ||
) | ||
.stdout("something-useful\n") | ||
.stderr("echo something-useful\n") | ||
.run(); | ||
} | ||
|
||
#[test] | ||
fn dont_ignore_recipe_comments() { | ||
Test::new() | ||
.justfile( | ||
" | ||
set ignore-recipe-comments := false | ||
some_recipe: | ||
# A recipe-internal comment | ||
echo something-useful | ||
", | ||
) | ||
.stdout("something-useful\n") | ||
.stderr("# A recipe-internal comment\necho something-useful\n") | ||
.run(); | ||
} | ||
|
||
#[test] | ||
fn ignore_recipe_comments_with_shell_setting() { | ||
Test::new() | ||
.justfile( | ||
" | ||
set shell := ['echo', '-n'] | ||
set ignore-recipe-comments | ||
some_recipe: | ||
# Alternate shells still ignore comments | ||
echo something-useful | ||
", | ||
) | ||
.stdout("something-useful\n") | ||
.stderr("echo something-useful\n") | ||
.run(); | ||
} |
Oops, something went wrong.