iOS Linting at Pinterest
Article Summary
Michael Schneider from Pinterest built a custom linting system that catches iOS code issues at compile time, not code review. The secret? Clang plugins that hook directly into the compiler's AST.
Pinterest's iOS team needed to enforce coding standards across a rapidly growing codebase with new engineers joining weekly. Off-the-shelf linters weren't flexible enough, so they built PINLinter using Clang's plugin infrastructure to provide instant feedback during compilation.
Key Takeaways
- Custom Clang plugin shows lint warnings directly in Xcode at compile time
- Built escape hatch using custom annotations for legitimate rule exceptions
- Created Texture-specific rules to prevent common AsyncDisplayKit performance issues
- JSON config enables different rule sets for dev versus build machines
Critical Insight
Pinterest built a custom Clang-based linter that catches code quality issues at compile time, providing immediate developer feedback and enforcing framework-specific best practices.