fmt: --goal produces different output than GNU fmt
Open
Nobody has claimed this yet.
- #5269 by @tommady — closed without merging
U - fmt
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
When using -g/--goal, the output differs between uutils fmt and GNU fmt:
// uutils fmt
$ cargo run fmt tests/fixtures/fmt/one-word-per-line.txt --goal=7
this is
a file
with one
word per
line
// GNU fmt
$ fmt tests/fixtures/fmt/one-word-per-line.txt --goal=7
this is a
file with one
word per line
A test case for this issue was added in https://github.com/uutils/coreutils/pull/5159/files
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/fixtures/fmt/one-word-per-line.txt and the test case added in PR #5159. Reproduce the --goal=7 output difference, then trace the fmt implementation and compare its wrapping behavior with GNU fmt. Done means the test passes and uutils fmt produces the expected GNU-compatible output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100