Repository navigation
Warnings are not displayed inline #6746
Description
Activity
Still works for me with exactly the same versions. We got reports of similar issues in the past and there always wasn't anything SwiftLint could do. The contract is that tools print
warning:anderror:messages to the build log and Xcode would pick them up. If the messages appear in the log, it's probably an Xcode problem.- addedhelpQuestions or user problems that require more explanation rather than code changes.Questions or user problems that require more explanation rather than code changes.
on Jun 16, 2026 I hit the same symptom (SwiftLint installed as an SPM build tool plugin, violations visible in the build log but not in the Issue Navigator or inline in the editor) and managed to track down the cause in my setup. Posting it here since it may explain why this reproduces for some people and not others.
Cause: a shell-script pre-action on the scheme's Build action. On Xcode 26.5 (and 27 beta 2), if the scheme being built has any Build pre-action, diagnostics emitted by build tool plugins are dropped from the Issue Navigator and inline display — they still show up in the Report Navigator's build log. Compiler warnings are unaffected, which makes it easy to misattribute.
Some observations from isolating it:
- The script's content is irrelevant — even a no-op pre-action script reproduces the problem.
- Removing the block from the Build action in the .xcscheme immediately restores warnings in the Issue Navigator.
- Test-action pre-actions do not trigger it; only Build-action pre-actions.
- It affects plugin diagnostics from both Xcode project targets and SPM package targets built by that scheme.
Workaround: Edit the scheme (Product → Scheme → Edit Scheme… → Build → Pre-actions) and remove any pre-action scripts, or move the work elsewhere (manual script, Test pre-action, etc.).
@SimplyDanny this supports your read that it's an Xcode problem rather than SwiftLint — the plugin prints the diagnostics correctly and Xcode's build log even parses them; they just never reach the Issue Navigator when a Build pre-action is present. I'd suggest anyone affected check their scheme for Build pre-actions, and it's probably worth a Feedback to Apple (minimal repro: any target with a build tool plugin emitting warning: lines + any Build pre-action on the scheme).
Reacted by Paulo MendesFollow-up with a minimal repro (attached) after narrowing this down further.
The repro is a single macOS command-line-tool target with SwiftLintBuildToolPlugin attached and a no-op Build pre-action (true) in the scheme. Build it → SwiftLint's warning appears in the build log but not in the Issue Navigator. Delete the pre-action, touch the source file, build again → the warning appears. Steps and expected/actual are in the README.
One refinement on my earlier comment: the suppression seems specific to plugin build commands that run a binary tool (SwiftLint's artifact-bundle binary — the tasks the build log shows as "SwiftLint"). The repro also contains a small local build tool plugin whose command Xcode surfaces as "Run custom shell script", and its warning survives in the Issue Navigator with the pre-action present. So whether this reproduces for you depends on the plugin's command type — which probably explains the "works for me" reports: a trivial echo-style test plugin won't show the problem, SwiftLint does.
Also verified: reproduces on Xcode 27 beta 2 as well; the pre-action's script content, "Provide build settings from", and project-vs-workspace make no difference. I've filed this with Apple as FB23530632 with the same repro.
Thank you for the analysis and letting us know about your results, @diogot!
I'll pin this issue so that folks are aware of the problem, the reference and the workaround.
Reacted by Diogo Tridapalli- addedintegrationIssues related to integration of SwiftLint into toolchains.Issues related to integration of SwiftLint into toolchains.
on Jul 3, 2026 - pinned this issue
on Jul 3, 2026
New Issue Checklist
Bug Description
I've installed SwiftLint as Xcode build tool plugin. Linter warnings are shown in the build log. However, they're not displayed inline in code as warnings. This worked when I used SwiftLint via Cocoapods. Is that no longer supposed to work?
Environment
Are you using nested configurations? No