diff --git a/CHANGELOG.md b/CHANGELOG.md index d89066324..4ec2afc4c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [0.53.9](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.53.9) (2024-05-12) + +- Fixed bug in `unusedArguments` when shadowing function argument with conditional assignment declaration +- Individual `--lint` errors are no longer shown in `--quiet` mode (restores pre-0.53.8 behavior) + ## [0.53.8](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.53.8) (2024-04-22) - Added `--strict` option to emit non-zero exit code after applying changes in formatting mode diff --git a/CommandLineTool/swiftformat b/CommandLineTool/swiftformat index 46ffd016e..e2654b7d8 100755 Binary files a/CommandLineTool/swiftformat and b/CommandLineTool/swiftformat differ diff --git a/README.md b/README.md index 2675402b3..e21a4b820 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ Another option is to include the binary artifactbundle in your `Package.swift`: ```swift .binaryTarget( name: "swiftformat", - url: "https://github.com/nicklockwood/SwiftFormat/releases/download/0.53.8/swiftformat-macos.artifactbundle.zip", + url: "https://github.com/nicklockwood/SwiftFormat/releases/download/0.53.9/swiftformat-macos.artifactbundle.zip", checksum: "CHECKSUM" ), ``` @@ -252,7 +252,7 @@ let package = Package( name: "BuildTools", platforms: [.macOS(.v10_11)], dependencies: [ - .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.53.8"), + .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.53.9"), ], targets: [.target(name: "BuildTools", path: "")] ) @@ -354,7 +354,7 @@ You can use `SwiftFormat` as a SwiftPM command plugin. ```swift dependencies: [ // ... - .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.53.8"), + .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.53.9"), ] ``` diff --git a/Sources/CommandLine.swift b/Sources/CommandLine.swift index 7100aa2ce..ca8c70a0b 100644 --- a/Sources/CommandLine.swift +++ b/Sources/CommandLine.swift @@ -359,7 +359,7 @@ func processArguments(_ args: [String], environment: [String: String] = [:], in var message = "'\(identifier)' is not a valid reporter" let names = Reporters.all.map { $0.name } if let match = identifier.bestMatches(in: names).first { - message += "(did you mean '\(match)'?)" + message += " (did you mean '\(match)'?)" } throw FormatError.options(message) } diff --git a/Sources/SwiftFormat.swift b/Sources/SwiftFormat.swift index 1d1294c00..9e1ddf95c 100644 --- a/Sources/SwiftFormat.swift +++ b/Sources/SwiftFormat.swift @@ -32,7 +32,7 @@ import Foundation /// The current SwiftFormat version -let swiftFormatVersion = "0.53.8" +let swiftFormatVersion = "0.53.9" public let version = swiftFormatVersion /// The standard SwiftFormat config file name diff --git a/SwiftFormat.podspec.json b/SwiftFormat.podspec.json index aa106a05c..dfea5a011 100644 --- a/SwiftFormat.podspec.json +++ b/SwiftFormat.podspec.json @@ -1,6 +1,6 @@ { "name": "SwiftFormat", - "version": "0.53.8", + "version": "0.53.9", "license": { "type": "MIT", "file": "LICENSE.md" @@ -10,7 +10,7 @@ "authors": "Nick Lockwood", "source": { "git": "https://github.com/nicklockwood/SwiftFormat.git", - "tag": "0.53.8" + "tag": "0.53.9" }, "default_subspecs": "Core", "subspecs": [ diff --git a/SwiftFormat.xcodeproj/project.pbxproj b/SwiftFormat.xcodeproj/project.pbxproj index b445d59d1..f19f44765 100644 --- a/SwiftFormat.xcodeproj/project.pbxproj +++ b/SwiftFormat.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 015AF2CA1DC6A58C008F0A8C /* PerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015AF2C91DC6A58C008F0A8C /* PerformanceTests.swift */; }; 015CE8B12B448CCE00924504 /* SingularizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015CE8B02B448CCE00924504 /* SingularizeTests.swift */; }; 015D3A562995A0340065B2D9 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015D3A552995A0340065B2D9 /* AboutViewController.swift */; }; + 015F83FB2BF1448D0060A07E /* ReporterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015F83FA2BF1448D0060A07E /* ReporterTests.swift */; }; 018541CF1DBA0F17000F82E3 /* XCSourceTextBuffer+SwiftFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 018541CE1DBA0F17000F82E3 /* XCSourceTextBuffer+SwiftFormat.swift */; }; 018E82751D62E730008CA0F8 /* TokenizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 018E82741D62E730008CA0F8 /* TokenizerTests.swift */; }; 01A0EAA81D5DB4CF00A0A8E3 /* SwiftFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 01A0EAA71D5DB4CF00A0A8E3 /* SwiftFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -191,6 +192,7 @@ 015AF2C91DC6A58C008F0A8C /* PerformanceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PerformanceTests.swift; sourceTree = ""; }; 015CE8B02B448CCE00924504 /* SingularizeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SingularizeTests.swift; sourceTree = ""; }; 015D3A552995A0340065B2D9 /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; + 015F83FA2BF1448D0060A07E /* ReporterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReporterTests.swift; sourceTree = ""; }; 018541CE1DBA0F17000F82E3 /* XCSourceTextBuffer+SwiftFormat.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCSourceTextBuffer+SwiftFormat.swift"; sourceTree = ""; }; 018E82741D62E730008CA0F8 /* TokenizerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenizerTests.swift; sourceTree = ""; }; 01A0EAA41D5DB4CF00A0A8E3 /* SwiftFormat.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftFormat.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -380,6 +382,7 @@ 01F17E841E258A4900DCD359 /* CommandLineTests.swift */, 01B3987A1D763424009ADE61 /* FormatterTests.swift */, 01426E4D23AA29B100E7D871 /* ParsingHelpersTests.swift */, + 015F83FA2BF1448D0060A07E /* ReporterTests.swift */, 01A0EAB51D5DB4D000A0A8E3 /* Info.plist */, E4E4D3CD2033F1EF000D7CB1 /* EnumAssociableTests.swift */, E43EF47B202FF47C00E523BD /* OptionDescriptorTests.swift */, @@ -830,6 +833,7 @@ 01C209B32502CF8300E728A2 /* RulesTests+Indentation.swift in Sources */, 01C209B12502CEF700E728A2 /* RulesTests+Linebreaks.swift in Sources */, 015CE8B12B448CCE00924504 /* SingularizeTests.swift in Sources */, + 015F83FB2BF1448D0060A07E /* ReporterTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1134,7 +1138,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.53.8; + MARKETING_VERSION = 0.53.9; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat; @@ -1167,7 +1171,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.53.8; + MARKETING_VERSION = 0.53.9; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat; @@ -1274,7 +1278,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.53.8; + MARKETING_VERSION = 0.53.9; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode"; PRODUCT_NAME = "SwiftFormat for Xcode"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1305,7 +1309,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.53.8; + MARKETING_VERSION = 0.53.9; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode"; PRODUCT_NAME = "SwiftFormat for Xcode"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1333,7 +1337,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.53.8; + MARKETING_VERSION = 0.53.9; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension"; PRODUCT_NAME = SwiftFormat; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1362,7 +1366,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.53.8; + MARKETING_VERSION = 0.53.9; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension"; PRODUCT_NAME = SwiftFormat; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Tests/GithubActionsLogReporterTests.swift b/Tests/ReporterTests.swift similarity index 94% rename from Tests/GithubActionsLogReporterTests.swift rename to Tests/ReporterTests.swift index 41dfbee05..926bba843 100644 --- a/Tests/GithubActionsLogReporterTests.swift +++ b/Tests/ReporterTests.swift @@ -1,5 +1,5 @@ // -// GithubActionsLogReporterTests.swift +// ReporterTests.swift // SwiftFormat // // Created by Jonas Boberg on 2023/02/13. @@ -32,7 +32,7 @@ import XCTest @testable import SwiftFormat -class GithubActionsLogReporterTests: XCTestCase { +class ReporterTests: XCTestCase { func testWrite() throws { let reporter = GithubActionsLogReporter(environment: ["GITHUB_WORKSPACE": "/bar"]) let rule = FormatRules.consecutiveSpaces @@ -45,7 +45,7 @@ class GithubActionsLogReporterTests: XCTestCase { ::warning file=foo.swift,line=2::\(rule.help) (\(rule.name)) """ - let output = try reporter.write() + let output = try XCTUnwrap(reporter.write()) let outputString = String(decoding: output, as: UTF8.self) XCTAssertEqual(outputString, expectedOutput) }