krzysztofzablocki/Sourcery
54.3
Adequate · 3 August 2026
34.2k
lines of production code
Swift
with JavaScript
3
measurements over time
What this system is
Sourcery is a code generation tool for Swift that parses source code using SwiftSyntax to produce boilerplate implementations for common patterns such as Equatable, Hashable, Codable, and mocking. It supports multiple template engines, including Stencil, JavaScript (EJS), and native Swift templates, allowing users to define custom code generation logic. The system provides built-in templates for standard protocols, type introspection, and Linux compatibility, while also supporting custom plugin integration via Swift Package Manager.
How it got here
2016 — Sourcery 2.3.0 release and test expansion
17 changes.
This period focused on the release of Sourcery 2.3.0, introducing support for xcframeworks, Swift Package Manager, and Linux, alongside new build scripts and template features. Significant effort was also dedicated to expanding test coverage for the parser, code generator, and various Swift language constructs.
2017 — Template expansion and test coverage
13 changes.
This period focused on expanding the library of code generation templates, introducing new generators for Swift protocols, testing infrastructure, and JavaScript support. Significant effort was dedicated to building a comprehensive test suite to validate template outputs and ensure compatibility across multiple Xcode and Swift versions.
2018–2022 — Template engine and parsing modernization
14 changes.
This period focused on modernizing the template engine architecture by introducing Swift, Stencil, and JavaScript-based template rendering, alongside migrating to SwiftSyntax for code parsing. The team also expanded the runtime API with type inspection helpers and added comprehensive test coverage for parsing and code generation logic.
2023–2024 — Linux platform support and AST expansion
6 changes.
This period focused on enabling full functionality on the Linux platform by adding specific test cases, stubs, and AST model classes. The work also expanded the Swift type system representation and improved type resolution in the code generator.
Features
Add Sourcery command plugin for Swift Package Manager and Xcode
Users can now run Sourcery code generation directly via Swift Package Manager or Xcode. The new \SourceryCommandPlugin\ automatically locates \.sourcery.yml\ configuration files for each target and executes the Sourcery tool, supporting both SPM and Xcode project workflows.
Plugins/SourceryCommandPlugin · high confidence
Add Swift, Stencil, and JavaScript template renderers
Introduced new template rendering implementations for Swift, Stencil, and JavaScript. The Swift and Stencil templates now explicitly implement the Template protocol's render method, while the new JavaScript template leverages JavaScriptCore to execute EJS-style templates with added error handling for type access.
Sourcery/Generating · high confidence
Add typed type introspection and auto-generated coding/equality/diffable templates
Sourcery now provides built-in templates for generating NSCoding, description, equality/hashable, diffable, and JavaScript export implementations. The \Typed\ and \TypedSpec\ templates introduce runtime type introspection properties (e.g., \isOptional\, \isTuple\, \isClosure\, \isArray\, \isSet\, \isDictionary\) and corresponding unit tests, enabling users to easily generate boilerplate for common Swift patterns without manual implementation.
Sourcery/Templates · high confidence
Added JavaScript EJS templates for code generation
Added a new set of EJS templates for generating JavaScript/TypeScript code, including support for typealiases, protocol compositions, free functions, and equality checks. The templates demonstrate features such as filtering by annotations (e.g., \AutoStruct\), accessing type aliases and their properties, and handling includes across different folders.
SourceryTests/Stub/JavaScriptTemplates · high confidence
Added Linux-specific AST model classes for Swift type system
Added new Linux-specific implementations for core Abstract Syntax Tree (AST) models, including AssociatedType, AssociatedValue, ClosureParameter, EnumCase, Enum, GenericParameter, GenericRequirement, MethodParameter, Method, and Protocol. These files provide the necessary data structures and serialization logic (via NSCoder) to support Swift reflection and code generation on Linux platforms.
SourceryRuntime/Sources/Linux · high confidence
Added framework metadata and public header for SourceryRuntime
The SourceryRuntime framework now includes an Info.plist and a public header (SourceryRuntime.h) that expose version numbers and bundle metadata. This provides the framework with standard macOS/iOS metadata and a public interface for importing the framework.
SourceryRuntime/Supporting Files · high confidence
Added initial Sourcery-Example project structure
The Sourcery-Example directory now contains a complete, buildable iOS project structure. This includes the Xcode project configuration (project.pbxproj), workspace files, and all necessary source files (AppDelegate, ViewController, storyboards, assets, and Info.plist) to support code generation via the Basic.stencil template.
Sourcery-Example · high confidence
Added kiosk admin panel and debugging tools for performance testing
Added a new set of view controllers and supporting files under SourceryTests/Stub/Performance-Code/Kiosk to support performance testing using the Artsy Eidolon codebase. This includes an admin panel (AdminPanelViewController) for switching between staging and production environments, selecting auctions, and toggling debug features; a card testing interface (AdminCardTestingViewController) for validating card reader integration; and a password-protected admin entry point (PasswordAlertViewController) that restricts access to the admin panel. The change also introduces an API ping manager for monitoring connectivity, a bidder details retrieval flow, and various model classes (e.g., Artwork, Sale, Bidder) required for the kiosk's core auction and bidding features.
SourceryTests/Stub/Performance-Code · high confidence
Added new build and development scripts
The repository now includes several new shell and Swift scripts to support the build and development workflow. A Swift script named 'package\_content' merges Swift files for use by the FolderSynchronizer, while 'update-placeholders' updates generated code files with placeholder values. Additionally, 'bootstrap' automates the setup of git pre-commit hooks and CocoaPods, and 'SwiftLint.sh' runs SwiftLint autocorrect and checks. A new 'pre-commit.sh' script enforces coding standards by rejecting commits with focused tests or misplaced views.
Scripts · high confidence
Expanded AST model for Swift type system
The Sourcery runtime now supports a more complete representation of Swift's type system. This includes new AST nodes for \Actor\, \ProtocolComposition\, and specific types for \Array\, \Dictionary\, \Set\, and \GenericType\. Additionally, the \AccessLevel\ enum has been introduced to track visibility modifiers, and the \Attribute\ class now supports a broader range of Swift attributes including \@objc\, \@IBOutlet\, and access control attributes.
SourceryRuntime/Sources/Common/AST · high confidence
Generated runtime types now expose type inspection helpers and NSCoding conformance
The Sourcery runtime library now includes generated Swift files that provide convenience properties for inspecting type characteristics. Specifically, \Typed.generated.swift\ adds computed properties (such as \isOptional\, \isArray\, \isSet\, \isDictionary\, \isTuple\, \isClosure\, \isImplicitlyUnwrappedOptional\, \unwrappedTypeName\, and \actualTypeName\) to \AssociatedValue\, \ClosureParameter\, \MethodParameter\, \TupleElement\, \Typealias\, and \Variable\. Additionally, \Coding.generated.swift\ adds \NSCoding\ conformance to a wide range of internal types (including \ArrayType\, \Method\, \Variable\, etc.), and \AutoHashable.generated.swift\ provides \AutoHashable\ implementations. These changes enhance the runtime API by allowing templates and code generators to easily query type metadata and serialize/deserialize internal state.
SourceryRuntime/Sources/Generated · high confidence
Improved file and group management in generated Xcode projects
Sourcery now provides robust utilities for managing Xcode project structures and file references. New extensions on XcodeProj handle creating and locating groups, ensuring that folder directories are created when needed. Additionally, new utilities for ByteRange and NSRange conversions, along with dry-run output models, support more accurate tracking of generated files and their locations within the project.
Sourcery/Utils · high confidence
Introduce SourceryStencil framework with new template tags and filters
The SourceryStencil framework has been added, providing a new Stencil-based template engine for code generation. This includes a new \newline\ tag for inserting line breaks and a \typed\ tag for iterating over typed bindings. The template environment is extended with numerous filters for inspecting types and variables (such as \computed\, \stored\, \optional\, \tuple\, \extension\, \enum\, \struct\, \protocol\, \initializer\, \class\, \static\, \instance\, and \annotated\), as well as array manipulation filters (\json\, \count\, \isEmpty\, \reversed\, \toArray\, \sorted\, \sortedDescending\, \push\) and access level checks. A \trimEnabled\ option allows for automatic whitespace trimming in templates.
SourceryStencil · high confidence
Introduce SwiftTemplate for code generation
Users can now write code generation templates in Swift instead of the previous template engine. The \SourcerySwift\ module provides the \SwiftTemplate\ class, which parses \.swifttemplate\ files containing \\<% ... %\>\ blocks, compiles them into a binary, and executes them to generate code. This change replaces the older template processing mechanism with a more flexible and powerful Swift-based approach.
SourcerySwift · high confidence
Introduced SourceryUtils utility library
A new 'SourceryUtils' framework has been added to the project, providing shared utilities for path handling, SHA-256 hashing, timestamping, and versioning. This includes extensions for file path operations, cache directory management, and cross-platform (macOS/Linux) SHA-256 implementation.
SourceryUtils · high confidence
Introduces parallel array processing and structured logging
Adds parallel execution helpers (parallelMap, parallelFlatMap, parallelCompactMap, parallelPerform) to Array, enabling concurrent processing of collections. Introduces a new Log enum with configurable levels (errors, warnings, info, verbose) and a Configuration struct to control output, benchmarking, and AST logging. Adds utility extensions for String (trimming, splitting, validation) and new model classes (BytesRange, FileParserResult, TemplateContext) with diffing and encoding support.
SourceryRuntime/Sources/Common · medium confidence
Migrate to SwiftSyntax for code parsing
The SourceryFramework now uses SwiftSyntax as the primary engine for parsing Swift source code, replacing the previous parser implementation. This change introduces new files for parsing classes, structs, enums, protocols, methods, and other AST nodes using the SwiftSyntax library, enabling more robust and accurate extraction of type information, generic parameters, and access levels from the codebase.
SourceryFramework · high confidence
New code generation templates for Swift standard protocols and testing
Added new templates to automatically generate implementations for common Swift protocols and testing infrastructure. The new AutoCases template generates allCases and count properties for enums. AutoCodable provides automatic Codable conformance for structs and enums, handling complex cases like associated values and custom coding keys. AutoEquatable and AutoHashable templates generate Equatable and Hashable conformance for classes, structs, and enums, including support for optional and array properties. AutoLenses creates functional lenses for struct properties. Additionally, a Decorator template implements the decorator pattern for protocols, and a LinuxMain template generates XCTest entry points for Linux platforms.
Templates/Templates · high confidence
Sourcery 2.3.0 release and Linux support improvements
The release introduces support for \withExtendedLifetime\ in templates, fixes for \AutoMockable\ generation with existential \any\ types, and ensures compatibility with Xcode 26. It also updates the Docker workflow to build ARM64 images and fixes a deadlock when using EJS templates in watch mode. Additionally, the release includes fixes for PBXGroup duplication and various parsing improvements.
(repo-wide) · high confidence
Sourcery executable now supports custom cache base path and dry run mode
Users can now specify a custom base path for Sourcery's cache directory using the new --cacheBasePath argument, allowing control over where cached data is stored. Additionally, a new --dry flag enables a dry run mode that outputs results and errors in JSON format without modifying the file system, which is useful for testing configurations. The executable also introduces a --headerPrefix option to add a custom prefix to generated file headers and a --hideVersionHeader flag to suppress the default version header.
SourceryExecutable · high confidence
Support for JavaScript-based EJS templates
Sourcery now supports JavaScript-based EJS templates. This change introduces a new \SourceryJS\ framework that bundles the EJS JavaScript library and provides a Swift \EJSTemplate\ class. This allows users to write and render templates using JavaScript logic within the Swift environment, enabling more complex template rendering capabilities.
SourceryJS · high confidence
Support for xcframeworks and Swift Package Manager in configuration
The configuration system now supports parsing \.xcframework\ paths and Swift Package Manager (SPM) structures. Users can define \xcframeworks\ within project targets and specify package roots and targets in the configuration file, allowing Sourcery to automatically discover and parse source files from these modern build artifacts.
Sourcery · high confidence
SwiftTryCatch library added to the repository
The SwiftTryCatch library, which provides try/catch functionality for Swift by wrapping around Objective-C, has been added to the repository. This includes the header file defining the SwiftTryCatch interface and the implementation file containing the try/catch/finally block handling and exception throwing methods.
TryCatch · high confidence
Behavioural changes
Added SwiftLint configuration and artifact bundle metadata
A new .swiftlint.yml file was added to the Templates directory, configuring the exclusion of the Tests/Generated and Tests/Expected directories from linting. Additionally, a new artifactbundle.info.json.template file was introduced, defining metadata for a Sourcery executable artifact, including supported macOS architectures.
Templates · high confidence
Configures Bundler to use a local vendor directory and exclude test/development groups
A new .bundle/config file has been added to the project root, establishing a local Bundler configuration. This config sets the gem installation path to "Vendor/bundle" and disables shared gems, while excluding the "test" and "development" gem groups from installation. This change ensures that Ruby dependencies are installed locally within the project's vendor directory rather than the system-wide or user-level Gem path, and prevents unnecessary installation of test and development dependencies during deployment or production builds.
.bundle · high confidence
Updated project configuration for Xcode 10, 10.2, and 12.1
The Xcode project file (project.pbxproj) was updated to support multiple versions of Xcode (10, 10.2, and 12.1) and Swift (4, 4.1, 4.2). This ensures the templates can be built and tested across these environments, resolving compatibility issues and fixing build configurations for the template tests and dependencies.
Templates/Templates.xcodeproj · high confidence
Updated test stubs for generated Swift code
The test stubs in SourceryTests/Stub/Result have been updated to reflect the current state of generated code. This includes new or modified files such as AllTypealiases.swift, Basic+Other+SourceryTemplates.swift, Basic+Other+SourceryTemplates\_Linux.swift, Basic.swift, BasicFooExcluded.swift, Function.swift, Other.swift, ProtocolCompositions.swift, and Typealiases.swift. These changes ensure the test suite accurately reflects the expected output for various Swift constructs like typealiases, protocol compositions, and excluded paths.
SourceryTests/Stub/Result · medium confidence
Fixes
Fixed type resolution and aliasing in the code generator
The Composer component was refactored to correctly resolve types, handle typealiases, and process associated types. This ensures that generic parameters, nested types, and protocol associated types are accurately resolved during code generation, preventing crashes and incorrect output.
SourceryRuntime/Sources/Common/Composer · high confidence
Test coverage
Add Linux-specific test cases for AutoMockable and related protocols; Add localized error string stubs for regression testing; Add unit tests for Codable enum serialization; Added Linux-specific test stubs and project configuration; Added Swift template stubs for testing template features; Added Xcode scheme for TemplatesTests; Added comprehensive test coverage for template generation; Added model tests for all supported Swift types; Added stub source files for testing protocol compositions and typealiases; Added template stubs for testing template generation; Added test context files for generated templates; Added test coverage for configuration parsing and code generation; Added test coverage for parsing helpers and verification logic; Added test helper utilities for building types and custom matchers; Added test suite for SourceryLib; Added tests for bundled templates; Added tests for dry-run output generation; Adds test stubs for template and source directories; Expanded parser test coverage for Swift language features; Updated expected test outputs for AutoMockable, AutoCodable, AutoEquatable, AutoHashable, AutoCases, AutoLenses, and LinuxMain templates; Updated generated test files for AutoMockable, AutoEquatable, AutoHashable, and other templates.
Dependencies
Updated Ruby and Swift package dependencies
Updated Ruby dependencies in the Gemfile and Gemfile.lock, including cocoapods 1.14.3, danger 9.5.1, and slather 2.8.5. Updated Swift Package Manager dependencies in Package.resolved and Package.swift, pinning versions for swift-syntax 600.0.1, swift-crypto 3.0.0, and swift-collections 1.1.4, among others.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 54 → 54 (+0.0)
Lenses
- Architecture 100 → 100 (+0.0)
- Maturity 52 → 52 (+0.0)
- Readiness 46 → 46 (+0.0)
- Security 50 → 50 (+0.0)
- Domain Modelling 100 → 100 (+0.0)
Resolved (3)
- Build action pinned to a mutable branch
- High: security finding (details withheld)
- Off-boarding risk: anonymized user #1
New (3)
- High: security finding (details withheld)
- Off-boarding risk: anonymized user #1
- The README mentions 'Sourcery Pro provides a powerful Stencil editor and extends Xcode with the ability to handle live AST templates' but does not describe how to install or configure Sourcery Pro, which is critical for readers who want to buy it. (README.md)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
krzysztofzablocki/Sourcery was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 3 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f9d80ddec1d42b83b776064162ce0a93a0289334 — the exact code this score is about.
- Scored under rubric-2026.08.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer latest.