One line length across every repo - #334
Merged
Merged
Conversation
3lvis
marked this pull request as ready for review
September 16, 2026 20:34
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.
Why
Networking's
lineLength: 120was never chosen here. #325 ported the tooling from SwiftSync on 20 June and copied its 120; SwiftSync moved to a never-wrap sentinel on 22 June, two days later, and Networking kept the number nobody had revisited since. tienda-ios already runs100000.One value now, in all three:
100000. swift-format has no way to say "no limit" —lineLengthis anInt,falseand"disabled"are rejected,nullfalls back to the default 100, and0breaks every token onto its own line. A large sentinel is the only dialect it speaks, and the three repos were writing that sentence with different numbers of zeros.The wrapping already in the tree goes with it: oida asks swift-format whether a rejoined line survives before joining one, so raising the width lets 135 lines of previously-wrapped calls and signatures come back together.
The approach
Formatting the tree at both widths with swift-format alone reports no change, because it only ever adds breaks. The real pipeline is
bin/lint --fix, where oida's join direction reads the new width through swift-format — that is what moves the 24 files. Running it twice leaves the second pass with nothing to do, so the shape is stable rather than oscillating.Testing
make test(180 tests, green) plusbin/lint --checkclean.Learnings
A formatter config measured with the formatter alone is measured wrong wherever a linter reads that config back. swift-format only adds line breaks, so a width change looks free; oida asks swift-format whether a joined line survives, so the same change tells it to undo wrapping across the tree. The number to quote is the one
bin/lint --fixproduces, not the oneswift-format formatdoes.