SwiftLint
What it is
SwiftLint is a free, open-source tool that checks Swift code against style and convention rules generally accepted by the Swift community. It includes more than 200 built-in rules, with opt-in rules disabled by default. A `.swiftlint.yml` file lets projects configure enabled rules, included and excluded paths, and rule settings. SwiftLint can automatically correct certain violations, but doing so overwrites affected files; its documentation says it is designed for valid, compilable Swift source, since non-compiling code can produce unexpected results, especially during autocorrection. The command line supports linting, analysis, baselines, rule listings, and multiple reporters. Integrations include Xcode and Swift Package Manager plugins, pre-commit, Fastlane, Docker, Visual Studio Code, and MegaLinter. Installation options include package managers, prebuilt packages, and building from source. SwiftLint should run with the same Swift toolchain used to compile the project. Analyzer rules are considerably slower than lint rules. The project is MIT licensed, maintained by volunteers, and described by its maintainers as not a commercial product.
For and against
For
- Includes more than 200 built-in rules.
- Projects can customize rules and paths.
- Can automatically correct certain violations.
- Integrates with Xcode and Swift Package Manager.
- MIT licensed and open source.
Against
- Designed for valid, compilable Swift source.
- Analyzer rules are slower than lint rules.
- Autocorrection overwrites affected files.
- Volunteer maintenance time is limited.
The verdict
SwiftLint offers configurable Swift linting, autocorrection for certain issues, and a range of documented integrations at no charge. Use care with autocorrection and match its Swift toolchain to the project.
Who it suits
SwiftLint suits Swift developers and teams who want configurable style checks in their editor, build, or CI workflows.
Plans and prices
SwiftLint
Open-source Swift linting tool · MIT licensed
Read 10 Oct 2026 · github.com
On the record
- Analysis limitation
- SwiftLint is designed to analyze valid, compilable Swift source code, and its analyzer rules are considerably slower than lint rules.github.com · read 9 Oct 2026
- Auto-correction
- SwiftLint can automatically correct certain violations and overwrites the affected files on disk when doing so.github.com · read 9 Oct 2026
- Autocorrection
- SwiftLint can automatically fix correctable violations with `--fix` or `--autocorrect`.github.com · read 10 Oct 2026
- Built-in rules
- SwiftLint includes over 200 rules, and opt-in rules are disabled by default.github.com · read 9 Oct 2026
- CI integrations
- SwiftLint documents a Fastlane action and a Docker image, and says it is embedded in MegaLinter.github.com · read 10 Oct 2026
- Configuration
- File inclusions and exclusions can be configured in a `.swiftlint.yml` configuration file.github.com · read 10 Oct 2026
- Custom rules
- Users can define Swift custom rules, which require building with Bazel, or regex-based custom rules that official builds can run.github.com · read 9 Oct 2026
- Distribution
- The project documents installation through Homebrew, CocoaPods, Mint, Bazel, Swift Package Manager, prebuilt packages, and source builds.github.com · read 9 Oct 2026
- Editor integration
- The documentation describes integration with Visual Studio Code through the `vscode-swiftlint` extension.github.com · read 10 Oct 2026
- Install options
- The documentation lists Homebrew, CocoaPods, Mint, Bazel, a prebuilt package, and building from source as installation options.realm.github.io · read 10 Oct 2026
- Integrations
- Documented integrations include Swift Package Manager and Xcode plugins, pre-commit, Fastlane, Docker, Visual Studio Code, and MegaLinter.github.com · read 9 Oct 2026
- License
- The GitHub repository identifies SwiftLint as MIT licensed.github.com · read 10 Oct 2026
- 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.github.com · read 9 Oct 2026
- Output
- The command line supports linting, analysis, baselines, rule listings, and multiple reporters.github.com · read 10 Oct 2026
- Platform releases
- The 0.65.1 release lists a universal macOS binary, Windows installers and binaries for AMD64 and ARM64, and AMD64 Linux binaries.github.com · read 9 Oct 2026
- Plugin limitation
- The build tool plugin does not directly support configurations located outside the package or project directory.github.com · read 10 Oct 2026
- Purpose
- SwiftLint enforces Swift style and conventions based on rules generally accepted by the Swift community.realm.github.io · read 10 Oct 2026
- Rule engine
- Its rules are predominantly based on SwiftSyntax, with some using Clang and SourceKit to access type information.realm.github.io · read 10 Oct 2026