SwiftLintPlugin

0.51.0

A Swift Package Plugin for SwiftLint
adamayoung/swiftlint-plugin

What's New

0.51.0

2023-05-09T20:32:35Z

What's Changed

Full Changelog: 0.3.2...0.51.0

SwiftLint Swift Package Plugin

A SwiftLint Swift Package plugin.

Setup

Build Tool Plugin

Add the SwiftLintPlugin dependency to your Package.swift file:

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.

Command Plugin

To run SwiftLint from the command line in your Swift Package (e.g. during CI workflows):

swift package swiftlint

Options

The command plugin also supports the following options:

Option Description
--config <path to .swiftlint.yml file> the path to one or more SwiftLint configuration files
--reporter <reporter name> the reporter used to log errors and warnings e.g. github-actions-logging
--strict to upgrade warnings to serious violations

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Mar 17 2024 02:57:51 GMT-0900 (Hawaii-Aleutian Daylight Time)