Skip to content

Add CI, SwiftLint and SwiftFormat - #4

Merged
winebarrel merged 2 commits into
mainfrom
feat/ci
Aug 9, 2026
Merged

winebarrel merged 2 commits into
mainfrom
feat/ci

Conversation

@winebarrel

Copy link
Copy Markdown
Owner

Modelled on winebarrel/Neco: a lint job, a format job, and a build job that also feeds its compiler log to swiftlint analyze. The build job covers both schemes.

Violations worth fixing rather than silencing

  • ConfigureSheetController.buildInterface() had grown to 79 lines. The grid, its rows and the button strip each get their own method now.
  • Options parsing tripped cyclomatic_complexity. Splitting the flags that take a value from the ones that don't makes both halves small.

PreviewApp.main() is the one suppression: @main means the runtime calls it and nothing else does, which unused_declaration can't see.

SwiftFormat's redundantSelf turned let field = self.field into let field = field, which reads like it initialises itself — the local is now area.

One gotcha

In the format job the paths come before --lint. The flag takes an optional value, so swiftformat --lint Sources Preview treats Sources as that value and fails with "argument does not expect a value".

Verification

Every job was reproduced locally against this branch:

swiftlint --strict                          → 0 violations
swiftformat Sources Preview --lint          → 0/5 files require formatting
xcodebuild build analyze (both schemes)     → BUILD SUCCEEDED
swiftlint analyze --strict                  → 0 violations

Rendered output is unchanged after the refactors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MVZKaTdW5LpcwGnwAV22ZV

winebarrel and others added 2 commits August 9, 2026 17:05
Modelled on winebarrel/Neco: a lint job, a format job, and a build job
that also feeds its compiler log to `swiftlint analyze`. The build job
covers both schemes.

Two violations were real enough to fix rather than silence.
ConfigureSheetController.buildInterface() had grown to 79 lines, so the
grid, its rows and the button strip each get their own method. Options
parsing was branchy enough to trip cyclomatic_complexity; splitting the
flags that take a value from the ones that do not makes both halves
small.

PreviewApp.main() is the one suppression: @main means the runtime calls
it and nothing else does, which unused_declaration cannot see.

SwiftFormat's redundantSelf turned `let field = self.field` into
`let field = field`, which reads like it initialises itself. Renamed the
local to `area`.

In the format job the paths come before --lint. The flag takes an
optional value, so `swiftformat --lint Sources Preview` treats Sources
as that value and fails.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
SwiftFormat 0.62 enables wrapIfStatementBodies, which 0.61 did not have.
CI installs the current release, so it failed on formatting the local
run had passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@winebarrel
winebarrel merged commit 2b9d7f4 into main Aug 9, 2026
3 checks passed
@winebarrel
winebarrel deleted the feat/ci branch August 9, 2026 08:11
winebarrel added a commit that referenced this pull request Aug 9, 2026
Add CI, SwiftLint and SwiftFormat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant