sourcery
« Back to VersTracker
Description:
Meta-programming for Swift, stop writing boilerplate code
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  @merowing_  |  formulae.brew.sh
Category: Developer tools
Tags: swift code-generation meta-programming boilerplate xcode developer-tools
Install: brew install sourcery
About:
Sourcery is a powerful meta-programming tool that automatically generates repetitive Swift code like `Equatable`, `Hashable`, and `Codable` conformance. By scanning your source code and applying user-defined templates, it significantly reduces boilerplate and maintenance overhead. This allows developers to focus on core application logic rather than repetitive implementation details.
Key Features:
  • Automatic code generation using Stencil templates
  • Supports generating `Equatable`, `Hashable`, `Codable`, and custom protocols
  • Annotation-based scanning to target specific types or properties
  • Integrates seamlessly with Xcode and build systems
  • Live editing mode for real-time template updates
Use Cases:
  • Generating boilerplate model code (Equatable, Hashable, Codable)
  • Creating dependency injection boilerplate
  • Generating view model bindings for SwiftUI
  • Automating protocol stubs for testing
Alternatives:
  • Swift-Macro – Apple's native solution; Sourcery offers more flexibility for complex logic and doesn't require a compiler plugin.
  • Rswift – Focuses on type-safe resource access, whereas Sourcery is a general-purpose code generator.
Version History
Detected Version Rev Change Commit
Sep 18, 2025 12:45pm 0 VERSION_BUMP 9a6fdf32
Sep 16, 2025 12:36am 0 VERSION_BUMP 81449c38
Dec 30, 2024 1:03am 0 VERSION_BUMP c47585ab
Oct 25, 2024 4:59am 1 VERSION_BUMP be98835d
Oct 25, 2024 4:55am 1 VERSION_BUMP bad0eb1b