Skip to content

Commit

Permalink
Updated for 0.27.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Mar 17, 2017
1 parent 1b3d820 commit 1682be6
Show file tree
Hide file tree
Showing 33 changed files with 54 additions and 30 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Change Log

## [0.27.0](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.27.0) (2017-03-17)

- Added `--exclude` command-line option for excluding specific files or folders from formatting
- Improved grouping and logging of errors when using `--verbose` mode
- Fixed a bug when using prefix operators with with shorthand class or enum members like `-.someValue`
- Fixed some more cases where `self` was incorrectly removed, or wasn't removed when it should have been
- Fixed some cases where backtick escaping was incorrectly removed around reserved words
- Fixed a bug where `--patternlet inline` could incorrectly move `let` inside a tuple assignment
- Fixed parsing of custom operators containing chevrons, e.g. `<?>`
- Fixed redundant `return` not being removed from closures in a var declaration
- Fixed a performance regression introduced in version 0.26.2
- Fixed bug where `Void()` literal was replaced by `()()` when using `--empty tuple`

## [0.26.2](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.26.2) (2017-03-15)

- Fixed critical bug where `return` was incorrectly removed after a `#selector` or `#keyPath` directive
Expand Down
2 changes: 1 addition & 1 deletion CommandLineTool/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ CLI.print = { message, type in
}

CLI.readLine = {
return readLine(strippingNewline: false)
readLine(strippingNewline: false)
}

// Pass in arguments
Expand Down
Binary file modified CommandLineTool/swiftformat
Binary file not shown.
2 changes: 1 addition & 1 deletion EditorExtension/Application/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.26.2</string>
<string>0.27.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion EditorExtension/Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>0.26.2</string>
<string>0.27.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</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.
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 @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.26.2</string>
<string>0.27.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>0.26.2</string>
<string>0.27.0</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.
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
<dict>
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
<data>
CRRl89U6j399uN6isbKkINW6qV4=
s3hN+0d5xVo4ncHvdYNaxkFOjzw=
</data>
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
<data>
qn2rg6A/jPbLVYL7FXQSl9udEDI=
x6Mn4/6nRTAdgoXQdwpYFqgdrUQ=
</data>
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
<data>
gY0ntuSuApnfDmsPp5S1b4CYlWM=
ko7adTwZIE02lRMrOLOib3MpgbQ=
</data>
<key>Resources/Base.lproj/Main.storyboardc/ViewController.nib</key>
<data>
dy8v0T5Gh1uFLGHhkRrhktVOWRY=
qMdVFVk7fXLK3fX+tEZTmgFinhI=
</data>
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
<data>
KkesN5Ww2jEB0QDzfpyrR2upAb8=
kb30K473+cggYqTx49UMtYe/DrY=
</data>
<key>Resources/libswiftRemoteMirror.dylib</key>
<data>
Expand Down Expand Up @@ -143,7 +143,7 @@
<dict>
<key>cdhash</key>
<data>
qSiIi3a7mop6kjPr3nhPYvnJBZA=
PhGDlo9XixCO8Wl9qMRaLWgcfXQ=
</data>
<key>requirement</key>
<string>identifier "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension" and anchor apple generic and certificate leaf[subject.CN] = "Mac Developer: Nick Lockwood (XDQ4XJZXHD)" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */</string>
Expand All @@ -152,55 +152,55 @@
<dict>
<key>hash</key>
<data>
CRRl89U6j399uN6isbKkINW6qV4=
s3hN+0d5xVo4ncHvdYNaxkFOjzw=
</data>
<key>hash2</key>
<data>
sNBta6AY++Ya6d+7tX7yhqLjb9A/EyWpDUABA5Uwzwo=
pqOQ8Qh8DCZdr+cow1KGa3r7PjO2IKH0Dre0SihcJn8=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
<dict>
<key>hash</key>
<data>
qn2rg6A/jPbLVYL7FXQSl9udEDI=
x6Mn4/6nRTAdgoXQdwpYFqgdrUQ=
</data>
<key>hash2</key>
<data>
tikkD455Wi+ZShyk5NtSI8GVjmZmtYK/zzgvGYcAH6A=
sxwszUdIitQ7xNrV2k2PkyxQdxco4mftSZXZa4//WAI=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
<dict>
<key>hash</key>
<data>
gY0ntuSuApnfDmsPp5S1b4CYlWM=
ko7adTwZIE02lRMrOLOib3MpgbQ=
</data>
<key>hash2</key>
<data>
6lCsB4FznLXLG+h7kFfIIozlNz5FV/E6dCMi4k7I19I=
4CUsUFnFQ9XUxLvQQ8mJ3O5ctHSUZZNJhutyDY9qGRs=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/ViewController.nib</key>
<dict>
<key>hash</key>
<data>
dy8v0T5Gh1uFLGHhkRrhktVOWRY=
qMdVFVk7fXLK3fX+tEZTmgFinhI=
</data>
<key>hash2</key>
<data>
hIaLYWEuRSzuKFd9dF7zPCuM+B14aXjXwZ4GaVlBc78=
pmYboms3CGm0Jz/k3Zti6RTH96NGKFoRtMQNooerVt0=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
<dict>
<key>hash</key>
<data>
KkesN5Ww2jEB0QDzfpyrR2upAb8=
kb30K473+cggYqTx49UMtYe/DrY=
</data>
<key>hash2</key>
<data>
nuXPYS84i44KXyE3V9z874cjVllTFrabT1ucOFwocbU=
On1LlHqj/B1G8CDg/Y3zC9TRn35kIZlwi2MHBYd1jKA=
</data>
</dict>
<key>Resources/libswiftRemoteMirror.dylib</key>
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,15 @@ To set up SwiftFormat as an Xcode build phase, do the following:

