Skip to content

Commit

Permalink
Allow unstable features with --summary (#2210)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Jun 30, 2024
1 parent e0c0312 commit 7683c81
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,8 @@ impl Config {
}
};

let unstable = matches.get_flag(arg::UNSTABLE) || subcommand == Subcommand::Summary;

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

test! {
Expand Down
15 changes: 15 additions & 0 deletions tests/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,18 @@ fn submodule_recipes() {
.stdout("bar foo::foo foo::bar::bar foo::bar::baz::baz foo::bar::baz::biz::biz\n")
.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();
}

0 comments on commit 7683c81

Please sign in to comment.