Repository navigation
Conversation
4becade to
571d3a2
Compare
Merging this PR will degrade performance by 29.38%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
Oh no... |
| fancy-regex = { version = "0.19.2", default-features = false, features = ["std", "unicode"] } | ||
| regex = "1.12" | ||
| uucore = { version = "0.10.0", features = ["entries", "fs", "fsext", "mode"] } | ||
| uucore = { git = "https://github.com/wtcpython/coreutils.git", branch = "uucore-regex", features = ["entries", "fs", "fsext", "mode", "regex"] } |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
70d7f30 to
671b7ca
Compare
|
Commit 70d7f30 has test result changes: bfs testsuite: |
|
the ci is red :) |
| RegexType::PosixBasic => Syntax::posix_basic(), | ||
| RegexType::PosixExtended => Syntax::posix_extended(), | ||
| // GNU find's -regex does full-path matching, so anchor the pattern. | ||
| let anchored = if pattern.starts_with('^') && pattern.ends_with('$') { |
There was a problem hiding this comment.
anchoring by concatenation breaks alternation: a|b becomes ^a|b$, which means ^a or b$. please wrap it instead, something like ^(?:{pattern})$
| } else if pattern.ends_with('$') { | ||
| format!("^{pattern}") | ||
| } else { | ||
| format!("^{pattern}$") |
There was a problem hiding this comment.
this changes -regex/-name matching semantics, please add tests in tests/test_find.rs (alternation, ^/$ in the middle, -iregex, each -regextype)
| fn matches(&self, file_info: &WalkEntry, _: &mut MatcherIO) -> bool { | ||
| self.regex | ||
| .is_match(file_info.path().to_string_lossy().as_ref()) | ||
| .unwrap_or(false) |
There was a problem hiding this comment.
unwrap_or(false) silently turns a backtrack-limit error into "no match", is that what we want?
| } | ||
|
|
||
| match chars.next() { | ||
| Some(c) if "(){}|+?".contains(c) => output.push(c), |
There was a problem hiding this comment.
in emacs syntax a bare | is a literal and only \| is alternation, so | needs to be escaped in the other branch. the doc comment above says the opposite
| // so anchor the regex to prevent partial matches. | ||
| let anchored = format!("^{r}$"); | ||
| regex_transpile::compile(&anchored, super::regex::RegexType::PosixBasic, caseless) | ||
| .unwrap() |
There was a problem hiding this comment.
unwrap() on a user-supplied pattern, could you please propagate the error? the "should never fail" comment was true for parse_bre, not for the new transpiler
671b7ca to
097a4d1
Compare
097a4d1 to
6e93bd7
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
==========================================
- Coverage 92.28% 92.16% -0.12%
==========================================
Files 35 37 +2
Lines 7504 7964 +460
Branches 390 439 +49
==========================================
+ Hits 6925 7340 +415
- Misses 437 459 +22
- Partials 142 165 +23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #212