Skip to content

Commit

Permalink
Updated for 0.39.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Mar 7, 2019
1 parent 1508f12 commit 543df82
Show file tree
Hide file tree
Showing 23 changed files with 55 additions and 39 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,15 @@
# Change Log

## [0.39.5](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.39.5) (2019-03-06)

- Fixed bug in `braces` rule where closing brace was not wrapped onto a new line
- Fixed bug with `braces` rule affecting closures inside a `switch` statements
- Relative indentation is now preserved inside multiline comment blocks
- Fixed indenting of `switch` cases using Swift 5's new `@unknown` attribute
- Fixed some errors in documentation and warning messages
- The `.swift-version` file parser now permits cases like `3.0-PREVIEW-4`
- Fixed the performance test target, which was broken in Xcode 10.1

## [0.39.4](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.39.4) (2019-03-03)

- Added support for Swift 5's new raw string syntax
Expand Down
Binary file modified CommandLineTool/swiftformat
Binary file not shown.
2 changes: 1 addition & 1 deletion EditorExtension/Application/Info.plist
Expand Up @@ -32,7 +32,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.39.4</string>
<string>0.39.5</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion EditorExtension/Extension/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>0.39.4</string>
<string>0.39.5</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Expand Up @@ -32,7 +32,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.39.4</string>
<string>0.39.5</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
Expand Down
Binary file not shown.
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>0.39.4</string>
<string>0.39.5</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
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.
Expand Up @@ -6,35 +6,35 @@
<dict>
<key>Resources/Base.lproj/Main.storyboardc/9ZR-Qg-hHT-view-iDF-FY-6tf.nib</key>
<data>
peDb3D94IHqIuZMUC/UCySa50Eo=
UC48efrG1/wG9QMBlZxexmg1JG4=
</data>
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
<data>
cxVonqYhoeKbXnkAfBjeBt4v0Zc=
NxTteZR/pqwuMV18ciBjb4flBpQ=
</data>
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
<data>
P3vdMedWqL1UKqzR90RqAnC3SnI=
X4BiPf/8ljRV+1GLKy4TC/f6faw=
</data>
<key>Resources/Base.lproj/Main.storyboardc/MainWindowTabViewController.nib</key>
<data>
iBoe25so6M4RSFrdHkhyeGj3K7U=
8+uv9sEZL5iyk5OMjIfbYAKQI4w=
</data>
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
<data>
bt2iEz9V51oUdzO/UZFl5zHTagc=
xueso0CGLMmI+c3vZLx7gCoGUk0=
</data>
<key>Resources/Base.lproj/Main.storyboardc/RulesViewController.nib</key>
<data>
mwjTeYl1+fbqBN6DpLHs75/+4B0=
2rC6gAvWx+DkanDx7EJGTgdqiLA=
</data>
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
<data>
AmXMPdvieE8zBdmZl6bB+ESu20c=
</data>
<key>Resources/Base.lproj/Main.storyboardc/lOk-3C-AtC-view-Efh-0R-Cg8.nib</key>
<data>
tNjcDZ1Q7BtLG9vydSscAlFmLRE=
VPNUik+rK5tnm1R4XmnHpVjRvI4=
</data>
<key>Resources/libswiftRemoteMirror.dylib</key>
<data>
Expand Down Expand Up @@ -182,7 +182,7 @@
<dict>
<key>cdhash</key>
<data>
k63JfmBImOpLOnvKxQLNzRrXQKM=
TX/uiTO/K7wXpYSPSOKSJ6saRls=
</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 @@ -191,66 +191,66 @@
<dict>
<key>hash</key>
<data>
peDb3D94IHqIuZMUC/UCySa50Eo=
UC48efrG1/wG9QMBlZxexmg1JG4=
</data>
<key>hash2</key>
<data>
MD8SuEn5aMwdqHcDgiIQEV8+A5RIqRlnQv74kZ4pd5A=
TKy3OwFxgRRkCHcOPQ+ImRDttBYFh+VNa09GZCR01Yc=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
<dict>
<key>hash</key>
<data>
cxVonqYhoeKbXnkAfBjeBt4v0Zc=
NxTteZR/pqwuMV18ciBjb4flBpQ=
</data>
<key>hash2</key>
<data>
eux9YrsrHUCNof0Q5h823vMjhFrm7WO92jSzQK5Rz/Y=
B1SAm6uU6lKO2lAts6oJQN0PHnuH7a4FDDnvbR+UT/c=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
<dict>
<key>hash</key>
<data>
P3vdMedWqL1UKqzR90RqAnC3SnI=
X4BiPf/8ljRV+1GLKy4TC/f6faw=
</data>
<key>hash2</key>
<data>
WK2D2F+FFGfZ9UTblGy8IFrZxpx3PoOYCUXLswADgpc=
J7q818dMMi/u35qNLsu5Fp4TSnWPdI0SDUOLD9QrB64=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/MainWindowTabViewController.nib</key>
<dict>
<key>hash</key>
<data>
iBoe25so6M4RSFrdHkhyeGj3K7U=
8+uv9sEZL5iyk5OMjIfbYAKQI4w=
</data>
<key>hash2</key>
<data>
21Eti8lDjBeQdzRA8urzbCOhrqmcOADpmRt+Y/ksjOs=
A2fq5lPthZhaVdS8CffVb2ziTUB8wutS5T/JaZBa9PY=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
<dict>
<key>hash</key>
<data>
bt2iEz9V51oUdzO/UZFl5zHTagc=
xueso0CGLMmI+c3vZLx7gCoGUk0=
</data>
<key>hash2</key>
<data>
O9LToV76asj9wvIx1cT2UXV1pjykTLtSUQywOFQKMkE=
Kxw8F0p4NVkOEwZj9lw/Ug1wdzpFAYzB1VuXzOUJw7I=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/RulesViewController.nib</key>
<dict>
<key>hash</key>
<data>
mwjTeYl1+fbqBN6DpLHs75/+4B0=
2rC6gAvWx+DkanDx7EJGTgdqiLA=
</data>
<key>hash2</key>
<data>
yJlT7ucknYl0rd3ufGbBePjmZRFk45M4FP7AubQ4U2Y=
/oFdV4pKJft2M4xzcv9u5lzGCQJY0e/z72rstPu1lvg=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
Expand All @@ -268,11 +268,11 @@
<dict>
<key>hash</key>
<data>
tNjcDZ1Q7BtLG9vydSscAlFmLRE=
VPNUik+rK5tnm1R4XmnHpVjRvI4=
</data>
<key>hash2</key>
<data>
0eCmDAi3WQPWnIX3Px9grI9zsw+BMdw6T3x9fGlwjPE=
xOhPXlzKWcx5JvbYeJyvfus6OxQP2SDBJW3u2/Raif0=
</data>
</dict>
<key>Resources/libswiftRemoteMirror.dylib</key>
Expand Down
2 changes: 1 addition & 1 deletion Sources/Formatter.swift
Expand Up @@ -2,7 +2,7 @@
// Formatter.swift
// SwiftFormat
//
// Version 0.39.4
// Version 0.39.5
//
// Created by Nick Lockwood on 12/08/2016.
// Copyright 2016 Nick Lockwood
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.39.4</string>
<string>0.39.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
18 changes: 12 additions & 6 deletions Sources/Rules.swift
Expand Up @@ -143,7 +143,8 @@ public struct _FormatRules {
func isCaptureList(at i: Int) -> Bool {
assert(formatter.tokens[i] == .endOfScope("]"))
guard formatter.lastToken(before: i + 1, where: {
!$0.isSpaceOrCommentOrLinebreak && $0 != .endOfScope("]") }) == .startOfScope("{"),
!$0.isSpaceOrCommentOrLinebreak && $0 != .endOfScope("]")
}) == .startOfScope("{"),
let nextToken = formatter.nextToken(after: i, where: {
!$0.isSpaceOrCommentOrLinebreak && $0 != .startOfScope("(")
}),
Expand Down Expand Up @@ -712,7 +713,8 @@ public struct _FormatRules {
}
var i = i
if let nextTokenIndex = formatter.index(of: .nonSpace, after: i, if: {
$0 == .startOfScope("(") }), let closingParenIndex = formatter.index(of:
$0 == .startOfScope("(")
}), let closingParenIndex = formatter.index(of:
.endOfScope(")"), after: nextTokenIndex) {
i = closingParenIndex
}
Expand Down Expand Up @@ -1840,12 +1842,14 @@ public struct _FormatRules {
) { formatter in
formatter.forEach(.identifier("get")) { i, _ in
if let previousIndex = formatter.index(of: .nonSpaceOrCommentOrLinebreak, before: i, if: {
$0 == .startOfScope("{") }), let prevKeyword = formatter.last(.keyword, before: previousIndex),
$0 == .startOfScope("{")
}), let prevKeyword = formatter.last(.keyword, before: previousIndex),
[.keyword("var"), .keyword("subscript")].contains(prevKeyword), let openIndex = formatter.index(of:
.nonSpaceOrCommentOrLinebreak, after: i, if: { $0 == .startOfScope("{") }),
let closeIndex = formatter.index(of: .endOfScope("}"), after: openIndex),
let nextIndex = formatter.index(of: .nonSpaceOrCommentOrLinebreak, after: closeIndex, if: {
$0 == .endOfScope("}") }) {
$0 == .endOfScope("}")
}) {
formatter.removeTokens(inRange: closeIndex ..< nextIndex)
formatter.removeTokens(inRange: previousIndex + 1 ... openIndex)
// TODO: fix-up indenting of lines in between removed braces
Expand Down Expand Up @@ -1906,7 +1910,8 @@ public struct _FormatRules {
formatter.forEach(.identifier("_")) { i, _ in
guard formatter.next(.nonSpaceOrCommentOrLinebreak, after: i) != .delimiter(":"),
let prevIndex = formatter.index(of: .nonSpaceOrCommentOrLinebreak, before: i, if: {
[.keyword("let"), .keyword("var")].contains($0) }),
[.keyword("let"), .keyword("var")].contains($0)
}),
let nextNonSpaceIndex = formatter.index(of: .nonSpaceOrLinebreak, after: prevIndex) else {
return
}
Expand Down Expand Up @@ -3191,7 +3196,8 @@ public struct _FormatRules {
formatter.forEach(.startOfScope("(")) { i, _ in
if formatter.last(.nonSpaceOrCommentOrLinebreak, before: i) == .operator("->", .infix),
let nextIndex = formatter.index(of: .nonSpaceOrLinebreak, after: i, if: {
$0 == .endOfScope(")") }), !isArgumentToken(at: nextIndex) {
$0 == .endOfScope(")")
}), !isArgumentToken(at: nextIndex) {
// Replace with Void
formatter.replaceTokens(inRange: i ... nextIndex, with: [.identifier("Void")])
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftFormat.swift
Expand Up @@ -32,7 +32,7 @@
import Foundation

/// The current SwiftFormat version
public let version = "0.39.4"
public let version = "0.39.5"

/// The standard SwiftFormat config file name
public let swiftFormatConfigurationFile = ".swiftformat"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Tokenizer.swift
Expand Up @@ -2,7 +2,7 @@
// Tokenizer.swift
// SwiftFormat
//
// Version 0.39.4
// Version 0.39.5
//
// Created by Nick Lockwood on 11/08/2016.
// Copyright 2016 Nick Lockwood
Expand Down
4 changes: 2 additions & 2 deletions SwiftFormat.podspec.json
@@ -1,6 +1,6 @@
{
"name": "SwiftFormat",
"version": "0.39.4",
"version": "0.39.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.39.4"
"tag": "0.39.5"
},
"default_subspecs": "Core",
"subspecs": [
Expand Down
2 changes: 1 addition & 1 deletion Tests/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.39.4</string>
<string>0.39.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 543df82

Please sign in to comment.