Where Does SwiftLint Store Rule Config?
SwiftLint reads .swiftlint.yml in each repo for enabled rules and thresholds, with per directory disables and Xcode build phase integration.
Last updated
SwiftLint configures per repository through .swiftlint.yml holding rule selections, thresholds, and path filters. The file versions with code so every checkout lints identically. Xcode integration runs the same config during builds.
Rule tuning is the ongoing work. Recommended sets provide sane defaults while teams disable noisy rules per directory as needed. Disabled rules document themselves in the file for future revisits.
Where SwiftLint stores this, by platform
.swiftlint.yml
Rule selection plus thresholds versioned per repo. Build phase runs the same config. Pin versions across machines.
.swiftlint.yml
Same repo relative config on Linux CI runners. No local state needed. Versions pin through package managers.
Frequently asked questions
How do I configure SwiftLint?
Add .swiftlint.yml at root with opt in rules and path excludes, then run SwiftLint lint to check. The rules directory documents every identifier with examples. Start from the recommended set and tighten gradually.
How do I run SwiftLint in Xcode?
Add a Run Script phase calling swiftlint with the repo config so violations surface during builds. CI runs the same command for enforcement. Keep versions pinned between machines with Mint or Brew.
Notice an outdated path? Let us know.