krzysztofzablocki/Sourcery
58.0
Adequate · 14 November 2026
33.4k
lines of production code
Swift
primary language
6
measurements over time
What this system is
Features
Add Sourcery-Example iOS project with code generation setup
Introduces a new example iOS application that demonstrates the integration of Sourcery for automated code generation. The project includes a basic Swift template (Basic.stencil) that scans for types, and the resulting generated source file (Basic.generated.swift) which lists the detected types (AppDelegate and ViewController). The Xcode project configuration is updated to include the generated code in the build process and references the necessary Pods framework.
Sourcery-Example · high confidence
Added Artsy Eidolon kiosk stub for performance testing
Added a comprehensive set of Swift source files under SourceryTests/Stub/Performance-Code that replicate the Artsy Eidolon kiosk application. This stub includes the app entry point, networking and API ping managers, card reader handling, and various UI view controllers (admin panel, auction selection, bidder details) to serve as a realistic codebase for measuring Sourcery's performance.
SourceryTests/Stub/Performance-Code · high confidence
Added Linux-specific AST model implementations for SourceryRuntime
This change introduces a set of new Swift source files under SourceryRuntime/Sources/Linux/AST to provide Abstract Syntax Tree (AST) model definitions specifically for non-Objective-C (Linux) environments. These files implement core data structures such as AssociatedType, AssociatedValue, ClosureParameter, EnumCase, Enum, GenericParameter, GenericRequirement, MethodParameter, Method, and Protocol. Each class conforms to SourceryModel and SourceryDynamicMemberLookup, enabling dynamic member access and serialization via NSCoder, which ensures the runtime can correctly parse and represent Swift language constructs on Linux platforms where the ObjectiveC module is unavailable.
SourceryRuntime/Sources/Linux · high confidence
Added SwiftLint configuration and Sourcery artifact bundle template
The Templates directory now includes a .swiftlint.yml file that excludes the Tests/Generated and Tests/Expected paths from linting, and an artifactbundle.info.json.template file that defines a Sourcery executable artifact for macOS x86\_64 and arm64 architectures.
Templates · high confidence
Adds Swift Package Manager and Xcode command plugin support
Introduces a new \SourceryCommandPlugin\ that enables running Sourcery code generation directly within Swift Package Manager and Xcode projects. The plugin automatically detects \.sourcery.yml\ configuration files for each target; if a config file is missing, it displays a warning with the specific target name and skips that target. It executes the \SourceryExecutable\ tool using the \--cacheBasePath\ argument pointing to the plugin's work directory, and handles execution failures by reporting the termination reason and status.
Plugins/SourceryCommandPlugin · high confidence
Adds parallel array utilities and foundational runtime models
The Sourcery runtime now includes \Array+Parallel.swift\, providing \parallelMap\, \parallelFlatMap\, \parallelCompactMap\, and \parallelPerform\ methods that execute transformations concurrently using \DispatchQueue.concurrentPerform\. Additionally, new foundational types \BytesRange\ and \FileParserResult\ have been added to support diffing and parsing operations, while \TemplateContext\ has been updated to expose a \jsContext\ property that includes \typealiases\ in its JavaScript export, ensuring type alias information is available to JS-based templates.
SourceryRuntime/Sources/Common · high confidence
Expanded AST model support for Swift language features
The AST layer now includes dedicated model classes for Swift actors, protocol compositions, and generic type names (arrays, dictionaries, sets), along with an explicit access level enum and improved handling of associated types in protocols. This allows templates to access actor-specific modifiers (such as \isDistributed\), resolve generic type parameters in collection types, and inspect protocol composition details, providing richer metadata for code generation.
SourceryRuntime/Sources/Common/AST · high confidence
Incorporated SwiftTryCatch library into the project
The SwiftTryCatch library has been moved directly into this repository, providing Objective-C wrappers for try-catch-finally exception handling that can be used in Swift code. This change introduces the core implementation files (TryCatch.m, TryCatch.h) and the Info.plist configuration, enabling developers to handle exceptions in Swift projects that rely on Objective-C runtime features.
TryCatch · high confidence
Initial project scaffolding and configuration
The repository is initialized with essential configuration files including \.swift-version\ (set to 5.8), \.swiftlint.yml\, \.jazzy.yaml\ for documentation generation, \.codecov.yml\ for coverage settings, and a \Dockerfile\ for containerized builds. It also includes \LINUX.md\ and \LinuxMain.swift\ to support experimental Linux execution, alongside standard project documentation files like \README.md\, \CHANGELOG.md\, and \CONTRIBUTING.md\.
(repo-wide) · high confidence
Introduce SourceryStencil framework with custom template tags and filters
The SourceryStencil location now provides a dedicated framework (SourceryStencil) containing the core Stencil template engine integration. This includes the StencilTemplate class which registers a comprehensive set of filters for inspecting Swift types (such as json, definedInExtension, computed, stored, tuple, optional, based, implements, inherits, extends, extension, enum, struct, protocol, initializer, class, static, instance, annotated) and collections (count, isEmpty, reversed, toArray, sortedValuesByKeys, last, push, sorted, sortedDescending). It also introduces two new custom template tags: 'newline' (via NewLineNode) for inserting newlines and 'typed' (via TypedNode) for binding names to types, along with support for trimming whitespace in templates.
SourceryStencil · high confidence
Introduces bundled code generation templates for AutoCases, AutoCodable, AutoEquatable, AutoHashable, AutoLenses, AutoMockable, Decorator, and LinuxMain
This change adds a suite of new bundled templates to the project, providing out-of-the-box code generation capabilities for common Swift patterns. The new templates include AutoCases for enum case enumeration, AutoCodable for encoding/decoding logic (including support for enums with associated values), AutoEquatable and AutoHashable for value comparison and hashing, AutoLenses for immutable state management, and AutoMockable for generating test doubles with support for async, throwing, and closure parameters. Additionally, it introduces a Decorator template for the decorator pattern and a LinuxMain template to facilitate XCTest discovery on Linux platforms.
Templates/Templates · high confidence
Introduction of SourcerySwift framework for Swift template execution
The SourcerySwift framework has been added to provide the runtime environment for executing Swift-based templates. This includes the \SwiftTemplate\ class, which parses and compiles \.swifttemplate\ files into executable code, and the \SourceryRuntime\ content (bundled in \SourceryRuntime.content.generated.swift\ and \SourceryRuntime\_Linux.content.generated.swift\), which exposes the parsed source code model (types, methods, variables, etc.) to the templates. This change enables users to write templates in Swift instead of Stencil, leveraging the full power of the Swift language for code generation.
SourcerySwift · high confidence
Introduction of SourceryUtils framework with path, hashing, and versioning utilities
A new SourceryUtils framework has been added to provide shared utility functions for the Sourcery tool. This includes path management extensions for handling temporary directories, cache paths, and template file detection (supporting .stencil, .swifttemplate, .ejs, and .sourcerytemplate extensions), SHA-256 hashing capabilities for data integrity checks, and version tracking logic that exposes the current version (2.3.0) while distinguishing between production and test environments.
SourceryUtils · high confidence
JavaScript templates are now supported via a dedicated SourceryJS framework
Users can now write and use JavaScript-based templates (specifically EJS) for code generation. This change introduces the SourceryJS framework, which bundles the EJS engine and provides the EJSTemplate class to render JavaScript templates using a static JavaScriptCore virtual machine. The implementation is split into separate Swift sources for debug and release builds to correctly resolve the bundled EJS resources, enabling JS templates to work reliably in both development and production environments.
SourceryJS · high confidence
New Xcode project structure for bundled templates and tests
The Templates project has been restructured to include a comprehensive set of bundled code-generation templates (AutoCases, AutoEquatable, AutoHashable, AutoLenses, AutoMockable, LinuxMain, and AutoCodable) along with their corresponding Stencil source files, expected outputs, and generated Swift code. This change introduces a dedicated test suite (TemplatesTests) that validates these templates against expected results, and adds a separate CodableContext framework with its own tests to support the AutoCodable template functionality.
Templates/Templates.xcodeproj · high confidence
New code generation templates for coding, equality, description, diffing, and type introspection
Sourcery now includes a set of built-in templates that allow you to automatically generate boilerplate code for common Swift patterns. The new Coding.stencil template generates NSCoding conformance (init(coder:) and encode(with:)) for types implementing AutoCoding. The Equality.stencil template generates isEqual and hash implementations for types implementing AutoEquatable. The Description.stencil template generates a custom description property for types implementing AutoDescription. The Diffable.stencil template generates diffing logic for types implementing AutoDiffable. Additionally, the Typed.stencil template adds convenience properties to TypeName objects (such as isOptional, isTuple, isArray, isSet, isDictionary, isClosure, unwrappedTypeName, and actualTypeName) to simplify type introspection in other templates, and a new JSExport.ejs template generates JavaScriptCore export protocols for types implementing AutoJSExport.
Sourcery/Templates · high confidence
New command-line executable with expanded configuration options
The Sourcery tool now includes a dedicated executable entry point (SourceryExecutable) that exposes a comprehensive set of command-line flags, including support for dry runs with JSON output, serial parsing to improve stability, custom base indentation, documentation comment parsing, and configurable cache and build paths. This change introduces the primary interface for running Sourcery, consolidating configuration validation and argument parsing into a single, robust CLI layer.
SourceryExecutable · high confidence
New utility utilities for byte range conversion, dry-run output, and Xcode project group management
The Sourcery/Utils module introduces several new capabilities: ByteRange and NSRange extensions now support converting between byte and character ranges and calculating content changes, enabling more precise text editing logic. A new DryOutputModels module provides Codable structures for serializing dry-run execution results into JSON. XcodeProj extensions have been added to automatically create nested folder directories when adding groups and to safely add source files to build targets. Additionally, a FolderWatcher utility is included, using FSEvents on macOS to monitor file system changes, with a stub implementation for other platforms.
Sourcery/Utils · high confidence
Support for XCFrameworks and Swift Package Manager in configuration
Sourcery now supports configuring code generation targets via XCFrameworks and Swift Package Manager (SPM) in addition to standard Xcode projects. The configuration parser can now ingest \.xcframework\ paths, automatically locating the embedded \.swiftinterface\ files for parsing, and can load SPM package manifests to identify targets and their source paths. This allows users to generate code from dependencies distributed as frameworks or packages without manually specifying every source file.
Sourcery · high confidence
Support for protocol compositions and typealias annotations in templates
Sourcery now allows EJS templates to access protocol compositions (e.g., \HasFoo & HasBar\) and typealiases, enabling the generation of code for these constructs. This change introduces stub files (\FooBar.swift\, \Bar.swift\, \Foo.swift\) that define protocol compositions and typealiases with specific annotations (like \AutoStruct\ and \showComment\), ensuring that template contexts can correctly resolve and process these Swift language features.
SourceryTests/Stub/Source · high confidence
Template rendering implementations for JavaScript, Stencil, and Swift
This change introduces the concrete rendering logic for three template engines within the Sourcery code generation pipeline. It adds JavaScriptTemplate to handle JavaScript-based templates with error handling for type access, StencilTemplate to wrap Stencil rendering with source path context for errors, and SwiftTemplate to execute Swift templates. These files define how the framework processes and renders templates for each respective language.
Sourcery/Generating · high confidence
Behavioural changes
Added framework metadata and bridging header for SourceryRuntime
The SourceryRuntime framework now includes an Info.plist defining its bundle metadata (such as package type FMWK and version 1.0) and a SourceryRuntime.h bridging header that exposes the framework's version number and string constants to Objective-C consumers.
SourceryRuntime/Supporting Files · high confidence
Centralized test resource path configuration
The test suite now uses a centralized \Stubs\ enum to manage paths for test resources, including Swift and JavaScript templates, source directories (with a specific fallback for Linux), and various result and configuration folders. This change ensures that test assets are correctly located regardless of the build environment (Swift Package Manager vs. Xcode) and platform.
SourceryTests/Stub · high confidence
Configured local bundler path and gem isolation
The project now uses a local vendor directory for bundler dependencies instead of the system-wide or shared gems location. This change isolates the Ruby gem dependencies within the project's Vendor/bundle folder and excludes test and development groups from the default bundle, ensuring consistent dependency resolution across different environments without relying on shared system gems.
.bundle · high confidence
Regenerated runtime model extensions and exports
The generated source files in SourceryRuntime/Sources/Generated have been updated to reflect the latest internal model changes. AutoHashable.generated.swift now provides conformance for both classes/structs and enums. Coding.generated.swift adds NSCoding conformance to a comprehensive list of runtime types (including Method, Variable, Type, etc.) and implements helper decode methods for NSCoder. JSExport.generated.swift exposes the full runtime type graph to JavaScript via new @objc protocols (e.g., ActorAutoJSExport, ClassAutoJSExport), including properties like isDistributed, fileName, and annotations. Typed.generated.swift adds convenience boolean properties (isOptional, isSet, isArray, etc.) to type-bearing nodes like AssociatedValue, ClosureParameter, and Variable.
SourceryRuntime/Sources/Generated · high confidence
Replaces shell scripts with Swift and adds inline update support
The project's scripting infrastructure has been modernized by replacing the previous bash-based package content script with a new Swift implementation (Scripts/package\_content) that merges Swift files for the FolderSynchronizer. An inline update script (Scripts/update-placeholders) has been added to manage autogenerated code placeholders, and the bootstrap process now explicitly installs a pre-commit hook (Scripts/pre-commit.sh) that rejects commits containing focused tests or misplaced UI views. Additionally, a dedicated SwiftLint script (Scripts/SwiftLint.sh) ensures code style checks are run automatically.
Scripts · high confidence
SourceryFramework migrates to SwiftSyntax parser engine
The SourceryFramework now uses the SwiftSyntax parser engine (ParserEngine.swift) instead of the previous implementation, introducing a new SwiftSyntax-based AST layer (AST/ directory) to parse Swift code. This change enables support for modern Swift features including actors, async/await, typed throws, property wrappers, and generic requirements, while also fixing various parsing issues related to access levels, annotations, and type inference.
SourceryFramework · high confidence
Fixes
Fixes to type resolution, generic handling, and protocol composition in the Composer
The Composer module now correctly resolves typealiases, associated types, and generic parameters, preventing crashes and incorrect type inference. Specific fixes include handling collisions between associated type names and concrete types, resolving nested types, supporting generic type information in arrays, and properly parsing protocol composition types. These changes ensure that generated code accurately reflects the source code's type relationships, especially in complex scenarios involving generics, extensions, and protocol inheritance.
SourceryRuntime/Sources/Common/Composer · high confidence
Test coverage
Add localized error stubs for regression testing; Added EJS template stubs for testing typealiases, protocol compositions, and includes; Added Linux-specific test context files for Sourcery templates; Added Linux-specific test stubs and project configuration; Added Swift template stubs for testing include and file inclusion features; Added Xcode scheme for TemplatesTests; Added model tests for Swift 5.5+ features and access levels; Added stub templates for testing template generation and includes; Added test context fixtures for bundled templates; Added test coverage for JavaScript, Stencil, and Swift template generation; Added test coverage for annotation parsing and verification helpers; Added test helper utilities for type building and diffable assertions; Added test symlink for SourceryLibTests; Added tests for Codable enum serialization behavior; Added tests for bundled templates; Added tests for configuration parsing, code generation, and inline behavior; Added tests for dry-run output generation; Expanded parsing test coverage for Swift language features; Updated expected test outputs for bundled templates; Updated generated test fixtures for Sourcery 1.3.0 and 2.3.0; Updated test stubs for generated code results.
Dependencies
Initial dependency manifests and package configuration for Sourcery 2.3.0
This change introduces the foundational dependency management files for the project, establishing the build and distribution configuration for version 2.3.0. It adds a Ruby Gemfile and lockfile pinning tooling dependencies such as CocoaPods 1.14.3, Danger, and Jazzy 0.14.0, alongside a Swift Package Manager manifest (Package.swift) and resolved lockfile that define the project's Swift dependencies, including SwiftSyntax 600.0.1, StencilSwiftKit 2.10.4, and Commander 0.9.1. Additionally, it provides the initial Podspec files for the main Sourcery CLI, SourceryFramework, SourceryRuntime, and SourceryUtils, setting the deployment targets and source file paths for CocoaPods distribution.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 61 → 58 (-3.3)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 81 → 75 (-6.2)
- Architecture 89 → 97 (+7.5)
- Maturity 56 → 57 (+1.7)
- Readiness 56 → 49 (-6.9)
- Security 71 → 69 (-2.2)
Resolved (82)
- Dormant codebase
- Duplicated block (10 lines × 2) (SourceryFramework/Sources/Parsing/SwiftSyntax/AST/TypeName+SwiftSyntax.swift)
- Duplicated block (10 lines × 2) (SourceryRuntime/Sources/Linux/AST/MethodParameter_Linux.swift)
- Duplicated block (10 lines × 2) (SourceryRuntime/Sources/Linux/AST/MethodParameter_Linux.swift)
- Duplicated block (10 lines × 2) (SourceryRuntime/Sources/Linux/AST/TypeName/Closure_Linux.swift)
- Duplicated block (10 lines × 2) (SourceryRuntime/Sources/Linux/AST/Type_Linux.swift)
- Duplicated block (11 lines × 12) (SourceryRuntime/Sources/Common/AST/Attribute.swift)
- Duplicated block (11 lines × 2) (SourceryRuntime/Sources/Linux/AST/ClosureParameter_Linux.swift)
- Duplicated block (11 lines × 2) (SourceryRuntime/Sources/Linux/AST/TypeName/TypeName_Linux.swift)
- Duplicated block (11 lines × 3) (SourceryRuntime/Sources/Common/FileParserResult.swift)
- Duplicated block (11 lines × 3) (SourceryRuntime/Sources/Common/FileParserResult.swift)
- Duplicated block (12 lines × 3) (SourceryFramework/Sources/Parsing/SwiftSyntax/AST/Class+SwiftSyntax.swift)
- Duplicated block (13 lines × 2) (SourceryRuntime/Sources/Linux/AST/GenericRequirement_Linux.swift)
- Duplicated block (14 lines × 2) (SourceryRuntime/Sources/Linux/AST/Type_Linux.swift)
- Duplicated block (14 lines × 2) (SourceryRuntime/Sources/Linux/AST/Type_Linux.swift)
- Duplicated block (15–16 lines × 3) (SourceryRuntime/Sources/Common/AST/Protocol.swift)
- Duplicated block (15–17 lines × 4) (SourceryRuntime/Sources/Linux/AST/Method_Linux.swift)
- Duplicated block (28 lines × 2) (SourceryRuntime/Sources/Linux/TypesCollection_Linux.swift)
- Duplicated block (29 lines × 2) (SourceryRuntime/Sources/Linux/AST/Subscript_Linux.swift)
- Duplicated block (33 lines × 2) (SourceryRuntime/Sources/Linux/AST/Type_Linux.swift)
- …and 62 more
New (276)
- Concentrated knowledge decay
- Dependency not covered by the committed resolution: swift-crypto
- Duplicated block (10 lines × 2) (SourceryFramework/Sources/Parsing/SwiftSyntax/AST/TypeName+SwiftSyntax.swift)
- Duplicated block (10 lines × 2) (SourceryRuntime/Sources/Linux/AST/TypeName/Tuple_Linux.swift)
- Duplicated block (10 lines × 4) (SourceryRuntime/Sources/Linux/AST/MethodParameter_Linux.swift)
- Duplicated block (11 lines × 2) (SourceryRuntime/Sources/Linux/AST/TypeName/Closure_Linux.swift)
- Duplicated block (12 lines × 2) (SourceryRuntime/Sources/Linux/AST/ClosureParameter_Linux.swift)
- Duplicated block (12 lines × 3) (SourceryFramework/Sources/Parsing/SwiftSyntax/AST/Class+SwiftSyntax.swift)
- Duplicated block (12 lines × 4) (SourceryRuntime/Sources/Linux/AST/Subscript_Linux.swift)
- Duplicated block (12 lines × 6) (SourceryRuntime/Sources/Linux/AST/Method_Linux.swift)
- Duplicated block (129 lines × 2) (SourceryRuntime/Sources/Linux/AST/Type_Linux.swift)
- Duplicated block (14 lines × 2) (SourceryRuntime/Sources/Linux/Types_Linux.swift)
- Duplicated block (14–15 lines × 3) (SourceryRuntime/Sources/Common/AST/Protocol.swift)
- Duplicated block (18 lines × 2) (SourceryRuntime/Sources/Linux/AST/Subscript_Linux.swift)
- Duplicated block (26 lines × 2) (SourceryRuntime/Sources/Linux/AST/GenericRequirement_Linux.swift)
- Duplicated block (28 lines × 2) (SourceryRuntime/Sources/Linux/TypesCollection_Linux.swift)
- Duplicated block (29 lines × 2) (SourceryRuntime/Sources/Linux/AST/Subscript_Linux.swift)
- Duplicated block (33 lines × 2) (SourceryRuntime/Sources/Linux/AST/Variable_Linux.swift)
- Duplicated block (34 lines × 2) (SourceryRuntime/Sources/Linux/AST/TypeName/TypeName_Linux.swift)
- Duplicated block (36 lines × 2) (SourceryRuntime/Sources/Common/AST/Protocol.swift)
- …and 256 more
Changes since last survey
- 12 commits — 10 feature/other, 2 fixes
By area
- (root) — 8 commits
- docs/Classes — 2 commits
- (repo) — 1 commit
- Templates/Tests — 1 commit
Notable commits
- fix: Fix race when concurrently rendering the same Swift template
- fix: Merge pull request #1468 from chenrui333/fix-version-2.4.0
- change: Add associated type collision fixture to Linux AutoMockable context
- change: Bump version to 2.4.0
- change: Drop swift-package-manager dependency so Sourcery resolves as a versioned dependency
- change: Make Docker build resilient to Linux-only pins missing from Package.resolved
- change: Pin swift-crypto in Package.resolved for Linux Docker builds
- change: Raise podspec deployment targets to current Xcode minimums
- change: Update Docs
- change: Update Docs
- change: Update Docs
- change: docs: update metadata for 2.4.1 release
Written by cca.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 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit cab806d1ee286110f0fb953c8ef62a2066b77351 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.