Skip to content

mshurkin/SwiftLintPlugin

Repository files navigation

SwiftLintPlugin

Swift 5.7 SPM Plugin License MIT

A Swift Package Manager Plugin for SwiftLint that will run it before each build

SwiftLint has its own implementation

Add to Package

Add the package as a dependency to your Package.swift:

dependencies: [
    .package(url: "https://github.com/mshurkin/SwiftLintPlugin", from: "0.52.4"),
]

Then add SwiftLintPlugin plugin to your targets:

targets: [
    .target(
        name: "YOUR_TARGET",
        dependencies: [],
        plugins: [
            .plugin(name: "SwiftLintBuildPlugin", package: "SwiftLintPlugin")
        ]
    ),

Add to Project

Add this package to your project dependencies. Select a target and open the Build Phases inspector. Open Run Build Tool Plug-ins and add SwiftLintBuildPlugin from the list.

SwiftLint config

Plugin look for a swiftlint.yml configuration file in the root of your package (in the same folder as Package.swift) and in the target's folder. If files are found in both places, the file in the target's folder is preferred.

Author

Maxim Shurkin

License

SwiftGenPlugin is released under the MIT license. See LICENSE file for more info.