A Swift Package Manager command plugin for Swift-Format.
No more subjective code formatting discussions. Just use the default configuration. And you get two space indentation. Which is the best. In my opinion. :)
To use this plugin from another package, add a dependency to it:
// swift-tools-version: 5.7
import PackageDescription
let package = Package(
name: "MyLibrary",
dependencies: [
.package(
url: "https://github.com/gujor/swift-format-plugin",
branch: "main"
)
],
targets: [
.target(name: "MyLibrary")
]
)Invoke this command plugin using the swift package invocation:
> swift package --allow-writing-to-package-directory format-source-code