Skip to content

--posix should reject GNU substitute flags i/I #401#419

Merged
dspinellis merged 11 commits into
uutils:mainfrom
Devel08:fix-401
Jul 1, 2026
Merged

--posix should reject GNU substitute flags i/I #401#419
dspinellis merged 11 commits into
uutils:mainfrom
Devel08:fix-401

Conversation

@Devel08

@Devel08 Devel08 commented May 8, 2026

Copy link
Copy Markdown
Contributor

resolves #401

@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.52%. Comparing base (b14272c) to head (a8504f3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/sed/compiler.rs 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
- Coverage   82.67%   82.52%   -0.16%     
==========================================
  Files          13       13              
  Lines        5997     6007      +10     
  Branches      347      350       +3     
==========================================
- Hits         4958     4957       -1     
- Misses       1036     1047      +11     
  Partials        3        3              
Flag Coverage Δ
macos_latest 83.23% <33.33%> (-0.16%) ⬇️
ubuntu_latest 83.32% <33.33%> (-0.16%) ⬇️
windows_latest 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@dspinellis dspinellis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Almost there!

Comment thread tests/by-util/test_sed.rs
}

//--posix should reject GNU substitute flags i/I https://github.com/uutils/sed/issues/401
#[test]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please also add a test for the m flag (different code path).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done :)

Comment thread src/sed/compiler.rs Outdated

'i' | 'I' => {
if context.posix {
return compilation_error(lines, line, "unknown option to 's'");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Define a constant for the error message and use it throughout. (See current main branch.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But that wouldn't comply with the current code style, for example, the error message isn't a constant on line 386

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You're almost right, but things change 😃. As I wrote, check the current main branch.

@dspinellis

Copy link
Copy Markdown
Collaborator

Can I review for merging? If not, please ping me when ready.

@Devel08

Devel08 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Can I review for merging? If not, please ping me when ready.

It's ready for merge IMO.

@dspinellis dspinellis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excellent!

@dspinellis dspinellis merged commit 8cb7090 into uutils:main Jul 1, 2026
29 of 31 checks passed
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.

--posix should reject GNU substitute flags i/I

2 participants