Skip to content

Conversation

@estodi
Copy link
Contributor

@estodi estodi commented May 15, 2025

Added support for the show-path option.

Comment on lines 278 to 282
let re = if show_path {
Regex::new(r"(?m)^[0-9a-f]{16} +[1-9][0-9]*K (-|r)(-|w)(-|x)(-|s)- ( \[ (anon|stack) \]|/[/a-zA-Z0-9._-]+)$").unwrap()
} else {
Regex::new(r"(?m)^[0-9a-f]{16} +[1-9][0-9]*K (-|r)(-|w)(-|x)(-|s)- ( \[ (anon|stack) \]|[a-zA-Z0-9._-]+)$").unwrap()
};
Copy link
Contributor

@cakebaker cakebaker May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would make sense to split the regexes to make it easier to see the (small) differences? Something like:

let base_pattern = "<pattern for the identical part>";
let mapping_pattern = if show_path {
    "<pattern path expected>"
} else {
    "<pattern no path expected>"
};

let re = Regex::new(&format("{base_pattern}{mapping_pattern}")).unwrap();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion!

@cakebaker cakebaker merged commit 6cdec94 into uutils:main May 17, 2025
13 checks passed
@codecov
Copy link

codecov bot commented May 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (835a930) to head (ee37b70).
Report is 9 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #418   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cakebaker
Copy link
Contributor

Good work, thanks!

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