SwiftLint
realm.github.io
- Free plan
- Windows
- macOS
- Linux
What SwiftLint 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 project can set active rules, included and excluded paths, and rule settings in a .swiftlint.yml file. SwiftLint can apply corrections to certain violations, overwriting the affected files, and its command line also supports 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 options include package managers, prebuilt packages and source builds. SwiftLint is designed to analyze valid, compilable Swift code; non-compiling code can produce unexpected results, especially when autocorrecting. It should run with the same Swift toolchain used to compile the project. Analyzer rules are considerably slower than lint rules. The MIT-licensed project is maintained by volunteers, and its maintainers describe it as not a commercial product.
Who it suits
SwiftLint suits developers and teams maintaining Swift projects who want configurable style checks in their editor, build or CI workflow. It is a better fit when the code compiles and the project can use a matching Swift toolchain.
Good to know, and what to watch
- Includes more than 200 built-in rules.
- Configures rules and paths through .swiftlint.yml.
- Can automatically correct some violations.
- Integrates with Xcode, Swift Package Manager and CI tools.
- MIT licensed and free.
- Designed for valid, compilable Swift source.
- Analyzer rules are slower than lint rules.
- Autocorrection overwrites affected files.
Plans
Every plan and priceSwiftLint
Open source
The verdict
SwiftLint offers broad rule configuration and integrations for checking Swift projects. Its source-code requirements and file-overwriting autocorrections matter when choosing how to run it.
What the maker publishes
- Analysis limitation
- SwiftLint is designed to analyze valid, compilable Swift source code, and its analyzer rules are considerably slower than lint rules. source
- Auto-correction
- SwiftLint can automatically correct certain violations and overwrites the affected files on disk when doing so. source
- Autocorrection
- SwiftLint can automatically fix correctable violations with `--fix` or `--autocorrect`. source
- Built-in rules
- SwiftLint includes over 200 rules, and opt-in rules are disabled by default. source
- CI integrations
- SwiftLint documents a Fastlane action and a Docker image, and says it is embedded in MegaLinter. source
- Configuration
- Projects can configure enabled rules, included and excluded paths, and rule settings in a .swiftlint.yml file. source
- Configuration
- File inclusions and exclusions can be configured in a `.swiftlint.yml` configuration file. source
- Custom rules
- Users can define Swift custom rules, which require building with Bazel, or regex-based custom rules that official builds can run. source
- Distribution
- The project documents installation through Homebrew, CocoaPods, Mint, Bazel, Swift Package Manager, prebuilt packages, and source builds. source
- Editor integration
- The documentation describes integration with Visual Studio Code through the `vscode-swiftlint` extension. source
- Install options
- The documentation lists Homebrew, CocoaPods, Mint, Bazel, a prebuilt package, and building from source as installation options. source
- Integrations
- Documented integrations include Swift Package Manager and Xcode plugins, pre-commit, Fastlane, Docker, Visual Studio Code, and MegaLinter. source
- License
- The GitHub repository identifies SwiftLint as MIT licensed. source
- 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. source
- Output
- The command line supports linting, analysis, baselines, rule listings, and multiple reporters. source
- Platform releases
- The 0.65.1 release lists a universal macOS binary, Windows installers and binaries for AMD64 and ARM64, and AMD64 Linux binaries. source
- Plugin limitation
- The build tool plugin does not directly support configurations located outside the package or project directory. source
- Purpose
- SwiftLint enforces Swift style and conventions based on rules generally accepted by the Swift community. source
- Purpose
- SwiftLint enforces Swift style and conventions based on rules generally accepted by the Swift community. source
- Rule engine
- Its rules are predominantly based on SwiftSyntax, with some using Clang and SourceKit to access type information. source
- Rule engine
- Its rules are predominantly based on SwiftSyntax, with some using Clang and SourceKit to access type information. source
- Security consideration
- The project warns that bypassing Xcode plugin and macro validation implicitly trusts them and has security implications. source
- 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. source
- Source requirement
- SwiftLint is designed to analyze valid, compilable Swift source code; non-compiling code can produce unexpected results, especially with autocorrection. source
Checked against the maker's pages on 10 Oct 2026.