Skip to content

Commit

Permalink
Update for 0.48.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Apr 20, 2021
1 parent 8785395 commit 01aff6e
Show file tree
Hide file tree
Showing 43 changed files with 56 additions and 37 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## [0.48.0](/~https://github.com/nicklockwood/SwiftFormat/releases/tag/0.48.0) (2020-04-20)

- Add `--emptybraces` to control how empty braces are formatted
- The `redundantReturn` rule now removes redundant `return` statements in Void functions
- The `redundantParens` rule now removes redundant parens around closure arguments
- Fixed parsing error with complex `guard` statements
- Extended `prefersKeyPath` to support `contains`, `allSatisfy` and `filter` methods
- Fixed matching of excluded paths containing ../
- Added support for using globs/wildcards in input paths
- Eliminated false positives in change list when using `--lint` mode
- File header comments are now inserted after the shebang/hashbang in executable Swift scripts
- Xcode Extension now silently ignores rules requiring file info that isn't available to extensions
- Fixed bug where `wrapEnumCases` rule was incorrectly applied to `if case` or `guard case`
- Added `--report` argument for exporting formatting changes or lint violations as a JSON file
- Improved tab layout in SwiftFormat for Xcode companion app

## [0.47.13](/~https://github.com/nicklockwood/SwiftFormat/releases/tag/0.47.13) (2020-03-21)

