fix: improve command output mode failure message#27
Merged
Lauri "datafox" Heino (melodicore) merged 5 commits intoJul 7, 2026
Conversation
- Remove bare custom command print from printOutputModeResult; the fix command now only appears in the failure message at the bottom - printOutputModeResult returns the fix command string so the failure message can use it (generated command with file paths, or custom command) - Suppress "Run locally to fix" from the failure message when output_mode is not command - Fix pre-existing biome lint warnings (import sort, template literals) Signed-off-by: melodicore <lauri@elide.dev>
Signed-off-by: melodicore <lauri@elide.dev>
Copilot started reviewing on behalf of
Lauri "datafox" Heino (melodicore)
July 7, 2026 14:24
View session
There was a problem hiding this comment.
Pull request overview
This PR improves the formatting action’s “output_mode=command” UX by generating and propagating full fix commands (including file paths) into the final failure annotation, while avoiding “run locally” guidance for non-command output modes. It also includes small cleanup changes to satisfy existing lint rules (import ordering and template literals).
Changes:
- Update
printOutputModeResultto return a generated/custom fix command (string | null) so the failure annotation can include the full command. - Adjust failure message construction to include “Run locally to fix …” only for
output_mode=command, deduping commands across failed formatters. - Apply lint-driven refactors (import sorting, template literal usage) and update tests to match the new messaging behavior.
Reviewed changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/telemetry.ts | Reorders imports to satisfy lint rules. |
| src/main.ts | Returns fix commands from output handling and incorporates them into the failure annotation; adjusts messaging by output mode. |
| src/command.ts | Reorders imports to satisfy lint rules. |
| tests/telemetry.test.ts | Import ordering lint fix. |
| tests/options.test.ts | Import ordering lint fix; minor mock implementation tweak. |
| tests/main.test.ts | Updates/extends tests for the new failure message behavior and custom command handling. |
| tests/index.test.ts | Import ordering lint fix. |
| tests/command.test.ts | Import ordering lint fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move customCommand return before !stdout guard so command mode with a custom command returns correctly even when formatter stdout is empty - Use typed formatters array to index fixCommands instead of Object.entries, avoiding string vs FormatterName type unsafety Signed-off-by: melodicore <lauri@elide.dev>
Copilot started reviewing on behalf of
Lauri "datafox" Heino (melodicore)
July 7, 2026 14:32
View session
- Remove unreachable customCommand branch inside command switch case (already handled by early return before the switch) - Simplify include-kts test mock to remove redundant && true Signed-off-by: melodicore <lauri@elide.dev>
Signed-off-by: melodicore <lauri@elide.dev>
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
printOutputModeResult; the fix command now appears only in the failure annotation at the bottomprintOutputModeResultnow returns the fix command string (string | null) so the failure message can include the full generated command with file paths, not justelide <formatter>output_modeis notcommand— other modes have no business telling you to run a local formatter command