Skip to content
CAI
Software that uses CAICheck a score

nicklockwood/SwiftFormat

56.3

Adequate · 14 November 2026

76.6k

lines of production code

Swift

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Colors example app demonstrating expression-based color parsing

The Colors example application has been added to the Snapshots/Expression/Examples directory. This iOS app demonstrates the Expression library's capability to parse color strings, supporting named colors (e.g., 'red', 'blue'), hex formats (3, 4, 6, and 8-digit), and rgb/rgba functions. The implementation includes a UIColor extension that evaluates these expressions to set view colors, providing a concrete usage example for the library's expression evaluation features.

Snapshots/Expression/Examples/Colors · high confidence

Add Consumer project snapshot

Added a new snapshot containing the source code for the Consumer framework, including the public header, the core Consumer enum and matching logic, and the compiler extension that generates Swift parsing functions.

Snapshots/Consumer/Sources · high confidence

Add Consumer project snapshot with JSON and REPL examples

Added a new snapshot directory for the Consumer project containing example implementations. This includes a JSON parser example demonstrating interpreted, handwritten, and compiled parsing strategies, along with a REPL example showcasing expression evaluation and variable assignment.

Snapshots/Consumer/Examples · high confidence

Add Consumer project snapshot with Swift 5.0 support

A new snapshot project for the Consumer library has been added, establishing Swift 5.0 as the target language version and including standard project scaffolding such as a SwiftFormat configuration, an MIT license, and a Linux test entry point.

Snapshots/Consumer · high confidence

Add Expression and AnyExpression snapshot sources

Added the \Expression\ and \AnyExpression\ source files (version 0.12.12) to the \Snapshots/Expression/Sources\ directory. These files provide the core implementation for parsing and evaluating mathematical and logical expressions, including support for variables, operators, functions with specific arities, and custom symbol evaluators.

Snapshots/Expression/Sources · high confidence

Add SwiftFormat command plugin for Swift packages and Xcode projects

Developers can now run SwiftFormat directly via Swift Package Manager or Xcode using the new SwiftFormatPlugin. This plugin integrates the SwiftFormat tool into the build workflow, allowing users to format source code for all targets in a package or specific targets selected via the \--target\ argument. It supports both Swift package contexts and Xcode project contexts, ensuring consistent code formatting across different development environments.

Plugins/SwiftFormatPlugin · high confidence

Add SwiftUI snapshot projects

Added several new SwiftUI snapshot projects (Bookworm, CupcakeCorner, GuessTheFlag, Moonshot, WordScramble) to demonstrate various UI patterns and data handling, along with a .swiftformat configuration file for consistent code formatting.

Snapshots/SwiftUI · high confidence

Added Layout example application

The Snapshots/Expression/Examples/Layout directory now includes a complete iOS example application demonstrating the Expression layout library. This includes the AppDelegate, a ViewController for interactive layout editing, and a View extension (View+Layout.swift) that implements the core layout logic, supporting properties like left, top, width, and height with expression parsing and circular reference detection.

Snapshots/Expression/Examples/Layout · high confidence

Added Linux support and Swift toolchain configuration for Euclid and Expression snapshots

The Euclid and Expression snapshot projects now include configuration files and entry points to support testing on Linux. Specifically, \.swift-version\ files were added to specify Swift 4.2 for Euclid and Swift 4.0 for Expression, and \LinuxMain.swift\ files were introduced to register and run XCTest suites on Linux platforms. Additionally, \.swiftformat\ configuration files were added to standardize code formatting rules for these projects.

Snapshots/Euclid, Snapshots/Expression · high confidence

Added REPL snapshot example for expression evaluation

A new REPL (Read-Eval-Print Loop) example has been added to the Snapshots/Expression/Examples directory. This Swift script demonstrates how to parse and evaluate expressions interactively, supporting variable assignment, function definitions, and error handling while filtering out control characters to prevent input confusion.

Snapshots/Expression/Examples/REPL · high confidence

Added Swift 5.5 async/await and concurrency sample code

Added new snapshot files demonstrating Swift 5.5 concurrency features, including actors, async/await functions, async let, async sequences, effectful properties, and Sendable closures.

Snapshots/Async · high confidence

Added Swift macro examples and snapshot files

