mirror of
https://github.com/ProtonMail/protoncore_ios.git
synced 2026-01-16 23:00:24 +00:00
20 lines
703 B
Swift
20 lines
703 B
Swift
import PackagePlugin
|
|
import Foundation
|
|
|
|
@main
|
|
struct SwiftLintPlugin: BuildToolPlugin {
|
|
func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] {
|
|
let swiftlint = "\(context.package.directory.string)/tools/portable_swiftlint/swiftlint"
|
|
let config = "\(context.package.directory.string)/.swiftlint.yml"
|
|
let targetDir = target.directory
|
|
|
|
return [
|
|
.buildCommand(
|
|
displayName: "Running SwiftLint on \(target.name)",
|
|
executable: Path(swiftlint),
|
|
arguments: ["lint", "--no-cache", "--config", config, targetDir.string],
|
|
environment: [:]
|
|
)
|
|
]
|
|
}
|
|
}
|