Repository navigation
Consistent formatting: 4 spaces, swift-format, and self only where needed - #226
Merged
Merged
Conversation
37 files still used 2-space indentation, in whole or in part, and Package.swift had two tab-indented lines. Their 2-space indentation steps become 4 spaces; nothing else changes. - Only leading whitespace changes: every line is identical once its indentation is removed. - Continuation lines aligned under an opening parenthesis stay aligned. - Multi-line string literals (generated Swift, SVG test input) move as a whole with their closing delimiter, so their content is unchanged. Adds .editorconfig (4 spaces; YAML 2) and a Formatting note in AGENTS.md.
A one-off pass with SwiftFormat's redundantSelf rule (--self init-only): explicit self is removed where it is redundant, and added inside initialisers for their own properties and methods. Only `self.` changes; every changed line is otherwise identical.
Adds .swift-format: 4-space indentation, 120-character lines, and once a call, signature or collection wraps, one argument per line with the closing bracket on its own line. Every rewriting rule is off, so this commit only changes layout: whitespace, line breaks, and trailing commas in multi-line collection literals. Three end-of-line comments that pushed their lines past the limit move onto their own lines. `swift format lint --strict --recursive .` is clean, and formatting again changes nothing.
.git-blame-ignore-revs lists the indentation and swift-format commits so git blame and GitHub skip them. AGENTS.md describes the layout, how to run swift format, and the self convention swift-format doesn't check.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #226 +/- ##
==========================================
+ Coverage 95.23% 95.48% +0.24%
==========================================
Files 296 296
Lines 31260 35029 +3769
==========================================
+ Hits 29772 33449 +3677
- Misses 1488 1580 +92 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A single formatting PR. Please merge with a merge commit, not a squash, so the SHAs listed in
.git-blame-ignore-revsstay valid.Commits
Indent with 4 spaces throughout (f048571). 37 files used 2-space indentation in whole or part, and
Package.swifthad two tab-indented lines. Only leading whitespace changes. Multi-line string literals move as a whole, so their content is unchanged.Use
selfonly where Swift needs it, and always ininit(37f125a). A one-off pass with SwiftFormat'sredundantSelfrule (--self init-only), across 27 files and 84 lines:self.removed;Every changed line is identical apart from
self.. Where Swift requiresself(shadowed names, escaping closures in classes), it stays.Format with swift-format (d19fc38). Adds
.swift-formatand formats every Swift file, includingTools/. The settings:lineBreakBeforeEachArgument), and the return type kept with the);#ifblocks not indented.Every rewriting rule is off, so only layout changes: whitespace, line breaks, and trailing commas in multi-line collection literals. Three end-of-line comments that ran past the limit move onto their own lines.
Ignore the formatting commits in blame, and document the style (8768bdf).
.git-blame-ignore-revslists commits 1 and 3. Theselfcommit isn't listed, since it changes code. AGENTS.md describes the layout, how to runswift format, and theselfconvention, which swift-format doesn't check..editorconfig(from commit 1) makes editors default to 4 spaces.swift formatships with Swift, so anyone can run it:swift format format --in-place --recursive .There's no CI check yet.
swift format lint --strict --recursive .is clean on this branch, and a second format run changes nothing.Checks
swift build --build-tests, andswift teston macOS: 309 XCTest tests plus 785 + 442 Swift Testing tests. That includes the code-generation tests, which compare exact output../container-run-tests.shon Swift 6.4, andSWIFT_VERSION=6.2(1,029 tests): all pass.Tools/swiftdraw-diffandTools/webkit-rendertests pass.swiftdraw-diff compare --base main --resvg Samples.bundle: all 181 samples unchanged, no regressions.🤖 Generated with Claude Code