Glovo Cecília Saraiva Sep 20, 2021

Swift Code Linting and Formatting Best Practices

Article Summary

Cecília Saraiva from Glovo reveals how their 30+ iOS engineers maintain code consistency without the manual overhead. Spoiler: automation is doing the heavy lifting.

When you've got dozens of engineers contributing to the same codebase, code style chaos is inevitable. Glovo's iOS team tackled this by implementing automated linting and formatting tools that enforce standards without slowing developers down.

Key Takeaways

Critical Insight

Glovo automated code style enforcement across 30+ iOS engineers using SwiftLint in Xcode and SwiftFormat as a pre-commit hook, letting developers focus on building instead of formatting.

The article includes their actual config files showing exactly which rules they enforce and how they integrated these tools into their workflow.

About This Article

Problem

Glovo's iOS team struggled to keep code style consistent across their codebase while following industry standards and internal guidelines. Enforcing this manually created too much overhead.

Solution

They set up SwiftLint to catch style issues during the Xcode build process. SwiftFormat runs as a git pre-commit hook to automatically fix violations before code gets committed.

Impact

Engineers spend less time on code formatting and more time building features. All the rules are documented in one place and agreed on by the team.