Bespoke Artisanal Swift Static Analysis
summary
Shows how to build custom Swift static analysis using SourceKit requests (editor open, index, cursor info) plus SwiftLint’s analyzer pipeline to get type-checked info without forking the compiler. Implements rules to find dead code and unused imports, runs via swiftlint analyze with build log compiler args, and uncovers concrete results: about 1,400 unused imports and removal of 70 direct dependencies at Lyft. Notes limitations like missing USRs for operators and false positives for IBOutlets and protocol-only use, and uses SourceKit and SwiftLint as the core tools.
AI-written summary · about
chapters (9)
- 0:00Start
- 0:50What Is Static Analysis
- 2:56Objective C
- 6:51The Ingredients of a Static Analysis Pipeline
- 8:28Swift Lint
- 10:12Source Kit
- 11:53Index Request
- 14:10Unique Symbol Resolution Identifier
- 23:16Challenges