**NOTE:** This will only install the pre-built command-line app, not the source code for the SwiftFormat framework.

2. In the Build Phases section of your project target, add a new Run Script phase before the Compile Sources step. The script should be `"${SRCROOT}/path/to/swiftformat" "${SRCROOT}/path/to/your/swift/code/"` (both paths should be relative to the directory containing your Xcode project).
2. In the Build Phases section of your project target, add a new Run Script phase before the Compile Sources step. The script should be

**NOTE:** This will slightly increase your build time, but shouldn't impact it too much, as SwiftFormat is quite fast compared to compilation. If you do find that it has a noticeable impact, file a bug report and I'll try to diagnose why.
"${SRCROOT}/path/to/swiftformat" "${SRCROOT}/path/to/your/swift/code/"
Both paths should be relative to the directory containing your Xcode project. If you are installing SwiftFormat as a Cocoapod, the swiftformat path will most likely be

"${SRCROOT}/Pods/SwiftFormat/CommandLineTool/swiftformat"

**NOTE:** Adding this script will slightly increase your build time, and will make changes to your source files as you work on them, which can have annoying side-effects such as clearing the undo buffer. You may wish to add the script to your test target rather than your main target, so that it is invoked only when you run the unit tests, and not every time you build the app.


Git pre-commit hook
Expand Down
9 changes: 7 additions & 2 deletions Sources/CommandLine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,13 @@ func processArguments(_ args: [String]) {

// Get path(s) that will be excluded
var excludedURLs = [URL]()
for path in args["exclude"]?.components(separatedBy: ",") ?? [] {
excludedURLs.append(expandPath(path))
if let arg = args["exclude"] {
if inputURLs.isEmpty {
throw FormatError.options("--exclude option has no effect unless an input path is specified")
}
for path in arg.components(separatedBy: ",") {
excludedURLs.append(expandPath(path))
}
}

// Verbose
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.26.2</string>
<string>0.27.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
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
public let version = "0.26.2"
public let version = "0.27.0"

/// An enumeration of the types of error that may be thrown by SwiftFormat
public enum FormatError: Error, CustomStringConvertible {
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.26.2",
"version": "0.27.0",
"license": {
"type": "zlib",
"file": "LICENCE.md"
Expand All @@ -10,7 +10,7 @@
"authors": "Nick Lockwood",
"source": {
"git": "https://github.com/nicklockwood/SwiftFormat.git",
"tag": "0.26.2"
"tag": "0.27.0"
},
"default_subspecs": "Core",
"subspecs": [
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.26.2</string>
<string>0.27.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 1682be6

Please sign in to comment.