Skip to content

Fix #28 - Switch from SwiftLint to swift-format - #101

Open
jbuckner wants to merge 3 commits into
mainfrom
28-swift-format
Open

Fix #28 - Switch from SwiftLint to swift-format#101
jbuckner wants to merge 3 commits into
mainfrom
28-swift-format

Conversation

@jbuckner

Copy link
Copy Markdown
Owner

Closes #28.

Bulk reformat plus the config and CI swap. No behavior change: a token-level diff of all 28 files comes back identical apart from import reordering, and every string literal is byte-for-byte the same.

Heads up, this needs a settings change to merge. SwiftLint is a required status check on main and the job is now called swift-format, so this PR (and everything after it) blocks on a check that no longer runs. Swap the required context from SwiftLint to swift-format in branch protection.

A couple of notes on the config:

  • The rules dict in .swift-format replaces the toolchain defaults instead of merging, so the file carries the full dumped default with one flag flipped. A partial dict silently turns off every rule it does not list.
  • UseTripleSlashForDocumentationComments is off. The library documents with /** */ blocks throughout and converting all 54 of them belongs with the DocC work in Replace the 2021 jazzy docs with DocC published from CI #55.
  • CI is pinned to swift:6.3.3 to match Xcode 26.6, since formatting output can shift between swift-format versions.
  • QTime and reviewer_itemname get swift-format-ignore comments. Both names are deliberate.

This lands first because it also unblocks #100: SwiftLint errors on a type body over 350 lines, and the metadata model is about to get a lot bigger than that.

QA

swift test - 126 tests pass
swift format lint --strict --recursive InternetArchiveKit InternetArchiveKitTests InternetArchiveKitExample Package.swift - exits 0
swift build and the iOS Simulator build both succeed

🤖 Generated with Claude Code

https://claude.ai/code/session_014yqNSBpEowza5teukE2JJL

jbuckner and others added 2 commits August 22, 2026 12:21
Bulk reformat with swift-format 6.3.0, plus the config and CI swap.

The `rules` dict in .swift-format replaces the toolchain defaults rather than
merging with them, so the file carries the full dumped default with only
UseTripleSlashForDocumentationComments flipped off. A partial dict silently
turns off every rule it doesn't list. The doc-comment rule stays off because
the library documents with /** */ blocks throughout; converting those belongs
with the DocC work in #55.

CI's lint job is pinned to swift:6.3.3 to match the toolchain in Xcode 26.6,
since formatting output can shift between swift-format versions.

Two names swift-format flags are deliberate and get swift-format-ignore
comments: QTime is archive.org's wire name, and reviewer_itemname is a
deprecated alias kept for source compatibility.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yqNSBpEowza5teukE2JJL
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yqNSBpEowza5teukE2JJL
Comment thread .github/workflows/ci.yml Fixed
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.70%. Comparing base (f74ba50) to head (6f608ad).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   92.55%   92.70%   +0.14%     
==========================================
  Files          13       13              
  Lines         672      672              
==========================================
+ Hits          622      623       +1     
+ Misses         50       49       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

CodeQL flagged the workflow for not scoping the token. Every job only reads
the repo, and codecov uploads with its own secret, so read is enough.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yqNSBpEowza5teukE2JJL
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.

Switch from SwiftLint to swift-format

2 participants