Hi,
Overview
- I just started trying out swift-format using Xcode 26 (Control Shift I)
Questions
- Why does
xcrun swift-format dump-configurationshow configurations different from what I notice in Xcode?
| Property | swift-format dump-configuration | Xcode Behaviour |
|---|---|---|
| lineLength | 100 | 80 |
| indentation | 2 | 4 |
- Is it because the
swift-format dump-configurationis overridden by Xcode's Settings?
- Settings > Editing > Completion > Reformat code at column - 80
- Settings > Editing > Indentation > Indent width - 4 spaces
- Is it possible to use the Xcode defaults and add only the overrides to
.swift-formatfile?
- I can set
Reformat code at columnto 100 in Xcode - I like the Xcode defaults, all I need is
"spacesAroundRangeFormationOperators" : true - However when I add only
spacesAroundRangeFormationOperatorsin .swift-format, it seems to make the indentation to2