Skip to content

feat: add autohooks plugin to sort JSON keys in test ref files#1936

Merged
benflexcompute merged 3 commits intorelease-candidate/25.9from
feat/autohooks-sort-json-plugin
Mar 27, 2026
Merged

feat: add autohooks plugin to sort JSON keys in test ref files#1936
benflexcompute merged 3 commits intorelease-candidate/25.9from
feat/autohooks-sort-json-plugin

Conversation

@benflexcompute
Copy link
Copy Markdown
Collaborator

@benflexcompute benflexcompute commented Mar 27, 2026

Summary

  • Adds a new autohooks pre-commit plugin (flow360/_autohooks/sort_json.py) that automatically sorts keys in staged tests/**/*.json files
  • Registers the plugin in pyproject.toml alongside existing black, isort, and pylint hooks
  • Updates README with pre-commit hooks setup instructions

Usage

After cloning / pulling this branch, activate the pre-commit hooks once:

poetry run autohooks activate

From now on, every git commit will automatically:

  1. Format code with black
  2. Sort imports with isort
  3. Lint with pylint
  4. Sort keys in tests/**/*.json reference files

The hooks only process staged files, so they are fast. If you don't activate, CI will still catch issues.

Test plan

  • Verified plugin runs during git commit via autohooks
  • Confirmed unsorted JSON keys are automatically fixed before commit
  • Existing black/isort/pylint hooks continue to work

🤖 Generated with Claude Code


Note

Low Risk
Low risk: changes are limited to developer tooling/docs and only mutate staged tests/**/*.json files during commits, with no runtime or production code impact.

Overview
Adds a new autohooks pre-commit plugin (flow360/_autohooks/sort_json.py) that reuses tools/sort_ref_json.py to sort keys in staged tests/**/*.json files, stashing unstaged changes and re-staging updated files for clean diffs.

Registers the plugin in pyproject.toml alongside black/isort/pylint, and updates the README with hook activation instructions plus a manual check in step to run the JSON sorter.

Written by Cursor Bugbot for commit cd0bf49. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9702424334

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@benflexcompute benflexcompute force-pushed the feat/autohooks-sort-json-plugin branch from 592f193 to cd0bf49 Compare March 27, 2026 18:39
@benflexcompute benflexcompute merged commit b592210 into release-candidate/25.9 Mar 27, 2026
18 checks passed
@benflexcompute benflexcompute deleted the feat/autohooks-sort-json-plugin branch March 27, 2026 18:50
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