The Snapshots/Macros location now includes example source files demonstrating various Swift macros, including \stringify\, \addBlocker\, \URL\, \Observable\, \DictionaryStorage\, and \MyOptionSet\. These files serve as a snapshot or test harness to illustrate macro usage and behavior.

Snapshots/Macros · high confidence

Added example applications for Euclid and Expression libraries

New example projects have been added to demonstrate the usage of the Euclid and Expression libraries. The Euclid example showcases 3D scene creation and mesh operations using SceneKit, while the Expression examples include a Calculator app for evaluating mathematical expressions and a Benchmark app for comparing the performance of different expression evaluation methods.

Snapshots/Euclid/Example, Snapshots/Expression/Examples/Benchmark, Snapshots/Expression/Examples/Calculator · high confidence

Automated GitHub Pages site generation with prerelease documentation and dark mode support

The project now includes a Ruby script (\site/site\_content.rb\) that automatically generates the GitHub Pages site content from the repository's documentation. This automation creates an index page from the README, a stable rules page, and a new \/rules/prerelease\ page that fetches and displays rules from the \develop\ branch for unreleased features. The generated site also supports syntax highlighting for both light and dark themes, ensuring consistent code block rendering across user preferences.

ruby · high confidence

Initial UI layout for SwiftFormat for Xcode preferences

The main storyboard for the SwiftFormat for Xcode application has been created, establishing the foundational user interface for the preferences window. This includes the standard macOS application menu structure (File, Edit, Services) with specific actions for opening, saving, and resetting configuration files, as well as the core window layout required for the extension's settings.

EditorExtension/Application/Base.lproj · high confidence

Initial Xcode workspace configuration added

The project now includes the standard Xcode workspace structure, adding the workspace data file, workspace settings (with Previews and autocreate contexts disabled), and IDE workspace checks. This establishes the foundational build environment for the SwiftFormat project.

SwiftFormat.xcodeproj/project.xcworkspace · high confidence

Initial project scaffolding and configuration

The repository is initialized with essential configuration files, including \.swiftformat\ to define default formatting rules and options, \.gitignore\ and \.dockerignore\ to manage build artifacts, and a \Dockerfile\ for containerized builds. Documentation and contribution guidelines are added via \README.md\, \CONTRING.md\, and \CLAUDE.md\, alongside a \Rakefile\ for site generation and a \.pre-commit-hooks.yaml\ file to integrate the tool into pre-commit workflows.

(repo-wide) · high confidence

Initial release of the Euclid 3D geometry library

This change introduces the core source files for the Euclid library, adding foundational 3D geometry types such as Vector, Bounds, Plane, Path, Polygon, and Mesh. It includes Boolean operations for meshes (union, subtract, intersect, xor, stencil), path manipulation utilities, and platform-specific integrations for CoreGraphics, CoreText, and SceneKit to enable text extrusion and 3D rendering.

Snapshots/Euclid/Sources · high confidence

Initial release of the Layout declarative UI framework and Xcode extension

This change introduces the Layout framework, a declarative UI system for iOS and macOS that allows developers to define view hierarchies using XML files. The diff adds the core library implementation, including XML parsing, expression evaluation, and layout node management, along with a debug console for displaying errors in a red box overlay. It also includes an Xcode Source Editor extension that enables formatting of Layout XML files directly within the IDE, and a benchmarking application to compare Layout performance against standard Auto Layout.

Snapshots/Layout · high confidence

Initial release of the SwiftFormat command-line tool

This change introduces the \CommandLineTool\ entry point (\main.swift\), establishing the executable interface for SwiftFormat. It configures platform-specific imports (Darwin, Glibc, Musl, UCRT), sets up a thread-safe print queue for output, and routes informational, success, error, and warning messages to stderr with optional ANSI color coding, while sending formatted content to stdout. The tool determines the current working directory, executes the CLI logic, and exits with the appropriate status code. Also in this area: Add --color flag to control colored output.

CommandLineTool · high confidence

Introduce hierarchical configuration file support

The tool now supports hierarchical \.swiftformat\ configuration files, allowing users to define options in parent directories that are inherited and merged by child directories. This change introduces logic to parse comma-delimited config paths, expand file paths relative to the current directory, and merge arguments from multiple configuration sources, enabling more granular and reusable formatting rules across a project structure.

Sources · high confidence

Introduce standalone SwiftFormat for Xcode configuration app

