Skip to content

Add --blink --commit mode: one git commit per rule - #237

Merged
TomasVotruba merged 1 commit into
mainfrom
blink-commit-per-rule
Oct 30, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
blink-commit-per-rule

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Adds --commit, available only together with --blink.

With --blink --commit, ecs resolves the config as usual, then applies the rules one at a time - each in its own ecs-go fix run - and turns every rule that changed files into a single git commit. One rule = one commit. Commit message is [Group] RuleName, where the group is the rule's namespace segment (e.g. [Import] OrderedImportsFixer), falling back to the bare short name. Rules that change nothing are skipped (no empty commits).

Run it on a clean working tree, since each commit stages tracked changes with git add --update.

Used without --blink, it errors with an explanation:

The --commit option works only together with --blink. It runs the ecs-go engine rule by rule and creates one git commit per rule. Re-run as: vendor/bin/ecs check --blink --commit

  • New BlinkCommitRunner service drives the per-rule loop and commits.
  • CheckCommand gets the --commit flag, the validation, and the new branch.
  • Unit test covers the commit-message building.
  • docs/blink.md documents the mode.

phpstan, rector, ecs and phpunit all pass.

@TomasVotruba
TomasVotruba force-pushed the blink-commit-per-rule branch from 1080fbc to df80afb Compare October 30, 2026 16:21
@TomasVotruba
TomasVotruba merged commit 455ff4b into main Oct 30, 2026
21 checks passed
@TomasVotruba
TomasVotruba deleted the blink-commit-per-rule branch October 30, 2026 16:27
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.

1 participant