一个 Swift Package Manager 插件,用于运行 SwiftFormat。
将此仓库添加到你的包依赖项中
dependencies: [
.package(url: "https://github.com/elegantchaos/SwiftFormatterPlugin", from: "1.0.2"),
/* other dependencies here... */
],
从命令行调用该工具
swift package plugin --allow-writing-to-package-directory format-source-code