From e5181e96d0652b8a561c8783accbe69ec9dea0ba Mon Sep 17 00:00:00 2001 From: Thomas Rasch Date: Tue, 17 Nov 2026 17:45:39 +0000 Subject: [PATCH] Clean up the SwiftFormat configuration Align the configuration with the shared SwiftFormat setup and bump the CI-pinned SwiftFormat to 0.64.6. The lint gate only checks files a pull request touches, so the existing debt is left untouched. --- .github/workflows/swift.yml | 2 +- .swift-version | 2 +- .swiftformat | 65 +++++-------------------------------- 3 files changed, 11 insertions(+), 58 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 169fabd7..951db1fc 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -102,7 +102,7 @@ jobs: fetch-depth: 0 - name: Install SwiftFormat run: | - curl -sSL https://github.com/nicklockwood/SwiftFormat/releases/download/0.63.0/swiftformat_linux.zip -o /tmp/swiftformat.zip + curl -sSL https://github.com/nicklockwood/SwiftFormat/releases/download/0.64.6/swiftformat_linux.zip -o /tmp/swiftformat.zip unzip -q /tmp/swiftformat.zip -d /tmp/swiftformat chmod +x /tmp/swiftformat/swiftformat_linux sudo mv /tmp/swiftformat/swiftformat_linux /usr/local/bin/swiftformat diff --git a/.swift-version b/.swift-version index a435f5a5..c596943a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -6.1 +6.4 diff --git a/.swiftformat b/.swiftformat index 9bd61f65..41dd5aba 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,44 +1,29 @@ ---acronyms ID,URL,UUID +--min-version 0.64.6 --allman false --allow-partial-wrapping false --anonymous-for-each convert --asset-literals visual-width ---async-capturing ---before-marks --binary-grouping 4,8 --blank-line-after-switch-case multiline-only --call-site-paren same-line ---category-mark "MARK: %c" ---class-threshold 0 ---closing-paren default --closure-void remove --complex-attributes preserve --computed-var-attributes preserve --conditional-assignment after-property ---conflict-markers reject --date-format system --decimal-grouping 3,6 ---default-test-suite-attributes --doc-comments before-declarations --else-position next-line --empty-braces no-space --enum-namespaces always ---enum-threshold 0 --equatable-macro none --exponent-case lowercase --exponent-grouping disabled --extension-acl on-declarations ---extension-mark "MARK: - %t + %c" ---extension-threshold 0 --file-macro "#file" --fraction-grouping disabled ---fragment false --func-attributes preserve ---generic-types ---group-blank-lines true ---grouped-extension "MARK: %c" --guard-else auto ---guard-like-if-statements preserve --header ignore --hex-grouping 4,8 --hex-literal-case uppercase @@ -48,74 +33,39 @@ --indent-blank-lines false --indent-case false --indent-strings false ---inferred-types always --init-coder-nil false ---lifecycle --line-after-marks true --line-between-guards false --linebreaks lf --list-wrap-threshold none ---mark-categories true ---mark-class-threshold 0 ---mark-enum-threshold 0 ---mark-extension-threshold 0 ---mark-extensions always ---mark-struct-threshold 0 ---mark-types always --markdown-files ignore --max-width none ---modifier-order ---never-trailing --nil-init remove ---no-space-operators ---no-wrap-operators ---non-complex-attributes --octal-grouping 4,8 --operator-func spaced ---organization-mode visibility ---organize-types actor,class,enum,struct --pattern-let hoist --prefer-synthesized-init-for-internal-structs never ---preserve-acronyms ---preserve-decls ---preserved-property-types Package --property-types infer-locals-only --ranges spaced --redundant-async tests-only --redundant-optional-binding same-name-only --redundant-throws tests-only --self init-only ---self-required --semicolons inline-only --short-optionals except-properties --single-line-for-each ignore ---single-line-ternary convert --smart-tabs enabled --some-any true ---sort-swiftui-properties none ---sorted-patterns --stored-var-attributes preserve ---strip-unused-args always ---struct-threshold 0 --suite-name-format preserve --tab-width unspecified ---test-case-access-control internal ---test-case-name-format raw-identifiers ---throw-capturing +--test-case-name-format standard-identifiers --timezone system ---trailing-closures --trailing-commas always --trim-whitespace always --type-attributes prev-line ---type-blank-lines insert ---type-body-marks preserve +--type-blank-lines preserve --type-delimiter space-after ---type-mark "MARK: - %t" ---type-marks ---type-order ---url-macro none ---visibility-marks ---visibility-order --void-type Void --wrap-arguments before-first --wrap-collections before-first @@ -128,7 +78,10 @@ --wrap-ternary before-operators --wrap-type-aliases before-first --xcode-indentation enabled ---xctest-symbols --yoda-swap always ---disable trailingClosures,unusedArguments,preferExplicitFalse ---enable blankLineAfterSwitchCase,blankLinesAfterGuardStatements,blockComments,isEmpty,preferContains,preferCountWhere,preferFirstWhere,preferFlatMap,preferLazyMap,preferMinOverSorted,preferSwiftStringAPI,preferSwiftTesting,singlePropertyPerLine,sortSwitchCases,unusedPrivateDeclarations,wrapEnumCases,wrapMultilineConditionalAssignment,wrapMultilineFunctionChains +--disable trailingClosures,unusedArguments +--enable blankLineAfterSwitchCase,blankLinesAfterGuardStatements,blockComments,isEmpty,preferContains,preferCountWhere,preferFirstWhere,preferFlatMap,preferMinOverSorted,preferSwiftStringAPI,preferSwiftTesting,singlePropertyPerLine,sortSwitchCases,unusedPrivateDeclarations,wrapEnumCases,wrapMultilineConditionalAssignment,wrapMultilineFunctionChains,commonTypos,forWhere,emptyExtensions,noExplicitOwnership + +# Build products, dependency checkouts and generated data. SwiftFormat +# rewrites files in place, so these must never be scanned. +--exclude .build,.swiftpm