Skip to content

Commit

Permalink
Make FilespecMatcher case-sensitive (Cherry-pick of #16673) (#16677)
Browse files Browse the repository at this point in the history
This is why sensitivity training is so important...

[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano authored Aug 30, 2022
1 parent 8e381db commit 0f0c86b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/python/pants/source/filespec_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ def test_valid_matches(rule_runner: RuleRunner, glob: str, paths: Tuple[str, ...
# Dirs.
("dist/", ("not_dist", "cdist", "dist.py", "dist/dist")),
("build-support/*.venv/", ("build-support/rbt.venv.but_actually_a_file",)),
# Case sensitivity
("A", ("a",)),
("a", ("A",)),
("**/BUILD", ("src/rust/build.rs",)),
],
)
def test_invalid_matches(rule_runner: RuleRunner, glob: str, paths: Tuple[str, ...]) -> None:
Expand Down
3 changes: 2 additions & 1 deletion src/rust/engine/fs/src/glob_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ lazy_static! {
pub static ref DOUBLE_STAR_GLOB: Pattern = Pattern::new(*DOUBLE_STAR).unwrap();
static ref MISSING_GLOB_SOURCE: GlobParsedSource = GlobParsedSource(String::from(""));
static ref PATTERN_MATCH_OPTIONS: MatchOptions = MatchOptions {
case_sensitive: true,
require_literal_separator: true,
..MatchOptions::default()
require_literal_leading_dot: false,
};
}

Expand Down

0 comments on commit 0f0c86b

Please sign in to comment.