Skip to content

Commit

Permalink
Update for 0.55.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Nov 16, 2024
1 parent 7713c36 commit 5fdd6a5
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 15 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Change Log

## [0.55.0](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.55.0) (2024-11-16)

- Added `docCommentsBeforeModifiers` rule to hoist doc comments above declaration modifiers
- Added `unusedPrivateDeclarations` rule to remove unused `private` or `fileprivate` declarations
- Added `propertyTypes` rule to control the use of inferred or explicit types for properties
- Renamed the `--redundanttype` option to `--propertytypes` as it's shared by both rules
- Added `--ranges preserve` and `--operatorfunc preserve` options
- Added `--languagemode` option to specify if you are using Swift 5 or 6 language mode
- The `organizeDeclarations` rule can now sort declarations by name/type/visibility/etc
- Fixed `organizeDeclarations` bug where `--beforemarks` unexpectedly matched keywords in function bodies
- Fixed missing lint output for `organizeDeclarations` rule
- Fixed bug in `markTypes` rule for chained protocol extension names
- Renamed the confusing `--onelineforeach` option to `--inlinedforeach`
- Git info can now be used in header comments when formatting code from stdin
- You can now use the `--outputtokens` option to print output as tokens in JSON format
- Each rule and test is now defined in a separate file to make it easier to maintain/contribute
- Updated minimum Swift version for building SwiftFormat to 5.3 (you can still format older Swift code)
- Docker build now uses static Linux SDK

## [0.54.6](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.54.6) (2024-10-07)

- Fixed incorrect wrapping of conditional bodies inside single-line string literals
Expand Down
Binary file modified CommandLineTool/swiftformat
Binary file not shown.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Another option is to include the binary artifactbundle in your `Package.swift`:
```swift
.binaryTarget(
name: "swiftformat",
url: "https://github.com/nicklockwood/SwiftFormat/releases/download/0.53.9/swiftformat-macos.artifactbundle.zip",
url: "https://github.com/nicklockwood/SwiftFormat/releases/download/0.55.0/swiftformat-macos.artifactbundle.zip",
checksum: "CHECKSUM"
),
```
Expand Down Expand Up @@ -252,7 +252,7 @@ let package = Package(
name: "BuildTools",
platforms: [.macOS(.v10_11)],
dependencies: [
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.0"),
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.55.0"),
],
targets: [.target(name: "BuildTools", path: "")]
)
Expand Down Expand Up @@ -286,7 +286,7 @@ You can also use `swift run -c release --package-path BuildTools swiftformat "$S
1. Add the `swiftformat` binary to your project directory via [CocoaPods](https://cocoapods.org/), by adding the following line to your Podfile then running `pod install`:
```ruby
pod 'SwiftFormat/CLI', '~> 0.54'
pod 'SwiftFormat/CLI', '~> 0.55'
```
**NOTE:** This will only install the pre-built command-line app, not the source code for the SwiftFormat framework.
Expand Down Expand Up @@ -354,7 +354,7 @@ You can use `SwiftFormat` as a SwiftPM command plugin.
```swift
dependencies: [
// ...
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.0"),
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.55.0"),
]
```
Expand Down
2 changes: 1 addition & 1 deletion Sources/Formatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public extension Formatter {
/// Replaces all of the tokens with the given new tokens,
/// diffing the lines and tracking lines that move without changes.
func replaceAllTokens(with updatedTokens: [Token]) {
guard #available(macOS 10.15, *) else {
guard #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) else {
// Swift's diffing implementation is only available in macOS 10.15+
replaceTokens(in: tokens.indices, with: updatedTokens)
return
Expand Down
1 change: 0 additions & 1 deletion Sources/Rules/RedundantClosure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public extension FormatRule {
Removes redundant closures bodies, containing a single statement,
which are called immediately.
""",
disabledByDefault: false,
orderAfter: [.redundantReturn]
) { formatter in
formatter.forEach(.startOfScope("{")) { closureStartIndex, _ in
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.54.6"
let swiftFormatVersion = "0.55.0"
public let version = swiftFormatVersion

/// The standard SwiftFormat config file name
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.54.6",
"version": "0.55.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.54.6"
"tag": "0.55.0"
},
"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 @@ -2678,7 +2678,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.54.6;
MARKETING_VERSION = 0.55.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat;
Expand Down Expand Up @@ -2711,7 +2711,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.54.6;
MARKETING_VERSION = 0.55.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.SwiftFormat;
Expand Down Expand Up @@ -2818,7 +2818,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.54.6;
MARKETING_VERSION = 0.55.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode";
PRODUCT_NAME = "SwiftFormat for Xcode";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2849,7 +2849,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.54.6;
MARKETING_VERSION = 0.55.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode";
PRODUCT_NAME = "SwiftFormat for Xcode";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2877,7 +2877,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.54.6;
MARKETING_VERSION = 0.55.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension";
PRODUCT_NAME = SwiftFormat;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2906,7 +2906,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.54.6;
MARKETING_VERSION = 0.55.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.charcoaldesign.SwiftFormat-for-Xcode.SourceEditorExtension";
PRODUCT_NAME = SwiftFormat;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down

0 comments on commit 5fdd6a5

Please sign in to comment.