SwiftLint Swift Package Plugin
A SwiftLint Swift Package plugin.
Build Tool Plugin
Add the SwiftLintPlugin dependency to your
dependencies: [ .package(url: "https://github.com/adamayoung/swiftlint-plugin.git", from: "0.2.0") ]
For each of the Swift Package targets you want to lint during a build, add the plugin:
targets: [ .target( name: "MyTarget", plugins: [ .plugin(name: "SwiftLint", package: "SwiftLintPlugin") ] ), ... ]
Now, when you build your Swift Package in Xcode, you will get inline SwiftLint warnings and errors.
To run SwiftLint from the command line in your Swift Package (e.g. during CI workflows):
swift package swiftlint
The command plugin also supports the following options:
||the path to one or more SwiftLint configuration files|
||the reporter used to log errors and warnings e.g.
||to upgrade warnings to serious violations|