Repository navigation
feat(builtins): add fmt on the vendored uutils engine - #2569
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | c790733 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 05:26 PM |
chaliy
force-pushed
the
claude/fmt-builtin
branch
4 times, most recently
from
October 7, 2026 16:34
2ab3421 to
4ab118f
Compare
fmt fills and joins paragraphs with the uutils coreutils fmt line breaker (MIT, vendored linebreak.rs/parasplit.rs) and bashkit-owned option parsing and I/O. GNU option set plus uutils extras; GNU width rules and messages. Vendored panic!/unwrap paths became early returns. Line breaks can differ from GNU fmt (L-FMT-001): GNU fmt.c is GPL and is not ported. Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
chaliy
force-pushed
the
claude/fmt-builtin
branch
from
October 7, 2026 17:26
4ab118f to
c790733
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
New
fmtbuiltin. It fills and joins paragraphs with an optimal-fit (Knuth-Plass) line breaker vendored from uutils coreutilsfmt(MIT). Supports GNU's options (-w,-g,-c,-t,-s,-u,-p, obsolete-WIDTH) plus the uutils extras (-m,-P,-x,-X,-q,-T). Width rules and error messages follow GNU: goal is 93% of the width,-galone sets width to goal + 10, width caps at 2500.The vendored
panic!/unwrappaths became early returns. Attribution is in NOTICE and THIRD_PARTY_LICENSES.Why
Step 4 of the level-up roadmap:
fmtis one of the commands still missing. GNUfmt.cis GPL, so it can't be ported into MIT bashkit. uutils is MIT and already the source of our generated coreutils argument files (same pinned revision).Before / After
Before:
After:
GNU wraps the second example as
jumps / over ... keeps / running far away.. Same widths and paragraphs, but a different breaking choice. This is recorded as L-FMT-001. Of the 16 spec cases, 5 are markedbash_difffor this reason.Risk
fmton PATH in the VFS is now shadowed by the builtin. Fuzzed with 600 random byte inputs and option mixes: no panics.Checklist
fmt.test.sh, 7 unit tests, bash comparison passes)https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Generated by Claude Code