Warn and skip linting when swift-format config is incompatible#2
Merged
heirloomlogic merged 1 commit intomainfrom Apr 14, 2026
Merged
Conversation
When the active toolchain's swift-format is incompatible with the .swift-format config schema (e.g. Swift 6.1 CI vs 6.2+ config), the plugins now emit a detailed warning and skip linting/formatting instead of failing the build. Real lint violations still fail as before. Build tool plugin: preflight probe runs swift-format against a trivial file before returning the prebuild command. If the config is unparseable, returns [] with a warning diagnostic. Command plugin: config-related failures downgraded from Diagnostics.error to Diagnostics.warning with actionable context. bin/lint: captures stderr, detects config errors, exits 0 with warning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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-formatcannot parse the.swift-formatconfig (e.g. Swift 6.1 CI runner vs a config authored under 6.2+), all plugin paths now emit a detailed warning and skip linting/formatting instead of failing the build.Diagnostics.warning.Diagnostics.errortoDiagnostics.warning.bin/lintcaptures stderr, detects config/toolchain mismatches, and exits 0 with a warning instead of failing CI.Test plan
bin/lintwith a config containing unknown keys and verify it warns and exits 0bin/lintwith a valid config and intentional violations and verify it exits non-zero🤖 Generated with Claude Code