Skip to content

An experimental tool to enforce Swift style and conventions.

License

Notifications You must be signed in to change notification settings

jason0407/SwiftLint

 
 

Repository files navigation

SwiftLint

An experimental tool to enforce Swift style and conventions, loosely based on GitHub's Swift Style Guide.

SwiftLint hooks into Clang and SourceKit to use the AST representation of your source files for more accurate results.

Installation

The easiest way to install SwiftLint is by downloading SwiftLint.pkg from the latest GitHub release and running it.

You can also build from source by cloning this project and running make install.

Usage

Xcode

Integrate SwiftLint into an Xcode scheme to get warnings and errors displayed in the IDE. Just add a new "Run Script Phase" with /usr/local/bin/swiftlint as its contents.

Command Line

$ swiftlint help
Available commands:

   help      Display general or command-specific help
   lint      Print lint warnings and errors for the Swift files in the current directory (default command)
   version   Display the current version of SwiftLint

Run swiftlint in the directory containing the Swift files to lint. Directories will be searched recursively.

Rules

There are only a small number of rules currently implemented, but we hope the Swift community (that's you!) will contribute more over time. Pull requests are encouraged.

The rules that are currently implemented are mostly there as a starting point and are subject to change.

See the Source/SwiftLintFramework/Rules directory to see the currently implemented rules.

License

MIT licensed.

About

An experimental tool to enforce Swift style and conventions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 93.0%
  • Makefile 4.5%
  • Shell 2.5%