Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@RenjiSann
Copy link
Collaborator

This PR fixes a behavior difference when handling --text.

Additionally, it brings a consequential refactor to the cksum function, which is the main "read/checksum/print" loop.
I introduced an OutputFormat type to properly separate all printing strategies, because the previous representation didn't make sense: we had an OutputFormat enum that mixed Raw and Base64/Hexadecimal when Raw if actually an alternative to printing a "tagged" or "untagged" line.

This notably allowed me to remove the #[allow(clippy::cognitive_complexity)] from the function which is good :)

@RenjiSann RenjiSann force-pushed the checksum-updates branch 4 times, most recently from 76ed8a6 to f43d027 Compare October 25, 2025 23:47
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

InvalidLength,
#[error("--length is only supported with --algorithm=blake2b")]
LengthOnlyForBlake2b,
#[error("the --binary and --text options are meaningless when verifying checksums")]
Copy link
Contributor

Choose a reason for hiding this comment

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

side note: it should be translated too
i missed it when i used translate!()

Copy link
Contributor

Choose a reason for hiding this comment

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

not in this pr is fine :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I plan to do it after getting rid of hashsum

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@sylvestre
Copy link
Contributor

please fix


error: unclosed HTML tag `digest`
  --> src/uu/cksum/src/cksum.rs:90:10
   |
90 |     /// '<digest> <flag><filename>'
   |          ^^^^^^^^
   |
   = note: `-D rustdoc::invalid-html-tags` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(rustdoc::invalid_html_tags)]`

error: unclosed HTML tag `flag`
  --> src/uu/cksum/src/cksum.rs:90:19
   |
90 |     /// '<digest> <flag><filename>'
   |                   ^^^^^^

error: unclosed HTML tag `filename`
  --> src/uu/cksum/src/cksum.rs:90:25
   |
90 |     /// '<digest> <flag><filename>'
   |                         ^^^^^^^^^^

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre merged commit 82464a4 into uutils:main Oct 26, 2025
121 checks passed
@RenjiSann RenjiSann deleted the checksum-updates branch October 26, 2025 16:41
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