Skip to content

tar: replace all string-based error variants with structured types#149

Merged
kaladron merged 2 commits into
uutils:mainfrom
kaladron:refactor-error-types
Apr 4, 2026
Merged

tar: replace all string-based error variants with structured types#149
kaladron merged 2 commits into
uutils:mainfrom
kaladron:refactor-error-types

Conversation

@kaladron

@kaladron kaladron commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

Every TarError variant now carries PathBuf and/or io::Error data instead of a pre-formatted String. Add thiserror derive macros so Display implementations are generated from #[error(...)] attributes in one central place. Eliminates the last generic TarOperation and InvalidArchive string variants.

@kaladron kaladron force-pushed the refactor-error-types branch from a211137 to 3ea85f2 Compare April 3, 2026 11:49
Every TarError variant now carries PathBuf and/or io::Error data
instead of a pre-formatted String. Add thiserror derive macros so
Display implementations are generated from #[error(...)] attributes
in one central place. Eliminates the last generic TarOperation and
InvalidArchive string variants.
@kaladron kaladron force-pushed the refactor-error-types branch from 3ea85f2 to 5b1fe91 Compare April 4, 2026 09:11
@kaladron kaladron marked this pull request as ready for review April 4, 2026 09:14
Comment thread src/uu/tar/src/errors.rs Outdated
Comment thread src/uu/tar/src/errors.rs Outdated
Comment thread src/uu/tar/src/errors.rs Outdated
@codecov

codecov Bot commented Apr 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.57%. Comparing base (18fa3ee) to head (02c2424).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/uu/tar/src/operations/create.rs 0.00% 15 Missing ⚠️
src/uu/tar/src/errors.rs 0.00% 8 Missing ⚠️
src/uu/tar/src/operations/extract.rs 0.00% 6 Missing ⚠️
src/uu/tar/src/operations/list.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main     #149       +/-   ##
=========================================
+ Coverage      0   63.57%   +63.57%     
=========================================
  Files         0        7        +7     
  Lines         0      755      +755     
  Branches      0       24       +24     
=========================================
+ Hits          0      480      +480     
- Misses        0      275      +275     
Flag Coverage Δ
macos_latest 63.57% <0.00%> (?)
ubuntu_latest 63.57% <0.00%> (?)
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 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.

@kaladron kaladron merged commit f541b90 into uutils:main Apr 4, 2026
17 checks passed
@kaladron kaladron deleted the refactor-error-types branch April 4, 2026 22:47
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