Skip to content

Westwing-Home-and-Living/SwiftLintPlugin

 
 

Repository files navigation

GitHub Twitter: @lukeeep_

SwiftLintPlugin

A Swift Package Plugin for SwiftLint that will run SwiftLint on build time and show errors & warnings in Xcode.

Once SwiftLint offers their own implementation, this will be obsolete.

Implementation proposed here by @marcoboerner.

Add to Package

First add a dependency from this package:

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

Then add it to your targets as a plugin:

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

Add to Project

Starting with Xcode 14, plugins can also work on Xcode Project's targets. To do so, simply add this package to your SPM dependencies in Xcode. After that open your target's settings > Build Phases and add SwiftLint to Run Build Tool Plug-ins like shown below:

Screen Shot 2022-09-02 at 09 33 23

You may need to enable & trust the plugin before you can actually run it during builds.


Buy Me A Coffee

About

A Swift Package Plugin for SwiftLint

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%