From 0192e7ebc54fcc96244e6c0313f1d76e037abcaa Mon Sep 17 00:00:00 2001 From: Cal Stephens Date: Tue, 10 Dec 2024 10:59:26 -0800 Subject: [PATCH] Update to SwiftFormat 0.56-beta-1 based on 0.55 release (#294) --- .github/workflows/main.yml | 18 +----------------- Package.swift | 4 ++-- README.md | 17 ++++++++++++----- .../AirbnbSwiftFormatTool/airbnb.swiftformat | 10 +++++----- 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 338ece1..9b65dd6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,23 +7,7 @@ on: branches: [ master ] jobs: - test-package-plugin-macos-12: - name: Test Package Plugin - runs-on: macos-12 - strategy: - fail-fast: false - matrix: - xcode: - - '13.4.1' # Swift 5.6 - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/setup - with: - xcode: ${{ matrix.xcode }} - - name: Test Package Plugin - run: bundle exec rake lint:swift - - test-package-plugin-macos-13: + test-package-plugin: name: Test Package Plugin runs-on: macos-13 strategy: diff --git a/Package.swift b/Package.swift index 009a344..4e4fd59 100644 --- a/Package.swift +++ b/Package.swift @@ -42,8 +42,8 @@ let package = Package( .binaryTarget( name: "swiftformat", - url: "https://github.com/calda/SwiftFormat/releases/download/0.55-beta-17/SwiftFormat.artifactbundle.zip", - checksum: "659bdcccc69a6e5ccbd273f0fb7b7af9655d5fa7acc17c4fb3deba6a7b1e9a5b"), + url: "https://github.com/calda/SwiftFormat/releases/download/0.56-beta-1-build-2/SwiftFormat.artifactbundle.zip", + checksum: "52555bc9fa90a31e68f77917eac2307c2ebbad023d83b3e728e0deb2c7ec98a2"), .binaryTarget( name: "SwiftLintBinary", diff --git a/README.md b/README.md index 89b6147..522e123 100644 --- a/README.md +++ b/README.md @@ -376,7 +376,7 @@ _You can enable the following settings in Xcode by running [this script](resourc -* (link) **Prefer letting the type of a variable or property be inferred from the right-hand-side value rather than writing the type explicitly on the left-hand side.** [![SwiftFormat: propertyType](https://img.shields.io/badge/SwiftFormat-propertyType-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#propertyType) +* (link) **Prefer letting the type of a variable or property be inferred from the right-hand-side value rather than writing the type explicitly on the left-hand side.** [![SwiftFormat: propertyTypes](https://img.shields.io/badge/SwiftFormat-propertyTypes-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#propertyTypes)
@@ -1880,7 +1880,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
-* (link) **Place doc comments for a declaration before any attributes.** [![SwiftFormat: docCommentsBeforeAttributes](https://img.shields.io/badge/SwiftFormat-docCommentsBeforeAttributes-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#docCommentsBeforeAttributes) +* (link) **Place doc comments for a declaration before any attributes or modifiers.** [![SwiftFormat: docCommentsBeforeModifiers](https://img.shields.io/badge/SwiftFormat-docCommentsBeforeModifiers-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#docCommentsBeforeModifiers)
@@ -1891,11 +1891,18 @@ _You can enable the following settings in Xcode by running [this script](resourc /// A spacecraft with everything you need to explore the universe. struct Spaceship { … } + public + /// A spacecraft with everything you need to explore the universe. + struct Spaceship { … } + // RIGHT /// A spacecraft with everything you need to explore the universe. @MainActor struct Spaceship { … } + + /// A spacecraft with everything you need to explore the universe. + public struct Spaceship { … } ```
@@ -3758,7 +3765,7 @@ _You can enable the following settings in Xcode by running [this script](resourc struct IsSelectedEnvironmentKey: EnvironmentKey { static var defaultValue: Bool { false } } - + extension EnvironmentValues { var isSelected: Bool { get { self[IsSelectedEnvironmentKey.self] } @@ -4179,7 +4186,7 @@ _You can enable the following settings in Xcode by running [this script](resourc -* (link) **Remove unused private and fileprivate properties, functions, and typealiases** [![SwiftFormat: unusedPrivateDeclaration](https://img.shields.io/badge/SwiftFormat-unusedPrivateDeclaration-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#unusedPrivateDeclaration) +* (link) **Remove unused private and fileprivate properties, functions, and typealiases** [![SwiftFormat: unusedPrivateDeclarations](https://img.shields.io/badge/SwiftFormat-unusedPrivateDeclarations-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#unusedPrivateDeclarations)
@@ -4212,7 +4219,7 @@ _You can enable the following settings in Xcode by running [this script](resourc
-* (link) **Remove empty extensions that define no properties, functions, or conformances.** [![SwiftFormat: emptyExtension](https://img.shields.io/badge/SwiftFormat-emptyExtension-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#emptyExtension) +* (link) **Remove empty extensions that define no properties, functions, or conformances.** [![SwiftFormat: emptyExtensions](https://img.shields.io/badge/SwiftFormat-emptyExtensions-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#emptyExtensions)
diff --git a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat index 3113dea..3db9cc8 100644 --- a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat +++ b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat @@ -33,7 +33,7 @@ --sortswiftuiprops first-appearance-sort #organizeDeclarations --extensionacl on-declarations # extensionAccessControl --patternlet inline # hoistPatternLet ---redundanttype inferred # redundantType, propertyType +--propertytypes inferred # redundantType, propertyTypes --typeblanklines preserve # blankLinesAtStartOfScope, blankLinesAtEndOfScope --emptybraces spaced # emptyBraces --ranges preserve # spaceAroundOperators @@ -98,7 +98,7 @@ --rules enumNamespaces --rules blockComments --rules docComments ---rules docCommentsBeforeAttributes +--rules docCommentsBeforeModifiers --rules spaceAroundComments --rules spaceInsideComments --rules blankLinesAtStartOfScope @@ -117,7 +117,7 @@ --rules blankLineAfterSwitchCase --rules consistentSwitchCaseSpacing --rules semicolons ---rules propertyType +--rules propertyTypes --rules blankLinesBetweenChainedFunctions ---rules unusedPrivateDeclaration ---rules emptyExtension +--rules unusedPrivateDeclarations +--rules emptyExtensions