A new companion application for the Xcode Source Editor extension has been added, providing a graphical interface to manage formatting rules and options. The app allows users to enable or disable specific formatting rules, adjust rule-specific options via checkboxes, dropdowns, and text fields, and select the target Swift version. It supports importing and exporting \.swiftformat\ configuration files, includes a search bar to filter rules, and displays dynamic setup instructions in the About window based on the macOS version (System Preferences vs. System Settings). The application shares configuration state with the extension via an app group container.

EditorExtension/Application · high confidence

Launch of new SwiftFormat documentation website

The project now includes a dedicated Jekyll-based documentation site hosted at swiftformat.info. This new site replaces previous documentation delivery methods, featuring a responsive layout with a sticky navigation bar, a collapsible table-of-contents sidebar, and automatic dark mode support that respects the user's system preferences. The site dynamically generates pages from the repository's existing README and Rules documentation, includes a footer displaying the current version and last update time, and provides a specific 'Prerelease Rules' page for the develop branch. Users can now access a more polished, mobile-friendly experience with improved readability features like scrollable code tables and clickable heading anchors.

site · high confidence

New release automation and Linux build scripts

Added \prepare\_release.sh\ to automate version updates across project files, run tests, archive binaries, and re-format the codebase before release. Introduced \build-linux-release.sh\ to compile SwiftFormat for Linux (x86\_64 and AArch64) with a larger stack size, and \spm-artifact-bundle.sh\ to package macOS and Linux binaries into a distributable artifact bundle. Also added \get-version.sh\ to extract the current version and \test\_rule.sh\ to test individual formatting rules on Linux.

Scripts · high confidence

Sprinter library added to project

The Sprinter library (version 0.2.1) has been added to the project, providing a \FormatString\ type for parsing and formatting format strings. This includes support for various flags, field widths, length modifiers, and conversion specifiers.

Snapshots/Sprinter/Sources · high confidence

Xcode extension now supports linting and Swift Package Manifest files

The Xcode editor extension has been updated to include a new 'Lint File' command, allowing users to check code for style violations without modifying it. Additionally, support has been added for Swift Package manifest files (e.g., Package.swift), enabling formatting and linting operations on these files alongside standard Swift source code.

EditorExtension/Extension · high confidence

Architecture

Migrate rules to DeclarationV2 API and restructure rule files

The rule implementation files in Sources/Rules have been restructured so that each rule is defined in its own separate file, and the internal parsing logic has been migrated to the new DeclarationV2 API (later renamed to Declaration). This refactoring improves code organization and provides a more robust foundation for rule implementations, though it does not change the formatting behavior for users.

Sources/Rules · high confidence

Behavioural changes

Added Xcode schemes for performance, regression, and editor extension targets

New Xcode scheme files have been added to configure build and test actions for specific targets: Performance Tests, Regression Tests, the Command Line Tool, the Editor Extension, the Framework, and the main SwiftFormat for Xcode app. These schemes enable parallelized builds, configure release-mode execution for performance and regression tests, and set up launch profiles for the Xcode source editor extension and command-line tool, supporting faster CI feedback and dedicated testing workflows.

SwiftFormat.xcodeproj/xcshareddata/xcschemes · high confidence

Enhanced rule searchability and legacy option handling in the Xcode extension

The Xcode extension's settings store now allows users to find formatting rules by searching their help text and option names, in addition to rule names. Additionally, the OptionsStore has been updated to better handle legacy configuration values, ensuring that non-deprecated options correctly overwrite old settings during migration.

EditorExtension/Shared · high confidence

SwiftFormat for Xcode project structure and build configuration

The Xcode project file has been restructured to support the current codebase organization, including the addition of new source files such as \Inference.swift\, \Arguments.swift\, and various reporter implementations (\JSONReporter\, \XMLReporter\, \GithubActionsLogReporter\, \SARIFReporter\). The build configuration now explicitly embeds \XcodeKit.framework\ for the source editor extension and links against \SwiftFormat.framework\ for the main application and command-line tool targets. Test targets have been updated to include new test files like \VersionTests.swift\, \ParsingHelpersTests.swift\, and \DeclarationV2Tests.swift\, reflecting the migration to the \Declaration\ API and the addition of new formatting rules and inference logic.

