chore: add SwiftLint 0.65.0 with pinned CI version#1043
Open
grdsdev wants to merge 6 commits into
Open
Conversation
Coverage Report for CI Build 28930530953Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.4%) to 83.384%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions247 previously-covered lines in 9 files lost coverage.
Coverage Stats
💛 - Coveralls |
9ed79f4 to
b67820b
Compare
Adds SwiftLint as a code-smell/correctness linter alongside swift-format. No changes to Package.swift — downstream consumers are unaffected. Setup: - .swiftlint.yml: all default rules disabled; enable one-by-one in follow-up PRs as violations are fixed - Makefile: adds `make lint` (strict) and `make lint-fix` (autocorrect) - CI: new SwiftLint job pinned to 0.65.0 via portable_swiftlint.zip from GitHub releases, cached by version+OS, version-verified before running. Added to ci-success required-jobs gate. - AGENTS.md: documents the linting workflow Install locally: brew install swiftlint
b67820b to
a808b78
Compare
grdsdev
commented
Jul 7, 2026
spydon
reviewed
Jul 7, 2026
| if: steps.cache-swiftlint.outputs.cache-hit != 'true' | ||
| run: | | ||
| curl -fL \ | ||
| "https://github.com/realm/SwiftLint/releases/download/${SWIFTLINT_VERSION}/portable_swiftlint.zip" \ |
Contributor
There was a problem hiding this comment.
I guess this should also be pinned somehow (if we want the same security as for the actions)? Because github releases can change...
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.
Summary
swift-formatPackage.swift— downstream consumers are unaffecteddisabled_rulesonce the violations are fixedWhat changed
.swiftlint.ymlSources/Tests. Lists only the 25 rules with existing violations indisabled_rules; everything else runs and passes..github/workflows/ci.ymlSwiftLintjob pinned to 0.65.0 viaportable_swiftlint.zipfrom GitHub releases, cached by version+OS, version-verified before running. Added to theci-successrequired-jobs gate.AGENTS.mdDesign notes
swift-format stays the layout authority. Rules that overlap with swift-format (e.g.
trailing_comma,opening_brace,line_length) are disabled to avoid conflicts between the two tools.Pinned version for reproducibility. CI downloads the exact
0.65.0binary from GitHub releases and caches it — no brew resolution, no version drift. To upgrade: bumpSWIFTLINT_VERSIONin the workflow and commit.Incremental adoption. Rather than a baseline file (which stores absolute paths and breaks across machines), violations are tracked by disabling only the rules that fire. Enable rules one-by-one in follow-up PRs by removing entries from
disabled_rules.Currently disabled rules and their violation counts:
line_lengthtrailing_commaidentifier_namenon_optional_string_data_conversionopening_bracetype_body_lengthfile_lengthfunction_body_lengthforce_trycomment_spacingredundant_discardable_letforce_casttype_namemultiple_closures_with_trailing_closureoptional_data_string_conversionimplicit_optional_initializationfor_wherenestingcyclomatic_complexityorphaned_doc_commentclosure_parameter_positiontodofunction_parameter_countfunction_name_whitespaceclass_delegate_protocolTesting
swiftlint lint --strict→ 0 violations, 0 serious in 211 files