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
multiElementCollectionTrailingCommas: falsewas a truce, and the other side of it is gone.swift-format defaults the option to
true, so it adds a trailing comma to a multi-line literal. oida'strailing_commarule defaulted tomandatoryComma = false, so it flagged that same comma. Two default-on tools with opposite instructions on one character — the key is what kept them from undoing each other on every run. oida 0.16.0 deletedtrailing_comma("Trailing commas are the formatter's"), so the key now referees a fight with one side in it.With it gone, swift-format's default stands: a multi-line literal ends with a comma, so adding an element touches one line rather than two and the diff says what changed. Sixteen lines picked that up from
bin/lint --fix..swift-formatis down to the three keys that say something — a version, a width, an indent.The approach
Measured the same way as #332: formatting the tree with and without the key, and reading what moved. The
products:array keeps its shape, since the option speaks only for collections with several elements.Testing
make test(180 tests, green) plusbin/lint --checkclean.Learnings
A config key that duplicates a default is easy to spot; one that contradicts a default is the one worth re-reading, because it usually holds a truce with some other tool, and truces outlive their counterparties silently. #332 pruned the duplicates and kept this one on the grounds that it changed output — which answered whether it did something, rather than whether the something was still wanted.