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
Sep 10, 2024 11:02am 0 VERSION_BUMP 451acf57
May 1, 2024 6:46pm 0 VERSION_BUMP eb7afd0e
Apr 14, 2024 9:26pm 0 VERSION_BUMP 8f85d972
Jan 23, 2024 10:21pm 0 VERSION_BUMP 56e3a0f4
Jan 23, 2024 6:54pm 0 VERSION_BUMP ad58024b
Sep 19, 2023 8:02pm 0 VERSION_BUMP ccc66744
Sep 18, 2023 4:09am 0 VERSION_BUMP 58c44e8e
Aug 24, 2023 12:53pm 0 VERSION_BUMP 02e445c0