- Fixed bug where `--wrapreturntype if-multiline` would unexpectedly wrap a single-line method
Expand Down
Binary file modified CommandLineTool/swiftformat
Binary file not shown.
Binary file modified EditorExtension/SwiftFormat for Xcode.app/Contents/CodeResources
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions EditorExtension/SwiftFormat for Xcode.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.47.13</string>
<string>0.48.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2</string>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>0.47.13</string>
<string>0.48.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2</string>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
</data>
<key>Resources/Assets.car</key>
<data>
gbLTp/AI7g9i1c3Se53BAX8V+48=
MfJM2unUZQPtBwqL4mDxgvR3/z8=
</data>
<key>Resources/Base.lproj/Main.storyboardc/9ZR-Qg-hHT-view-iDF-FY-6tf.nib</key>
<data>
9/zqRrUDqA4WWEAVJ6tE2xq+4/c=
lBv4mtqDP1vHCo8UHg+Wl4a3TRY=
</data>
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
<data>
2e+T6hLEud5F+Yl4N0vaNboy2iU=
L708n8XznpfeO6F0S3cE2u1hdRU=
</data>
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
<data>
dc15nojlDmYCdKABEQsKt9jTqj0=
n8+x2ZsJYHknBHVF0x8QddYoDZM=
</data>
<key>Resources/Base.lproj/Main.storyboardc/MainWindowTabViewController.nib</key>
<data>
eiWHaj4YDaRNKyegerYhcDw8YfA=
I7PN8Sa8QVjne4KTEatN7FTuHz4=
</data>
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
<data>
76HkX6xxh3eouxIkYpPpEfcSsgs=
ABz8CVcMqXZ5GQ9ReBPztm9Rqa4=
</data>
<key>Resources/Base.lproj/Main.storyboardc/RulesViewController.nib</key>
<data>
WrXIeezEqjHgTo0/Tpb40NpehUA=
DqbDes6ypNC2LPw/yq7C5uLCJ7s=
</data>
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
<data>
Expand Down Expand Up @@ -209,7 +209,7 @@
<dict>
<key>cdhash</key>
<data>
Q/5NG3wODVTVKwMPsalBcBr012Y=
b+1+Z62FeL3YCqIgNr2VYKMnOj4=
</data>
<key>requirement</key>
<string>anchor apple generic and identifier "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "8VQKF583ED")</string>
Expand All @@ -225,49 +225,49 @@
<dict>
<key>hash2</key>
<data>
1gAo6mSNXGfNbeldi/9fPoLV9rHoch91SR5yRKtlmts=
WHAZxixqpeacdi4QE0LCdxELfxvoie6KKvHigO0lFoA=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/9ZR-Qg-hHT-view-iDF-FY-6tf.nib</key>
<dict>
<key>hash2</key>
<data>
0Up8gHwQQURdhLh2v+ZmZCUU3Eczic28M3eDlUZ9+1Y=
OZZiDnDqh5gKfQrTrXPEHg8Mers4bXgbjy7CUnBNixs=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
<dict>
<key>hash2</key>
<data>
+K+eD2kvbP/5VV8DtXyy11dPqfYBuhT5gQjkwDhAXzI=
cmXM0rg6A0xrbP5DuULFVkQ02NhssY2aOsOON5RzFVQ=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
<dict>
<key>hash2</key>
<data>
v5jf6dJFfJWJM4eI0JLtsr9ThKt0LUW975p7W+uy8sk=
QE++lPdjL0oTXHDLhzm3+YXoOk3xpo9nhfmdGfsG4T0=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/MainWindowTabViewController.nib</key>
<dict>
<key>hash2</key>
<data>
r0wzRuROTHSqPoSphOAOqajJ/Y4vsxcarZ+u5PFLsBg=
jLYQ2PxRthl2UqiCItgZFJIMuO+85qoqDhcFAeGCx+M=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
<dict>
<key>hash2</key>
<data>
qjvEOaGJWFi0HKtcr4aB468FBhNXA5n0rvhDMDzGrIY=
j8y6SmGQkDepcXoZvS79zHyvDS+FtyEd8NnnTbBlSI0=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/RulesViewController.nib</key>
<dict>
<key>hash2</key>
<data>
TBPVImUzxfe+Kllcq7gsEZ9jLaIAuLjorkA2IHYBoUc=
3obgpbwV3vYQsB2jzf/1aSyIohkU4HrCxcLy/q+XRWA=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ Known issues
Tip Jar
-----------
SwiftFormat is not a commercially-funded product, it's a labour of love given freely to the community. If you find it useful, please consider making a donation.
SwiftFormat is not a commercially-funded product, it's a labor of love given freely to the community. If you find it useful, please consider making a donation.
[![Donate via PayPal](https://www.paypalobjects.com/en_GB/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9ZGWNK5FEZFF6&source=url)
Expand All @@ -799,6 +799,7 @@ Credits
* [Benedek Kozma](/~https://github.com/cyberbeni) - Lint-only rules option
* [Juri Pakaste](/~https://github.com/juri) - Filelist feature
* [Jim Puls](/~https://github.com/puls) - Big Sur icon update
* [Daniele Formichelli](/~https://github.com/danyf90) - JSON reporter
* [Nick Lockwood](/~https://github.com/nicklockwood) - Everything else
([Full list of contributors](/~https://github.com/nicklockwood/SwiftFormat/graphs/contributors))
4 changes: 3 additions & 1 deletion Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,10 @@ Convert trivial `map { $0.foo }` closures to keyPath-based syntax.

```diff
- let barArray = fooArray.map { $0.bar }

+ let barArray = fooArray.map(\.bar)

- let barArray = fooArray.compactMap { $0.optionalBar }
+ let barArray = fooArray.compactMap(\.optionalBar)
```

</details>
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.47.13
// Version 0.48.0
//
// Created by Nick Lockwood on 12/08/2016.
// Copyright 2016 Nick Lockwood
Expand Down
4 changes: 2 additions & 2 deletions Sources/Rules.swift
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ public struct _FormatRules {
help: "Remove redundant type from variable declarations.",
options: ["redundanttype"]
) { formatter in
formatter.forEachToken(where: { (token) -> Bool in
formatter.forEachToken(where: { token -> Bool in
token == .keyword("var") || token == .keyword("let")
}) { i, _ in
guard let colonIndex = formatter.index(after: i, where: {
Expand Down Expand Up @@ -4142,7 +4142,7 @@ public struct _FormatRules {

guard enums.count > 1 else { return } // nothing to sort

let sorted: [Range<Int>] = enums.sorted { (range1, range2) -> Bool in
let sorted: [Range<Int>] = enums.sorted { range1, range2 -> Bool in
let lhs = formatter.tokens[range1]
.compactMap { $0.isIdentifier || $0.isStringBody || $0.isNumber ? $0.string : nil }
let rhs = formatter.tokens[range2]
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.47.13"
let swiftFormatVersion = "0.48.0"
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.47.13
// Version 0.48.0
//
// Created by Nick Lockwood on 11/08/2016.
// Copyright 2016 Nick Lockwood
Expand Down
8 changes: 4 additions & 4 deletions SwiftFormat.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SwiftFormat",
"version": "0.47.13",
"version": "0.48.0",
"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.47.13"
"tag": "0.48.0"
},
"default_subspecs": "Core",
"subspecs": [
Expand All @@ -29,8 +29,8 @@
}
],
"platforms": {
"ios": "9.0",
"tvos": "9.0",
"ios": "11.0",
"tvos": "11.0",
"osx": "10.12"
},
"swift_versions": "4.2",
Expand Down
12 changes: 6 additions & 6 deletions SwiftFormat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.47.13;
MARKETING_VERSION = 0.48.0;
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1127,7 +1127,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.47.13;
MARKETING_VERSION = 0.48.0;
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1223,7 +1223,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.47.13;
MARKETING_VERSION = 0.48.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode";
PRODUCT_NAME = "SwiftFormat for Xcode";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1253,7 +1253,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.47.13;
MARKETING_VERSION = 0.48.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode";
PRODUCT_NAME = "SwiftFormat for Xcode";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1281,7 +1281,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.47.13;
MARKETING_VERSION = 0.48.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension";
PRODUCT_NAME = SwiftFormat;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1311,7 +1311,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.47.13;
MARKETING_VERSION = 0.48.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension";
PRODUCT_NAME = SwiftFormat;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.47.13</string>
<string>0.48.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 01aff6e

Please sign in to comment.