Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
/ SwiftLintFix Public archive

🧹 A swiftlint + swiftformat runner SPM plugin with pre-commit hooks.

License

Notifications You must be signed in to change notification settings

GoodHatsLLC/SwiftLintFix

Repository files navigation

🧹 SwiftLintFix

SwiftLintFix is a Swift Package Manager plugin which makes it easy to run swiftlint and swiftformat.
It can be run manually from the command line or in Xcode, or automatically on commit.


Install with Swift Package Manager

Add the dependency to your Package.swift

dependencies: [
  .package(url: "https://github.com/GoodHatsLLC/SwiftLintFix.git", from: "0.1.7")
]

If you use SwiftLintFix in a library you might want to make it a conditional dependency to avoid exposing it to your users.

Run from command line

swift package plugin lintfix

Run automatically on commit

You can configure any tooling to run SwiftLintFix from the command line.

SwiftLintFix direct supports use via pre-commit.
If you use it to manage your git hooks you can simply add a section to your .pre-commit-config.yaml file.

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
-   repo: https://github.com/GoodHatsLLC/SwiftLintFix
    rev: v0.1.8
    hooks:
    -   id: swift_lintfix

Configure swiftlint and swiftformat

SwiftLintFix runs a default rule set for swiftlint and swiftformat unless it finds their configuration files at the root of your repo.

.swiftlint
.swiftformat

Credit:

SwiftLintFix was initially forked from Airbnb's style guide.

About

🧹 A swiftlint + swiftformat runner SPM plugin with pre-commit hooks.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages