Skip to content
SPECIFICTION
Get listed

SwiftLint

realm.github.io

Free plan WindowsmacOSLinux
Visit realm.github.io
Spec score 8.0 #11 of 33 in Linters

What it is

SwiftLint is a free, MIT-licensed tool that checks Swift source against style rules and conventions accepted by the Swift community. It includes more than 200 built-in rules, with opt-in rules disabled by default. A project can set active rules, included and excluded paths, and rule settings in a `.swiftlint.yml` file. SwiftLint can automatically correct some violations, overwriting affected files, and its command line supports linting, analysis, baselines, rule listings, and multiple reporters. Documented integrations include Xcode and Swift Package Manager plugins, pre-commit, Fastlane, Docker, Visual Studio Code, and MegaLinter. Installation choices include package managers, prebuilt packages, and source builds. Releases include macOS, Windows, and Linux binaries. SwiftLint is intended for valid, compilable source, and non-compiling code may produce unexpected results, especially when autocorrecting. Analyzer rules are considerably slower than lint rules. The project is maintained by volunteers, and the maintainers describe it as non-commercial.

Spec sheet

Purpose
SwiftLint enforces Swift style and conventions based on rules generally accepted by the Swift community.Read 10 Oct 2026 · realm.github.io
Integrations
Documented integrations include Swift Package Manager and Xcode plugins, pre-commit, Fastlane, Docker, Visual Studio Code, and MegaLinter.Read 9 Oct 2026 · github.com
Support
The maintainers ask users to support the project by contributing, reporting issues, and helping the community, and note that volunteer time is limited.Read 9 Oct 2026 · github.com
License
The GitHub repository identifies SwiftLint as MIT licensed.Read 10 Oct 2026 · github.com
Analysis limitation
SwiftLint is designed to analyze valid, compilable Swift source code, and its analyzer rules are considerably slower than lint rules.Read 9 Oct 2026 · github.com
Auto-correction
SwiftLint can automatically correct certain violations and overwrites the affected files on disk when doing so.Read 9 Oct 2026 · github.com
Autocorrection
SwiftLint can automatically fix correctable violations with `--fix` or `--autocorrect`.Read 10 Oct 2026 · github.com
Built-in rules
SwiftLint includes over 200 rules, and opt-in rules are disabled by default.Read 9 Oct 2026 · github.com
CI integrations
SwiftLint documents a Fastlane action and a Docker image, and says it is embedded in MegaLinter.Read 10 Oct 2026 · github.com
Configuration
File inclusions and exclusions can be configured in a `.swiftlint.yml` configuration file.Read 10 Oct 2026 · github.com
Custom rules
Users can define Swift custom rules, which require building with Bazel, or regex-based custom rules that official builds can run.Read 9 Oct 2026 · github.com
Distribution
The project documents installation through Homebrew, CocoaPods, Mint, Bazel, Swift Package Manager, prebuilt packages, and source builds.Read 9 Oct 2026 · github.com
Editor integration
The documentation describes integration with Visual Studio Code through the `vscode-swiftlint` extension.Read 10 Oct 2026 · github.com
Install options
The documentation lists Homebrew, CocoaPods, Mint, Bazel, a prebuilt package, and building from source as installation options.Read 10 Oct 2026 · realm.github.io
License and commercial status
SwiftLint is MIT licensed, maintained by volunteers in their free time, and described by its maintainers as not a commercial product.Read 9 Oct 2026 · github.com
Output
The command line supports linting, analysis, baselines, rule listings, and multiple reporters.Read 10 Oct 2026 · github.com
Platform releases
The 0.65.1 release lists a universal macOS binary, Windows installers and binaries for AMD64 and ARM64, and AMD64 Linux binaries.Read 9 Oct 2026 · github.com
Plugin limitation
The build tool plugin does not directly support configurations located outside the package or project directory.Read 10 Oct 2026 · github.com
Rule engine
Its rules are predominantly based on SwiftSyntax, with some using Clang and SourceKit to access type information.Read 10 Oct 2026 · realm.github.io
Security consideration
The project warns that bypassing Xcode plugin and macro validation implicitly trusts them and has security implications.Read 9 Oct 2026 · github.com
Security note
The documentation warns that disabling Xcode plugin and macro validation for unattended use bypasses validation dialogs and implicitly trusts all plugins and macros.Read 10 Oct 2026 · realm.github.io
Source requirement
SwiftLint is designed to analyze valid, compilable Swift source code; non-compiling code can produce unexpected results, especially with autocorrection.Read 10 Oct 2026 · realm.github.io
Swift Package Manager
SwiftLint can run as a Swift Package command plugin or build tool plugin.Read 10 Oct 2026 · realm.github.io
Toolchain requirement
SwiftLint should run with the same Swift toolchain used to compile the project; its development tests require Swift 6.1 or higher, while Swift Package Manager plugins work down to Swift 5.9.Read 9 Oct 2026 · github.com
Xcode integration
SwiftLint supports Xcode projects through a build tool plugin or a Run Script Build Phase.Read 10 Oct 2026 · github.com

Plans and prices

SwiftLint Free Open-source Swift linting tool · MIT licensed Read 10 Oct 2026 · github.com

Every SwiftLint plan and price →

Strong points and limits

Strong points

  • More than 200 built-in rules.
  • Projects can configure rules and paths.
  • Can automatically correct certain violations.
  • Integrates with Xcode and Swift Package Manager.
  • Available for Linux, macOS, and Windows.

Limits

  • Designed for valid, compilable Swift source.
  • Analyzer rules are considerably slower than lint rules.
  • Autocorrection overwrites affected files.
  • Maintainer time is limited to volunteer availability.

Who it suits

SwiftLint suits Swift developers who want configurable style checks in local development, Xcode or Swift Package Manager workflows, or CI. It is also relevant to teams using the listed editor and automation integrations.

Verdict

SwiftLint offers broad rule configuration and integrations for Swift projects at no charge. Use it with compilable source and review changes carefully when enabling automatic correction.

Where Specifiction places it

Alternatives to SwiftLintAll alternatives →