Allow unstable features with --summary (#2210)

This commit is contained in:
Casey Rodarmor 2024-06-29 18:12:31 -07:00 committed by GitHub
parent e0c031272d
commit 7683c81c08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View File

@ -744,6 +744,8 @@ impl Config {
} }
}; };
let unstable = matches.get_flag(arg::UNSTABLE) || subcommand == Subcommand::Summary;
Ok(Self { Ok(Self {
check: matches.get_flag(arg::CHECK), check: matches.get_flag(arg::CHECK),
color: Self::color_from_matches(matches)?, color: Self::color_from_matches(matches)?,
@ -783,7 +785,7 @@ impl Config {
.unwrap() .unwrap()
.into(), .into(),
unsorted: matches.get_flag(arg::UNSORTED), unsorted: matches.get_flag(arg::UNSORTED),
unstable: matches.get_flag(arg::UNSTABLE), unstable,
verbosity: if matches.get_flag(arg::QUIET) { verbosity: if matches.get_flag(arg::QUIET) {
Verbosity::Quiet Verbosity::Quiet
} else { } else {
@ -834,6 +836,7 @@ mod tests {
$(shell_args: $shell_args:expr,)? $(shell_args: $shell_args:expr,)?
$(subcommand: $subcommand:expr,)? $(subcommand: $subcommand:expr,)?
$(unsorted: $unsorted:expr,)? $(unsorted: $unsorted:expr,)?
$(unstable: $unstable:expr,)?
$(verbosity: $verbosity:expr,)? $(verbosity: $verbosity:expr,)?
} => { } => {
#[test] #[test]
@ -854,6 +857,7 @@ mod tests {
$(shell_args: $shell_args,)? $(shell_args: $shell_args,)?
$(subcommand: $subcommand,)? $(subcommand: $subcommand,)?
$(unsorted: $unsorted,)? $(unsorted: $unsorted,)?
$(unstable: $unstable,)?
$(verbosity: $verbosity,)? $(verbosity: $verbosity,)?
..testing::config(&[]) ..testing::config(&[])
}; };
@ -1368,6 +1372,7 @@ mod tests {
name: subcommand_summary, name: subcommand_summary,
args: ["--summary"], args: ["--summary"],
subcommand: Subcommand::Summary, subcommand: Subcommand::Summary,
unstable: true,
} }
test! { test! {

View File

@ -71,3 +71,18 @@ fn submodule_recipes() {
.stdout("bar foo::foo foo::bar::bar foo::bar::baz::baz foo::bar::baz::biz::biz\n") .stdout("bar foo::foo foo::bar::bar foo::bar::baz::baz foo::bar::baz::biz::biz\n")
.run(); .run();
} }
#[test]
fn summary_implies_unstable() {
Test::new()
.write("foo.just", "foo:")
.justfile(
"
mod foo
",
)
.test_round_trip(false)
.arg("--summary")
.stdout("foo::foo\n")
.run();
}