Skip to content

Repair the formatting and linting entry points - #1904

Merged
martinpucik merged 2 commits into
mainfrom
swiftformat-tooling
Aug 2, 2026
Merged

Repair the formatting and linting entry points#1904
martinpucik merged 2 commits into
mainfrom
swiftformat-tooling

Conversation

@martinpucik

Copy link
Copy Markdown
Contributor

What does this implement/fix? Explain your changes.

make format, make lint and Scripts/pre-commit all still invoke the SwiftPM plugins that were deleted in 6bb47d5 ("Remove plugins that caused issues, migrate to swift 6"), so all three have been failing since October 2024:

format:  @swift package --allow-writing-to-package-directory format-source-code --file .
lint:    @swift package --disable-sandbox lint

Package.swift has no plugins, and this PR deliberately does not add any back — that would put the dependency on every MessageKit consumer. Instead the targets call the swiftformat and swiftlint binaries directly, and the pre-commit hook now reports a missing swiftformat with an install hint rather than silently doing nothing.

Also modernises .swiftformat, which had drifted:

  • --swiftversion said 5.6 while the package builds in Swift 6 language mode.
  • sortedImports was renamed to sortImports upstream and emitted a deprecation warning on every run.

Verified against SwiftFormat 0.62.1 — the version preinstalled on the CI runners — that neither change alters which files need formatting, so this is purely a config refresh.

Does this close any currently open issues?

No.

Any other comments?

This intentionally does not reformat the codebase. 47 of 123 files currently fail swiftformat --lint, so make lint will still report failures after this lands — the entry points work again, but the existing drift is untouched.

That reformat is deliberately left for a follow-up, because it touches Sources/Views/MessagesCollectionView.swift, which #1832 is currently modifying. Doing it here would force that contributor to rebase. The drift breaks down as roughly 252 organizeDeclarations, 49 indent, 29 wrap and 13 trailingSpace violations — about +1032/-1010 across 47 files.

Where has this been tested?

Locally, with SwiftFormat 0.62.1 and SwiftLint 0.65.0 (the versions on the CI images):

  • make lint runs and correctly fails on the pre-existing drift, with no deprecation warnings.
  • make format runs and formats 47/123 files, confirming the target works end to end. That result was then discarded, since reformatting is out of scope here.

🤖 Generated with Claude Code

make format, make lint and the pre-commit hook all still invoked the
SwiftPM plugins removed in 6bb47d5, so every one of them has been
failing. Call the swiftformat and swiftlint binaries directly instead,
and have the hook say so when swiftformat is missing.

Also modernise the config: --swiftversion tracked 5.6 while the package
builds in Swift 6 language mode, and sortedImports was renamed to
sortImports. Neither changes the set of files that need formatting.
@martinpucik
martinpucik force-pushed the swiftformat-tooling branch from d3a93f6 to e100669 Compare August 2, 2026 15:34
@martinpucik
martinpucik enabled auto-merge August 2, 2026 15:34
@martinpucik
martinpucik merged commit 185e2ac into main Aug 2, 2026
5 checks passed
@martinpucik
martinpucik deleted the swiftformat-tooling branch August 2, 2026 15:36
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.

2 participants