Skip to content

Commit 4354568

Browse files
authored
chore: support test,tests and script,scripts as aliases (#3373)
1 parent 226affb commit 4354568

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cli/src/cmd/forge/build/filter.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{convert::Infallible, path::Path, str::FromStr};
88
pub struct SkipBuildFilters(pub Vec<SkipBuildFilter>);
99

1010
impl FileFilter for SkipBuildFilters {
11-
/// Only returns a match if no filter a
11+
/// Only returns a match if _no_ exclusion filter matches
1212
fn is_match(&self, file: &Path) -> bool {
1313
self.0.iter().all(|filter| filter.is_match(file))
1414
}
@@ -39,8 +39,8 @@ impl SkipBuildFilter {
3939
impl<T: AsRef<str>> From<T> for SkipBuildFilter {
4040
fn from(s: T) -> Self {
4141
match s.as_ref() {
42-
"tests" => SkipBuildFilter::Tests,
43-
"scripts" => SkipBuildFilter::Scripts,
42+
"test" | "tests" => SkipBuildFilter::Tests,
43+
"script" | "scripts" => SkipBuildFilter::Scripts,
4444
s => SkipBuildFilter::Custom(s.to_string()),
4545
}
4646
}

cli/src/cmd/forge/build/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub struct BuildArgs {
7272
long,
7373
multiple_values = true,
7474
action = ArgAction::Append,
75-
help = "Skip building whose names contain FILTER. `tests` and `scripts` are aliases for `.t.sol` and `.s.sol`. (this flag can be used multiple times)")]
75+
help = "Skip building whose names contain FILTER. `test` and `script` are aliases for `.t.sol` and `.s.sol`. (this flag can be used multiple times)")]
7676
#[serde(skip)]
7777
pub skip: Option<Vec<SkipBuildFilter>>,
7878

0 commit comments

Comments
 (0)