Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for regex matching #126

Merged
merged 2 commits into from
Jan 23, 2022
Merged

Add support for regex matching #126

merged 2 commits into from
Jan 23, 2022

Conversation

refi64
Copy link
Contributor

@refi64 refi64 commented Jan 13, 2022

This adds support for -regextype, -regex, and -iregex, using Oniguruma
to implement support for the Emacs, grep, POSIX basic, and POSIX
extended regex types.

Signed-off-by: Ryan Gonzalez [email protected]


Meta note: I'm not sure if it would be preferred to have this behind a feature, since oniguruma is a C dependency, or if regex should be removed instead due to functionality overlap.

@refi64 refi64 force-pushed the regex branch 6 times, most recently from a658bf6 to 996ddac Compare January 14, 2022 01:24
@codecov
Copy link

codecov bot commented Jan 14, 2022

Codecov Report

Merging #126 (0298d20) into main (bdfd492) will decrease coverage by 1.89%.
The diff coverage is 65.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #126      +/-   ##
==========================================
- Coverage   49.80%   47.91%   -1.90%     
==========================================
  Files          19       20       +1     
  Lines        2594     4097    +1503     
  Branches      702     1429     +727     
==========================================
+ Hits         1292     1963     +671     
- Misses       1046     1650     +604     
- Partials      256      484     +228     
Impacted Files Coverage Δ
src/find/mod.rs 61.36% <ø> (ø)
src/find/matchers/regex.rs 48.88% <48.88%> (ø)
src/find/matchers/mod.rs 64.77% <52.63%> (-1.02%) ⬇️
tests/find_cmd_tests.rs 78.07% <100.00%> (+7.48%) ⬆️
src/lib.rs 34.99% <0.00%> (+9.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bdfd492...0298d20. Read the comment docs.

@refi64
Copy link
Contributor Author

refi64 commented Jan 14, 2022

Looks like CI is finally passing, you know it's a good day when you hit a bug in an unrelated crate due to compiler flags 😅

@sylvestre
Copy link
Contributor

could you please rebase this patch to compare with the other testsuite? thanks

This adds support for -regextype, -regex, and -iregex, using Oniguruma
to implement support for the Emacs, grep, POSIX basic, and POSIX
extended regex types.

Signed-off-by: Ryan Gonzalez <[email protected]>
Depending on onig ends up requiring proc_macro2, but the version that
was in the lockfile breaks the build if panic=abort is used (which is
done for coverage checks). This was fixed in 1.0.30+ for Rust 1.57+, so
update to that version.

Signed-off-by: Ryan Gonzalez <[email protected]>
@refi64
Copy link
Contributor Author

refi64 commented Jan 22, 2022

Done:

Screenshot from 2022-01-22 09-16-03

@sylvestre sylvestre merged commit d432d66 into uutils:main Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants