Skip to content

Commit

Permalink
Update for 0.49.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Mar 7, 2022
1 parent 40bff9e commit a07e7dc
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 15 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,15 +19,15 @@
- 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)
- Fixed unsafe removal of `self` inside `if` statements containing postfix operators
- 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
Expand Down
Binary file modified CommandLineTool/swiftformat
Binary file not shown.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion Sources/Formatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftFormat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/Tokenizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions SwiftFormat.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SwiftFormat",
"version": "0.49.4",
"version": "0.49.5",
"license": {
"type": "MIT",
"file": "LICENSE.md"
Expand All @@ -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": [
Expand Down
12 changes: 6 additions & 6 deletions SwiftFormat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down
2 changes: 2 additions & 0 deletions Tests/TokenizerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
Expand Down

0 comments on commit a07e7dc

Please sign in to comment.