Announce plugin availability in nicklockwood/SwiftFormat directly
📣 I contributed the plugin implementation to nicklockwood/SwiftFormat which is available with 0.50.4 🚨
A Swift Package Plugin to format source code with SwiftFormat.
Add the package to your dependencies.
dependencies: [ // ... .package(url: "https://github.com/MarcoEidinger/SwiftFormatPlugin", from: "0.50.3"), ]
Note: the version matches a SwiftFormat release.
swift package plugin --allow-writing-to-package-directory format-source-code
You can limit the formatting to a particular target with --target option.
--target
You can also specify SwiftFormat arguments such as --swiftversion.
--swiftversion
Example
swift package plugin --allow-writing-to-package-directory format-source-code --target MyLibrary --swiftversion 5.6 --verbose
In Xcode 14 you can trigger the command plugin execution for a Swift package or an Xcode project.
For an Xcode project the project’s main directory will be processed and the --target option will be ignored.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
SwiftFormatPlugin
📣 I contributed the plugin implementation to nicklockwood/SwiftFormat which is available with 0.50.4 🚨
A Swift Package Plugin to format source code with SwiftFormat.
Add to Package
Add the package to your dependencies.
Note: the version matches a SwiftFormat release.
Run Plugin
SPM
You can limit the formatting to a particular target with
--target
option.You can also specify SwiftFormat arguments such as
--swiftversion
.Example
Xcode
In Xcode 14 you can trigger the command plugin execution for a Swift package or an Xcode project.
For an Xcode project the project’s main directory will be processed and the
--target
option will be ignored.You can also specify SwiftFormat arguments such as
--swiftversion
.