diff --git a/CHANGELOG.md b/CHANGELOG.md index d05b7e07..824b4efa 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log -## [0.49.4](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.49.4) (2021-02-07) +## [0.49.5](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.49.5) (2022-03-06) + +- Fixed bug where `redundantClosure` incorrectly inlined throwing closures +- Fixed bug where in `--exclude` path matching failed when using `--stdinpath` +- Fixed a bug with `typeSugar` rule when overriding stdlib types locally in your code +- Multiline statement braces are now unwrapped if `wrapMultilineStatementBraces` disabled +- Added `// swiftformat:sort` directive to sort declarations by name +- You can now use `--disable all` or `--enable all` as shorthand for all rules +- The rules in the `Rules.md` file are now grouped by their default/enabled status + +## [0.49.4](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.49.4) (2022-02-07) - Fixed creation date being modified on formatted files - Fixed case where a closure inside an if condition was mistaken for the body @@ -9,7 +19,7 @@ - Fixed spurious warning about unused `--wrapparameters` option - Fixed edge case when using `--allman` indenting -## [0.49.3](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.49.3) (2021-01-26) +## [0.49.3](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.49.3) (2022-01-26) - Fixed required `let` being removed inside View Builders - Fixed `blockComments` rule mangling code on next line after comment (really this time) @@ -17,7 +27,7 @@ - Fixed `--selfrequired` behavior inside interpolated strings - Fixed indenting of labelled trailing closures -## [0.49.2](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.49.2) (2021-01-16) +## [0.49.2](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.49.2) (2022-01-16) - Fixed literal values being incorrectly removed by `redundantType` rule - Fixed `redundantSelf` rule removing `self` from shadowed variables after an `as`/`is` condition diff --git a/CommandLineTool/swiftformat b/CommandLineTool/swiftformat index ac703e6e..64e1c057 100755 Binary files a/CommandLineTool/swiftformat and b/CommandLineTool/swiftformat differ diff --git a/README.md b/README.md index abef821a..a294bf00 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ Alternatively, if you prefer not to use Homebrew, you'll find the latest version **Usage:** -Once you have launched the app and restarted Xcode, you'll find a SwiftFormat option under Xcode's Editor menu. +Once you have launched the app and restarted Xcode, you'll find a SwiftFormat option under Xcode's Editor menu. If the SwiftFormat menu does not appear [this thread](https://github.com/nicklockwood/SwiftFormat/issues/494) may help. You can configure the formatting [rules](#rules) and [options](#options) using the SwiftFormat for Xcode host application. There is currently no way to override these per-project, however, you can import and export different configurations using the File menu. You will need to do this again each time you switch projects. @@ -779,6 +779,8 @@ Q. I don't want to be surprised by new rules added when I upgrade SwiftFormat. H Known issues --------------- +* When using the Xcode Source Editor Extension, the SwiftFormat menu sometimes disappears from Xcode. If this happens, try moving or renaming Xcode temporarily and then changing it back. Failing that, the suggestions in [this thread](https://github.com/nicklockwood/SwiftFormat/issues/494) may help. + * The `redundantType` rule can introduce ambiguous code in certain cases when using the default mode of `--redundanttype inferred`. This can be worked around by by using `--redundanttype explicit`, or by manually removing the redundant type reference on the affected line, or by using the `// swiftformat:disable:next redundantType` comment directive to disable the rule at the call site (or just disable the `redundantType` rule completely). * If a type initializer or factory method returns an implicitly unwrapped optional value then the `redundantType` rule may remove the explicit type in a situation where it's actually required. To work around this you can either use `--redundanttype explicit`, or use the `// swiftformat:disable:next redundantType` comment directive to disable the rule at the call site (or just disable the `redundantType` rule completely). diff --git a/Sources/Formatter.swift b/Sources/Formatter.swift index e7018ae2..92a5f243 100644 --- a/Sources/Formatter.swift +++ b/Sources/Formatter.swift @@ -2,7 +2,7 @@ // Formatter.swift // SwiftFormat // -// Version 0.49.4 +// Version 0.49.5 // // Created by Nick Lockwood on 12/08/2016. // Copyright 2016 Nick Lockwood diff --git a/Sources/SwiftFormat.swift b/Sources/SwiftFormat.swift index 64c3de0c..3a313938 100644 --- a/Sources/SwiftFormat.swift +++ b/Sources/SwiftFormat.swift @@ -32,7 +32,7 @@ import Foundation /// The current SwiftFormat version -let swiftFormatVersion = "0.49.4" +let swiftFormatVersion = "0.49.5" public let version = swiftFormatVersion /// The standard SwiftFormat config file name diff --git a/Sources/Tokenizer.swift b/Sources/Tokenizer.swift index 98d70a23..47ac4703 100644 --- a/Sources/Tokenizer.swift +++ b/Sources/Tokenizer.swift @@ -2,7 +2,7 @@ // Tokenizer.swift // SwiftFormat // -// Version 0.49.4 +// Version 0.49.5 // // Created by Nick Lockwood on 11/08/2016. // Copyright 2016 Nick Lockwood diff --git a/SwiftFormat.podspec.json b/SwiftFormat.podspec.json index 88a9b250..4e687956 100644 --- a/SwiftFormat.podspec.json +++ b/SwiftFormat.podspec.json @@ -1,6 +1,6 @@ { "name": "SwiftFormat", - "version": "0.49.4", + "version": "0.49.5", "license": { "type": "MIT", "file": "LICENSE.md" @@ -10,7 +10,7 @@ "authors": "Nick Lockwood", "source": { "git": "https://github.com/nicklockwood/SwiftFormat.git", - "tag": "0.49.4" + "tag": "0.49.5" }, "default_subspecs": "Core", "subspecs": [ diff --git a/SwiftFormat.xcodeproj/project.pbxproj b/SwiftFormat.xcodeproj/project.pbxproj index 29b6203e..ebe079c9 100644 --- a/SwiftFormat.xcodeproj/project.pbxproj +++ b/SwiftFormat.xcodeproj/project.pbxproj @@ -1080,7 +1080,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 0.49.4; + MARKETING_VERSION = 0.49.5; PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1108,7 +1108,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 0.49.4; + MARKETING_VERSION = 0.49.5; PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1204,7 +1204,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.49.4; + MARKETING_VERSION = 0.49.5; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode"; PRODUCT_NAME = "SwiftFormat for Xcode"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1234,7 +1234,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.49.4; + MARKETING_VERSION = 0.49.5; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode"; PRODUCT_NAME = "SwiftFormat for Xcode"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1262,7 +1262,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.49.4; + MARKETING_VERSION = 0.49.5; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension"; PRODUCT_NAME = SwiftFormat; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1292,7 +1292,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.49.4; + MARKETING_VERSION = 0.49.5; PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension"; PRODUCT_NAME = SwiftFormat; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Tests/TokenizerTests.swift b/Tests/TokenizerTests.swift index 04211c27..2e76b842 100644 --- a/Tests/TokenizerTests.swift +++ b/Tests/TokenizerTests.swift @@ -1194,11 +1194,13 @@ class TokenizerTests: XCTestCase { XCTAssertEqual(tokenize(input), output) } + #if os(macOS) func testEmoji() { let input = "🙃" let output: [Token] = [.identifier("🙃")] XCTAssertEqual(tokenize(input), output) } + #endif func testBacktickEscapedClass() { let input = "`class`"