Skip to content

Add SwiftLint#8

Open
cpruitt wants to merge 2 commits intomainfrom
cpruitt/add-swiftlint
Open

Add SwiftLint#8
cpruitt wants to merge 2 commits intomainfrom
cpruitt/add-swiftlint

Conversation

@cpruitt
Copy link
Collaborator

@cpruitt cpruitt commented Feb 3, 2026

This adds SwiftLint via SwiftLintPlugs as a SPM dependency. .swiftlint.yml is a super minimal configuration to lint everything except ./.build and to use Baseline.json to ignore violations. All existing violations are captured in Baseline.json meaning no violations are fixed in this PR and no violations should be found when the linter runs. Any newly introduced violations should be caught.

SwiftLint will run on build or test and will raise warnings/errors.

Run manually with swift package plugin swiftlint or install the SwiftLint executable (e.g. from Homebrew).

This PR also introduces a Brewfile with swiftlint as the only current brew. This will install the SwiftLint binary when running brew bundle.

Editor Config Changes

By default, Xcode does not remove whitespace from lines that contain only whitespace. Trailing whitespace on empty lines is a linter violation. To prevent life from being sad, it's best to configure Xcode to trim whitespace only lines.

Xcode > Settings > Editing > Enable "Trim whitespace-only lines"

- Add SwiftLint dependency to enable linting on build/test
- Add minimal SwiftLint config
- Create SwiftLint baseline to capture existing violations
- Add MacOS .macOS(.v12) to allow test builds with SwiftLint
This commit adds a Brewfile so that anyone working on the project can
easily install SwiftLint using Homebrew with `brew bundle`. This isn't a
dependency for linting, but makes working with the SwiftLint CLI way more
convenient.
@cpruitt cpruitt force-pushed the cpruitt/add-swiftlint branch from f65175e to f4d313a Compare February 3, 2026 01:49
@cpruitt cpruitt marked this pull request as ready for review February 3, 2026 01:50
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