SwiftLint
$ swiftlint Community Low RiskWidely adopted Swift static linter enforcing style and SourceKit-backed code conventions configured via .swiftlint.yml. Read-only by default with native --reporter json, --quiet, and opt-in --fix autocorrection.
brew install swiftlint Local Swift AST/SourceKit linter running directly on workspace files; --reporter json makes CLI ideal.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --reporter json, --quiet, --strict, and non-interactive exit codes across lint and analyze.
--reporter jsonemits structured JSON violation arrays--quietsuppresses status banners for clean stdout parsing
Read-only lint by default; only mutates files when --fix (or legacy autocorrect) is explicitly passed.
- Separates
lintread mode from--fixwrite mode
Trivial on macOS via Homebrew and official pkg/zip releases; Linux requires Swift/SourceKit setup and Windows support is limited.
- Relies on Swift / SourceKit (
sourcekitd) on host
De facto Swift code quality gate for iOS and macOS repositories.
- Hundreds of built-in style, bug, and analyzer rules
Actively maintained by Realm/community (realm/SwiftLint) under MIT license.
- Long-standing MIT-licensed Swift standard
Comprehensive rule directory at realm.github.io/SwiftLint/ and swiftlint rules.
- Generated rule docs and CLI help
Security, Auth & Guardrails
Purely local Swift static analysis; no credentials stored or required.
MIT open-source Swift tool; completely free.
# SwiftLint Agent Rules - Run `swiftlint lint --reporter json --quiet` for clean structured diagnostics. - Never pass `--fix` until you have reviewed which rules are enabled in `.swiftlint.yml`, as autocorrection modifies files in place.
Agent-Ready Command Recipes
Safe Read-Only Queries
swiftlint lint --reporter json --quiet
Emits a JSON array of rule violations with file paths, line/column numbers, and severity without modifying files.
swiftlint rules
Lists enabled and disabled SwiftLint rules for the current configuration.
Controlled Writes & Previews
swiftlint --fix --quiet
Rewrites autocorrectable violations in place according to .swiftlint.yml.
Strengths for Agents
- +
--reporter json --quietdelivers clean, parseable JSON violation arrays. - + Clear separation between read-only
lintand opt-in--fix.
Caveats & Pitfalls
- ! Deep
swiftlint analyzerules require anxcodebuildcompiler log; primarily targets macOS/Linux. - ! On Linux, SourceKit (
sourcekitd) must be available on library paths.