Updated for 0.41.0 release

This commit is contained in:
Nick Lockwood
2019-11-23 13:39:41 +00:00
parent 60b4931662
commit 0194de8c16
43 changed files with 79 additions and 139 deletions
+1 -1
View File
@@ -1 +1 @@
4.0
4.2
+1
View File
@@ -22,6 +22,7 @@
--indentcase false
--importgrouping testable-bottom
--linebreaks lf
--maxwidth none
--octalgrouping 4,8
--operatorfunc spaced
--patternlet hoist
+21 -12
View File
@@ -1,13 +1,22 @@
language: swift
osx_image: xcode10.1
env:
- LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8
before_install:
- rvm install ruby-2.4.2
install:
- bundle install --without=documentation
script:
- set -o pipefail
- xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Framework)" -sdk macosx clean build test | bundle exec xcpretty
after_success: bundle exec slather
global:
- LC_CTYPE=en_US.UTF-8
matrix:
include:
- os: osx
language: swift
osx_image: xcode10.1
before_install:
- rvm install ruby-2.4.2
install:
- bundle install --without=documentation
script:
- set -o pipefail
- xcodebuild -project SwiftFormat.xcodeproj -scheme "SwiftFormat (Framework)" -sdk macosx clean build test | bundle exec xcpretty
after_success: bundle exec slather
- os: linux
language: generic
sudo: required
dist: trusty
install: eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
script: swift test
+13
View File
@@ -1,5 +1,18 @@
# Change Log
## [0.41.0](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.41.0) (2019-11-23)
- The `wrapArguments` rule can now automatically wrap functions and collections to `--maxwidth`
- Added `—maxwidth` option to specify the width at which code should wrap (currently only used by `wrapArguments` rule)
- Added `—tabwidth` option to help with code indenting and wrapping when using tabs for indent
- Fixed indenting of code wrapped after the `in` in a `for...in` loop
- Fixed indenting of code wrapped before the `is` in an expression
- Added version check for `redundantBackticks` rule to support fixes in Swift 5
- Fixed error when parsing escaped triple-quote in a multiline string
- Fixed bug where a multiline comments before an opening brace could result in corrupted output
- CLI will now fail if .swiftformat file contains an invalid option, instead of ignoring it
- Added support for formatting Swift package manifest files using Xcode Extension
## [0.40.14](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.40.14) (2019-10-28)
- The `redundantReturn` rule no longer incorrectly removes `return` inside `catch let` statements
Binary file not shown.
+1 -1
View File
@@ -32,7 +32,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.40.14</string>
<string>0.41.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
@@ -91,8 +91,7 @@ final class RulesViewController: NSViewController {
.compactMap { optionName in optionsByName[optionName] }
.sorted { $0.descriptor.displayName < $1.descriptor.displayName }
.compactMap { option -> UserSelectionType? in
guard !option.isDeprecated,
option.descriptor.argumentName != FormatOptions.Descriptor.indentation.argumentName else {
guard !option.isDeprecated else {
return nil
}
let descriptor = option.descriptor
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>0.40.14</string>
<string>0.41.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
@@ -32,7 +32,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.40.14</string>
<string>0.41.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
@@ -42,17 +42,17 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>11A1027</string>
<string>11B500</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>19A547</string>
<string>19B89</string>
<key>DTSDKName</key>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1110</string>
<string>1120</string>
<key>DTXcodeBuild</key>
<string>11A1027</string>
<string>11B500</string>
<key>LSMinimumSystemVersion</key>
<string>10.11</string>
<key>NSHumanReadableCopyright</key>
@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>0.40.14</string>
<string>0.41.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
@@ -27,17 +27,17 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>11A1027</string>
<string>11B500</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>19A547</string>
<string>19B89</string>
<key>DTSDKName</key>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1110</string>
<string>1120</string>
<key>DTXcodeBuild</key>
<string>11A1027</string>
<string>11B500</string>
<key>LSMinimumSystemVersion</key>
<string>10.11</string>
<key>NSExtension</key>
@@ -6,48 +6,35 @@
<dict>
<key>Resources/Base.lproj/Main.storyboardc/9ZR-Qg-hHT-view-iDF-FY-6tf.nib</key>
<data>
gmp47iqO53PvL9GveZ9qJdgVjmA=
cR2SAXd1ZcZuUHyErWPvvPOh3V8=
</data>
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
<data>
o9E+w3O9pCQMVOZmDS/w0waUC6Q=
beK5KT2eskEP2d4Y8DHDdlIAwcc=
</data>
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
<data>
IU4KiI1wtvt06pyGQK+W5nPfy/k=
/8WLfd+Q0ZBWV5qVUBD2h1+j0VE=
</data>
<key>Resources/Base.lproj/Main.storyboardc/MainWindowTabViewController.nib</key>
<data>
DtNeN+ltNvit1GULwN+6MWNl9kc=
budYzojNt2aS14K+gYS/GsGu4i4=
</data>
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
<data>
FGeDucVv3O8btwoeogu/3PSMU5I=
TVkb1lN223uQCkJFbwdbF/NAses=
</data>
<key>Resources/Base.lproj/Main.storyboardc/RulesViewController.nib</key>
<data>
sr0oJRZdkQ2+prrScp6huu8huPc=
sUuTsUiBpVAtn2dbOX9yT35wryY=
</data>
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
<data>
Fpuyfh9zwfm9IaqhlADoThv3beY=
</data>
<key>Resources/libswiftRemoteMirror.dylib</key>
<data>
1uY4m6NnbbFKv6vB+SsQ6AwcFEU=
</data>
</dict>
<key>files2</key>
<dict>
<key>Frameworks/libswiftAppKit.dylib</key>
<dict>
<key>cdhash</key>
<data>
UwGlV6bygBO1sYT1w7ElBdCY6m4=
</data>
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftAppKit" and anchor apple generic and 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>
</dict>
<key>Frameworks/libswiftCore.dylib</key>
<dict>
<key>cdhash</key>
@@ -57,15 +44,6 @@
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftCore" 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>
</dict>
<key>Frameworks/libswiftCoreData.dylib</key>
<dict>
<key>cdhash</key>
<data>
M+J8I54X1UdPuKRlMqWbq70hHms=
</data>
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftCoreData" and anchor apple generic and 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>
</dict>
<key>Frameworks/libswiftCoreFoundation.dylib</key>
<dict>
<key>cdhash</key>
@@ -84,15 +62,6 @@
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftCoreGraphics" 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>
</dict>
<key>Frameworks/libswiftCoreImage.dylib</key>
<dict>
<key>cdhash</key>
<data>
UuFrSagjmTdVYVkLqeOBwOx7jtg=
</data>
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftCoreImage" and anchor apple generic and 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>
</dict>
<key>Frameworks/libswiftDarwin.dylib</key>
<dict>
<key>cdhash</key>
@@ -129,15 +98,6 @@
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftIOKit" 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>
</dict>
<key>Frameworks/libswiftMetal.dylib</key>
<dict>
<key>cdhash</key>
<data>
FnA0fIJThH7dm37ZVBgzMVCF4zM=
</data>
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftMetal" and anchor apple generic and 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>
</dict>
<key>Frameworks/libswiftObjectiveC.dylib</key>
<dict>
<key>cdhash</key>
@@ -147,38 +107,11 @@
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftObjectiveC" 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>
</dict>
<key>Frameworks/libswiftQuartzCore.dylib</key>
<dict>
<key>cdhash</key>
<data>
qDed/s0aOXi9OXFw7lceTCZdSGU=
</data>
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftQuartzCore" and anchor apple generic and 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>
</dict>
<key>Frameworks/libswiftXPC.dylib</key>
<dict>
<key>cdhash</key>
<data>
4Sw12mQ/vFcjZNDVL/h/WGeCYlk=
</data>
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftXPC" and anchor apple generic and 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>
</dict>
<key>Frameworks/libswiftos.dylib</key>
<dict>
<key>cdhash</key>
<data>
iJzo5i0LkGw6K/VPt8Pys29pS8Q=
</data>
<key>requirement</key>
<string>identifier "com.apple.dt.runtime.swiftos" and anchor apple generic and 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>
</dict>
<key>PlugIns/SwiftFormat.appex</key>
<dict>
<key>cdhash</key>
<data>
HdlSKLh0lfBavKb8kRUA5bimc7c=
eP0DtnkcJvT8+w+d37CIJGgTQUg=
</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>
@@ -187,66 +120,66 @@
<dict>
<key>hash</key>
<data>
gmp47iqO53PvL9GveZ9qJdgVjmA=
cR2SAXd1ZcZuUHyErWPvvPOh3V8=
</data>
<key>hash2</key>
<data>
3ghgbt/rW2OS4FiHE4S7+qR52F/HreRJOIK4Gb66Q2k=
/7UU+591nZL+pJeSiz7pZmE6whh3C4zs0NQpYDRjtLg=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
<dict>
<key>hash</key>
<data>
o9E+w3O9pCQMVOZmDS/w0waUC6Q=
beK5KT2eskEP2d4Y8DHDdlIAwcc=
</data>
<key>hash2</key>
<data>
M18T7ijrfnk4MrUMjdxUpnq5wOw1BDvKlG3w78m3fV4=
j5Cb/07kIL46Kl50zoLK1EFFTVcnoiGqZRxwaQq3qkQ=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
<dict>
<key>hash</key>
<data>
IU4KiI1wtvt06pyGQK+W5nPfy/k=
/8WLfd+Q0ZBWV5qVUBD2h1+j0VE=
</data>
<key>hash2</key>
<data>
ChQfxUfiNfz+ZmMWpvyYZIIkYVPudNh9LObghgT3VY8=
UT8KbcZ/3W1ko/ACu2Rsspe103TgpUb7XoCN/bvq6tM=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/MainWindowTabViewController.nib</key>
<dict>
<key>hash</key>
<data>
DtNeN+ltNvit1GULwN+6MWNl9kc=
budYzojNt2aS14K+gYS/GsGu4i4=
</data>
<key>hash2</key>
<data>
OJ1O0Xfjfzm1PihoP90d69CfX2z6xboZnIWGRB59ZIU=
L69cMjFWCQ3ZRH8H0sgnGXbmr8QCt0M+prPn6tzi3b0=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
<dict>
<key>hash</key>
<data>
FGeDucVv3O8btwoeogu/3PSMU5I=
TVkb1lN223uQCkJFbwdbF/NAses=
</data>
<key>hash2</key>
<data>
mL+dO/l08V5hhMOKEskN2gstfBxol35n56pIzVXUVF4=
d6ttxOYPb23JfxdNLmWJ19QWSO09xh7ELriEx8KaXIo=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/RulesViewController.nib</key>
<dict>
<key>hash</key>
<data>
sr0oJRZdkQ2+prrScp6huu8huPc=
sUuTsUiBpVAtn2dbOX9yT35wryY=
</data>
<key>hash2</key>
<data>
oSbC2Zrji/kdo65qlJiPBDG+9KT5fJliyiFSV6RAsiY=
v9CbCu0zCGniy+2IIQfDXBeD0B3FGBg6tTJUcJHWvDs=
</data>
</dict>
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
@@ -260,17 +193,6 @@
WZlJzEVKN27feqWkD1ZlvDcYU1YT3ekJb67zOGP6gek=
</data>
</dict>
<key>Resources/libswiftRemoteMirror.dylib</key>
<dict>
<key>hash</key>
<data>
1uY4m6NnbbFKv6vB+SsQ6AwcFEU=
</data>
<key>hash2</key>
<data>
IK6jHZcKpLIxX51C/uueWgjnaTU5qROHPMgc1kWBDro=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
+1 -1
View File
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:4.2
import PackageDescription
let package = Package(
+1 -1
View File
@@ -2,7 +2,7 @@
// Formatter.swift
// SwiftFormat
//
// Version 0.40.14
// Version 0.41.0
//
// Created by Nick Lockwood on 12/08/2016.
// Copyright 2016 Nick Lockwood
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.40.14</string>
<string>0.41.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
+1 -1
View File
@@ -32,7 +32,7 @@
import Foundation
/// The current SwiftFormat version
public let version = "0.40.14"
public let version = "0.41.0"
/// The standard SwiftFormat config file name
public let swiftFormatConfigurationFile = ".swiftformat"
+1 -1
View File
@@ -2,7 +2,7 @@
// Tokenizer.swift
// SwiftFormat
//
// Version 0.40.14
// Version 0.41.0
//
// Created by Nick Lockwood on 11/08/2016.
// Copyright 2016 Nick Lockwood
+4 -3
View File
@@ -1,6 +1,6 @@
{
"name": "SwiftFormat",
"version": "0.40.14",
"version": "0.41.0",
"license": {
"type": "MIT",
"file": "LICENSE.md"
@@ -10,7 +10,7 @@
"authors": "Nick Lockwood",
"source": {
"git": "https://github.com/nicklockwood/SwiftFormat.git",
"tag": "0.40.14"
"tag": "0.41.0"
},
"default_subspecs": "Core",
"subspecs": [
@@ -31,7 +31,8 @@
"platforms": {
"ios": "9.0",
"tvos": "9.0",
"osx": "10.11"
"osx": "10.12"
},
"swift_versions": "4.2",
"requires_arc": true
}
+1 -6
View File
@@ -151,12 +151,7 @@ class CommandLineTests: XCTestCase {
func testFormatting() {
CLI.print = { _, _ in }
#if swift(>=4.1.5)
let args = ". --dryrun"
#else
let args = ". --dryrun --disable redundantSelf" // redundantSelf crashes Xcode 9.4 in debug mode
#endif
let args = ". --dryrun --disable redundantSelf"
XCTAssertEqual(CLI.run(in: projectDirectory.path, with: args), .ok)
}
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.40.14</string>
<string>0.41.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>