diff --git a/CHANGELOG.md b/CHANGELOG.md index 87b6929ab..aaf8cad09 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## [0.52.9](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.52.9) (2023-11-10) + +- Fixed `redundantClosure` removing required closure around conditional statements +- Fixed `redundantClosure` removing closure containing conditional expressions inside a method call +- Fixed `redundantClosure` generating invalid code when the `redundantReturn` rule is disabled +- Fixed issue where if/switch expressions with `as?` cast would break build in Swift 5.9 +- Fixed `blankLineAfterImports` introducing spurious blank line before `@preconcurrency` attribute +- Fixed bug where `enumNamespaces` rule wouldn't be applied immediately after an `import` statement +- Fixed issue where `switch` case with multiple `where` clauses could be parsed incorrectly +- The SwiftFormat SPM plugin now formats local dependencies as well as final product targets + ## [0.52.8](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.52.8) (2023-10-17) - Fixed `redundantClosure` rule in cases where an `if`/`switch` expression is not permitted diff --git a/CommandLineTool/swiftformat b/CommandLineTool/swiftformat index 5857d94b3..62507b35b 100755 Binary files a/CommandLineTool/swiftformat and b/CommandLineTool/swiftformat differ diff --git a/Plugins/SwiftFormatPlugin/SwiftFormatPlugin.swift b/Plugins/SwiftFormatPlugin/SwiftFormatPlugin.swift index 15caf2547..0674b9a6c 100644 --- a/Plugins/SwiftFormatPlugin/SwiftFormatPlugin.swift +++ b/Plugins/SwiftFormatPlugin/SwiftFormatPlugin.swift @@ -62,8 +62,8 @@ import PackagePlugin extension Package { func allLocalTargets(of targetNames: [String]) throws -> [Target] { - let matchingTargets = try self.targets(named: targetNames) - let packageTargets = Set(self.targets.map(\.id)) + let matchingTargets = try targets(named: targetNames) + let packageTargets = Set(targets.map(\.id)) let withLocalDependencies = matchingTargets.flatMap { [$0] + $0.recursiveTargetDependencies } .filter { packageTargets.contains($0.id) } let enumeratedKeyValues = withLocalDependencies.map(\.id).enumerated() diff --git a/Sources/Formatter.swift b/Sources/Formatter.swift index 39e93458e..0c72e3e9d 100644 --- a/Sources/Formatter.swift +++ b/Sources/Formatter.swift @@ -2,7 +2,7 @@ // Formatter.swift // SwiftFormat // -// Version 0.52.8 +// Version 0.52.9 // // Created by Nick Lockwood on 12/08/2016. // Copyright 2016 Nick Lockwood diff --git a/Sources/SwiftFormat.swift b/Sources/SwiftFormat.swift index 51688c8e4..fe998f0de 100644 --- a/Sources/SwiftFormat.swift +++ b/Sources/SwiftFormat.swift @@ -32,7 +32,7 @@ import Foundation /// The current SwiftFormat version -let swiftFormatVersion = "0.52.8" +let swiftFormatVersion = "0.52.9" public let version = swiftFormatVersion /// The standard SwiftFormat config file name diff --git a/Sources/Tokenizer.swift b/Sources/Tokenizer.swift index a4bca8b47..7aa569c17 100644 --- a/Sources/Tokenizer.swift +++ b/Sources/Tokenizer.swift @@ -2,7 +2,7 @@ // Tokenizer.swift // SwiftFormat // -// Version 0.52.8 +// Version 0.52.9 // // Created by Nick Lockwood on 11/08/2016. // Copyright 2016 Nick Lockwood diff --git a/SwiftFormat.podspec.json b/SwiftFormat.podspec.json index 149202838..e0f302d80 100644 --- a/SwiftFormat.podspec.json +++ b/SwiftFormat.podspec.json @@ -1,6 +1,6 @@ { "name": "SwiftFormat", - "version": "0.52.8", + "version": "0.52.9", "license": { "type": "MIT", "file": "LICENSE.md" @@ -10,7 +10,7 @@ "authors": "Nick Lockwood", "source": { "git": "https://github.com/nicklockwood/SwiftFormat.git", - "tag": "0.52.8" + "tag": "0.52.9" }, "default_subspecs": "Core", "subspecs": [ diff --git a/SwiftFormat.xcodeproj/project.pbxproj b/SwiftFormat.xcodeproj/project.pbxproj index a31a4ac27..d5dadb5bc 100644 --- a/SwiftFormat.xcodeproj/project.pbxproj +++ b/SwiftFormat.xcodeproj/project.pbxproj @@ -1112,7 +1112,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.52.8; + MARKETING_VERSION = 0.52.9; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat; @@ -1145,7 +1145,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.52.8; + MARKETING_VERSION = 0.52.9; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat; @@ -1252,7 +1252,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.52.8; + MARKETING_VERSION = 0.52.9; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode"; PRODUCT_NAME = "SwiftFormat for Xcode"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1283,7 +1283,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.52.8; + MARKETING_VERSION = 0.52.9; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode"; PRODUCT_NAME = "SwiftFormat for Xcode"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1311,7 +1311,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.52.8; + MARKETING_VERSION = 0.52.9; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension"; PRODUCT_NAME = SwiftFormat; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1340,7 +1340,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.52.8; + MARKETING_VERSION = 0.52.9; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension"; PRODUCT_NAME = SwiftFormat; PROVISIONING_PROFILE_SPECIFIER = "";