Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 29, 2025

Adds JSON output format to resyntax fix for the Autofixer to programmatically determine if fixes were applied.

Changes

  • Added json variant to resyntax-output-format enum
  • Added --output-as-json CLI flag
  • Implemented resyntax-fix-print-json function that outputs:
    {
      "commit_message": "Automated Resyntax fixes\n\nResyntax fixed 3 issues in ...",
      "fix_count": 3
    }
  • When no fixes found:
    {
      "commit_message": "Resyntax found no issues.",
      "fix_count": 0
    }

The commit_message field contains a formatted Git commit message with fix counts by rule. The fix_count field enables the Autofixer to bail out when zero.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add resyntax fix --output-as-json flag</issue_title>
<issue_description>This is an internal flag for the Autofixer, which should print out the summary information in the form of a JSON object. That object should look something like this:

{
  "commit_message" : "Automated Resyntax fixes\n\nResyntax fixed 3 issues in ...",
  "fix_count" : 3
}

The Autofixer needs this in order to safely bail out of the autofixing workflow if no issues are found.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add resyntax fix output as JSON flag Add resyntax fix --output-as-json flag Oct 29, 2025
Copilot AI requested a review from jackfirth October 29, 2025 21:31
@jackfirth jackfirth marked this pull request as ready for review October 30, 2025 01:38
@jackfirth jackfirth enabled auto-merge (squash) October 30, 2025 01:40
@jackfirth jackfirth merged commit c970144 into master Oct 30, 2025
6 checks passed
@jackfirth jackfirth deleted the copilot/add-resyntax-fix-json-output branch October 30, 2025 01:43
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.

Add resyntax fix --output-as-json flag

2 participants