Drop the config that 0.16.0 and swift-format already say - #332
Merged
Merged
Conversation
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
Three
.swift-formatkeys and four.oida.ymlentries repeat what the tools already say on their own.maximumBlankLines: 1,respectsExistingLineBreaks: trueandlineBreakBeforeEachArgument: falseare swift-format's own defaults.unneeded_override,force_castandforce_trybecame default-on rules in oida 0.16.0, so listing them underopt_in_rulesasks for what is already running.opening_brace'signore_multiline_function_signaturesis the one that changes code. It let a wrapped signature keep its brace on a line of its own; with it gone, the brace joins the closing paren —) async throws -> HTTPExchange {— which is the shape swift-format emits anyway. Six files picked that up frombin/lint --fix.Config left: four keys in
.swift-format, and one key underopening_bracethat stays load-bearing — a multi-lineiforguardstill wants its brace below the conditions, so the body reads as the body.The approach
Measured rather than reasoned. Formatting master's whole tree with the six-key config and with the pruned one gives byte-identical output, and the 0.16.0 rule table reports all three opt-ins as
opt-in: no,enabled: yesafter their removal.Testing
make test(180 tests, green) plusbin/lint --checkclean.Learnings
Little — the tools' own defaults were the whole answer.