Skip to content

One line length across every repo - #334

Merged
3lvis merged 1 commit into
masterfrom
elvis/one-line-length-for-every-repo
Sep 16, 2026
Merged

3lvis merged 1 commit into
masterfrom
elvis/one-line-length-for-every-repo

Conversation

@3lvis

@3lvis 3lvis commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Why

Networking's lineLength: 120 was 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 runs 100000.

One value now, in all three: 100000. swift-format has no way to say "no limit" — lineLength is an Int, false and "disabled" are rejected, null falls back to the default 100, and 0 breaks 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) plus bin/lint --check clean.

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 --fix produces, not the one swift-format format does.

@3lvis
3lvis marked this pull request as ready for review September 16, 2026 20:34
@3lvis
3lvis merged commit 9a452f2 into master Sep 16, 2026
4 checks passed
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.

1 participant