SwiftFormat.xcodeproj · high confidence

Windows installer now includes code signing and Swift runtime

The Windows installer has been updated to use WiX 4.0.5 and now includes the Swift runtime merge modules, ensuring the tool works out-of-the-box without requiring a separate Swift installation. Additionally, the build process now supports code-signing the installer components, improving trust and security for Windows users.

Platforms · high confidence

Test coverage

Add regression tests for SwiftFormat option overrides; Add test coverage for formatting rules; Added Sprinter snapshot project scaffolding; Added benchmark and regression test suites for Expression evaluation; Added comprehensive test suite for command-line argument parsing and code organization; Added performance benchmarking suite for SwiftFormat; Added regression and performance test suites for Sprinter; Added regression test suite for Euclid geometry primitives; Added regression test suite for Expression parsing and evaluation; Added regression test suite for SwiftFormat; Added snapshot tests for issues 1061, 1129, 1183, 1184, 1201, 1202, 1205, 1212, 1254, 1259, 1269, 1319, 1491, 1582, 1644, 406, 411, 637, 645, 678, 681, 682, 687, 697, 780, and 794; Added test harness for Swift package command plugin; Added test suite for Consumer parser library; Updated performance test baselines for new hardware.

Dependencies

Add Swift Package Manager support and Ruby build dependencies

The project now supports installation via Swift Package Manager, introducing a root Package.swift that defines the SwiftFormat library, command-line tool, and a new SwiftFormatPlugin for Xcode integration. Additionally, a Gemfile and Gemfile.lock have been added to manage Ruby dependencies, specifically pinning Jekyll (\~\> 4.4) and Rake (\~\> 13.0) for build and documentation tasks.

