SwiftFormatPlugin

0.50.3

Swift Package (Command) Plugin to format source code with nicklockwood/SwiftFormat
MarcoEidinger/SwiftFormatPlugin

What's New

0.50.3

2022-10-24T21:08:52Z

feat: 🎸 use nicklockwood/SwiftFormat@0.50.3

SwiftFormatPlugin

A Swift Package Plugin to format source code with SwiftFormat.

Add to Package

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.

Run Plugin

SPM

swift package plugin --allow-writing-to-package-directory format-source-code

You can limit the formatting to a particular target with --target option.

You can also specify SwiftFormat arguments such as --swiftversion.

Example

swift package plugin --allow-writing-to-package-directory format-source-code --target MyLibrary --swiftversion 5.6 --verbose

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.

Run plugin in Xcode 14

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Mar 14 2024 17:52:33 GMT-0900 (Hawaii-Aleutian Daylight Time)