Add CI, SwiftLint and SwiftFormat - #4
Merged
Merged
Conversation
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
added a commit
that referenced
this pull request
Aug 9, 2026
Add CI, SwiftLint and SwiftFormat
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.
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.Optionsparsing trippedcyclomatic_complexity. Splitting the flags that take a value from the ones that don't makes both halves small.PreviewApp.main()is the one suppression:@mainmeans the runtime calls it and nothing else does, whichunused_declarationcan't see.SwiftFormat's
redundantSelfturnedlet field = self.fieldintolet field = field, which reads like it initialises itself — the local is nowarea.One gotcha
In the format job the paths come before
--lint. The flag takes an optional value, soswiftformat --lint Sources PreviewtreatsSourcesas that value and fails with "argument does not expect a value".Verification
Every job was reproduced locally against this branch:
Rendered output is unchanged after the refactors.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MVZKaTdW5LpcwGnwAV22ZV