(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 59 → 56 (-2.4)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 57 → 52 (-5.6)
  • Architecture 93 → 93 (+0.0)
  • Maturity 49 → 49 (-0.1)
  • Readiness 69 → 68 (-1.0)
  • Security 75 → 66 (-9.8)
  • Event-Driven 76 → 77 (+0.3)
  • Performance 100 → 100 (+0.0)

Resolved (26)

  • Duplicated block (10 lines × 2) (Snapshots/Euclid/Sources/SceneKit.swift)
  • Duplicated block (10 lines × 2) (Snapshots/Euclid/Sources/SceneKit.swift)
  • Duplicated block (10 lines × 2) (Sources/Options.swift)
  • Duplicated block (10 lines × 2) (Sources/Rules/PreferSwiftTesting.swift)
  • Duplicated block (12 lines × 2) (Sources/Rules/RedundantExtendedLifetime.swift)
  • Duplicated block (14 lines × 2) (Snapshots/Expression/Sources/Expression.swift)
  • Duplicated block (15–18 lines × 2) (Sources/FormattingHelpers.swift)
  • Duplicated block (20 lines × 2) (Snapshots/Expression/Sources/Expression.swift)
  • Duplicated block (20 lines × 3) (Snapshots/Euclid/Sources/SceneKit.swift)
  • Duplicated block (5 lines × 2) (Sources/Arguments.swift)
  • Duplicated block (5 lines × 2) (Sources/Rules/RedundantExtendedLifetime.swift)
  • Duplicated block (6 lines × 2) (Snapshots/Expression/Examples/Colors/UIColor+Expression.swift)
  • Duplicated block (6 lines × 2) (Sources/Arguments.swift)
  • Duplicated block (7 lines × 2) (Snapshots/Euclid/Sources/Plane.swift)
  • Duplicated block (7 lines × 2) (Snapshots/Euclid/Sources/Shapes.swift)
  • Duplicated block (7 lines × 2) (Snapshots/Expression/Sources/Expression.swift)
  • Duplicated block (8 lines × 2) (Sources/Rules/PreferSwiftTesting.swift)
  • Duplicated block (9 lines × 2) (Sources/CommandLine.swift)
  • Duplicated block (9–11 lines × 2) (Sources/CommandLine.swift)
  • Near-duplicate member pair (53 shared lines) (Snapshots/Euclid/Sources/SceneKit.swift)
  • …and 6 more

New (215)

  • Duplicated block (10 lines × 2) (Sources/Options.swift)
  • Duplicated block (12 lines × 2) (Sources/Rules/RedundantExtendedLifetime.swift)
  • Duplicated block (14 lines × 2) (Snapshots/Expression/Sources/Expression.swift)
  • Duplicated block (15–18 lines × 2) (Sources/FormattingHelpers.swift)
  • Duplicated block (21 lines × 2) (Snapshots/Euclid/Sources/SceneKit.swift)
  • Duplicated block (5 lines × 2) (Sources/Rules/RedundantExtendedLifetime.swift)
  • Duplicated block (7 lines × 2) (Snapshots/Euclid/Sources/Plane.swift)
  • Duplicated block (7 lines × 2) (Snapshots/Euclid/Sources/Shapes.swift)
  • Duplicated block (7 lines × 2) (Snapshots/Expression/Sources/Expression.swift)
  • Duplicated block (9–11 lines × 2) (Sources/CommandLine.swift)
  • Edited copies of one member (3 members, 11+ corresponding lines) (EditorExtension/Application/Source/UserSelection.swift)
  • Edited copies of one member (3 members, 16+ corresponding lines) (Snapshots/Expression/Sources/AnyExpression.swift)
  • Edited copies of one member (3 members, 7+ corresponding lines) (Snapshots/Issues/697.swift)
  • Edited copies of one member (3 members, 9+ corresponding lines) (Snapshots/Euclid/Sources/CSG.swift)
  • Edited copies of one member (3 members, 9+ corresponding lines) (Sources/SwiftFormat.swift)
  • Edited copies of one member (4 members, 10+ corresponding lines) (Snapshots/Expression/Sources/AnyExpression.swift)
  • Edited copies of one member (4 members, 3+ corresponding lines) (Sources/Formatter.swift)
  • Edited copies of one member (5 members, 9+ corresponding lines) (Snapshots/Issues/697.swift)
  • Edited copy of a member (10 corresponding lines) (Snapshots/Euclid/Sources/Bounds.swift)
  • Edited copy of a member (10 corresponding lines) (Snapshots/Parsing/Sources/Interpreter.swift)
  • …and 195 more

Changes since last survey

  • 57 commits — 30 feature/other, 27 fixes

By area

  • Sources/Rules — 30 commits
  • Sources/ParsingHelpers.swift — 6 commits
  • Tests/Rules — 6 commits
  • (root) — 5 commits
  • Sources/FormattingHelpers.swift — 3 commits
  • Sources/Tokenizer.swift — 3 commits
  • Sources/Arguments.swift — 2 commits
  • .github/workflows — 1 commit
  • Tests/CommandLineTests.swift — 1 commit

Notable commits

  • fix: Fix Allman braces splitting unsafe closure expressions
  • fix: Fix / prefix operators mistaken for regex literals
  • fix: Fix hoistTry and hoistAwait joining the keyword to a preceding keyword (#2857)
  • fix: Fix yodaConditions mangling a comparison wrapped after the operator (#2856)
  • fix: Fix yodaConditions mangling a macro call on the right-hand side (#2849)
  • fix: Fix braces joining a closure statement onto a preceding closing brace (#2823)
  • fix: Fix docComments leaving a trailing space when converting /* to / (#2815)
  • fix: Fix end-of-options separator handling
  • fix: Fix environmentEntry inserting the default value after an attribute on its own line (#2825)
  • fix: Fix extensionAttributes doubling the indent of a comment after a removed attribute (#2819)
  • fix: Fix hoistTry inserting try before an operator that follows a comment (#2827)
  • fix: Fix hoistTry inserting try in the middle of a member chain after a closure (#2828)
  • fix: Fix hoistTry moving try into a declaration when the value starts on the next line (#2822)
  • fix: Fix noForceUnwrapInTests converting force unwraps inside key paths (#2826)
  • fix: Fix preferExplicitFalse breaking parenthesized #if conditions (#2839)
  • fix: Fix preferForLoop converting a forEach call used as an expression (#2829)
  • fix: Fix preferLazyMap making closures escape that capture inout values (#2840)
  • fix: Fix redundantClosure handling of unsafe closure calls
  • fix: Fix redundantClosure treating a paren on a new line as a call (#2820)
  • fix: Fix redundantEquatable removing == when a stored property is in a conditional compilation block (#2833)
  • …and 37 more

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

nicklockwood/SwiftFormat 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 1bd6e843cfeb89b42088f663d9ae4c7ebcb3c143 — 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.