Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

SwiftLint

$ swiftlint Community Low Risk
Realm · Code & DevOps · MIT · macos / linux

Widely 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.

FCRS-1.0 Score
89 /100
Good
Medium Confidence
Zero-Friction Install
brew install swiftlint
CLI vs MCP Decision CLI Only

Local Swift AST/SourceKit linter running directly on workspace files; --reporter json makes CLI ideal.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Supports --reporter json, --quiet, --strict, and non-interactive exit codes across lint and analyze.

  • --reporter json emits structured JSON violation arrays
  • --quiet suppresses status banners for clean stdout parsing
Trust & Safety 23 / 25

Read-only lint by default; only mutates files when --fix (or legacy autocorrect) is explicitly passed.

  • Separates lint read mode from --fix write mode
Setup & Portability 12 / 15

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
Utility & Efficiency 14 / 15

De facto Swift code quality gate for iOS and macOS repositories.

  • Hundreds of built-in style, bug, and analyzer rules
Maintenance & Lineage 9 / 10

Actively maintained by Realm/community (realm/SwiftLint) under MIT license.

  • Long-standing MIT-licensed Swift standard
Docs & Verifiability 9 / 10

Comprehensive rule directory at realm.github.io/SwiftLint/ and swiftlint rules.

  • Generated rule docs and CLI help

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Purely local Swift static analysis; no credentials stored or required.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source Swift tool; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Lint Swift files with structured JSON output
swiftlint lint --reporter json --quiet

Emits a JSON array of rule violations with file paths, line/column numbers, and severity without modifying files.

Inspect active rules for the project
swiftlint rules

Lists enabled and disabled SwiftLint rules for the current configuration.

Controlled Writes & Previews

Apply autocorrectable SwiftLint fixes
swiftlint --fix --quiet

Rewrites autocorrectable violations in place according to .swiftlint.yml.

Strengths for Agents

  • + --reporter json --quiet delivers clean, parseable JSON violation arrays.
  • + Clear separation between read-only lint and opt-in --fix.

Caveats & Pitfalls

  • ! Deep swiftlint analyze rules require an xcodebuild compiler log; primarily targets macOS/Linux.
  • ! On Linux, SourceKit (sourcekitd) must be available on library paths.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI