Skip to content

Grade code style against the shared config, not Pint's defaults - #19

Merged
imanimanyara merged 2 commits into
mainfrom
chore/pint-action-uses-shared-config
Sep 6, 2026
Merged

imanimanyara merged 2 commits into
mainfrom
chore/pint-action-uses-shared-config

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

fix-php-code-style-issues.yml ran aglipanci/laravel-pint-action with configPath: pint.json — a file this package does not ship. Pint handed a config path that does not exist falls back to its own defaults and exits 0 rather than failing, so the job rewrote every touched file to the wrong style and committed the result. It ran with contents: write and stefanzweifel/git-auto-commit-action, so on every PR touching a .php file it won, while composer pint graded against the shared vendor/laranail/package-tools/pint.json.

Verified the inversion before changing anything: against Pint's defaults the tree reports 0 files; against the shared config it reports dirty.

What changed

  • The action is replaced with Setup PHP + composer install + composer pint-fix — the same command the lint gate checks, so the fixer and the gate can no longer disagree.
  • 259 files reformatted onto the shared config.
  • PostIncDecToPreIncDecRector added to rector.php's withSkip(). Rector rewrote $i++ to ++$i in 21 files and Pint's increment_style rewrote every one back — observed by running them in sequence — so rector and pint could never both pass. Formatting goes to Pint.

Verification

Gate Result
laranail-pint --test clean
rector --dry-run pass
phpstan 0 errors
Pest 6276 tests, 10486 assertions, 121 skipped, 0 failures

The test numbers are identical before and after the reformat, which is what establishes the change is style-only.

fix-php-code-style-issues.yml ran aglipanci/laravel-pint-action with
configPath: pint.json, a file this package does not ship. Pint handed a
config path that does not exist falls back to its own defaults and exits
0, so the job rewrote each touched file to the wrong style and committed
it - with contents: write and an auto-commit action, so it always won -
while composer pint graded against the shared laranail config. The two
had been disagreeing silently on every PR that touched a .php file.

Replace the action with setup-php + composer install + composer pint-fix,
the same command the lint gate checks, and reformat the 259 files that
had drifted. The suite is unchanged across the reformat: 6276 tests,
10486 assertions, 121 skipped, before and after.

Skip PostIncDecToPreIncDecRector while here. It rewrites $i++ to ++$i in
21 files and Pint's increment_style rewrites every one back, so rector
and pint could not both pass.
Copilot AI lite review requested due to automatic review settings September 6, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Benchmark results

Scenario Optimizations Native Laravel Optimized Speedup Δ vs base
Product import — 500 items, simple rules Wildcard, fast-check 142.2ms 2.6ms ~55x +0%
Nested order lines — 1000 orders × 5 line items Wildcard, fast-check (nested) 1003.1ms 15.2ms ~66x +2%
Event scheduling — 100 items, field-ref dates Wildcard, partial fast-check 22.4ms 1.0ms ~22x +0%
Article submission — 50 items, custom Rule objects Wildcard only 8.0ms 2.1ms ~4x +0%
Conditional import — 100 items, 47 conditional fields Wildcard, pre-evaluation 2878.4ms 38.6ms ~75x +1%
Login form — 3 fields, no wildcards Fast-check (flat) 0.1ms 0.0ms ~9x —

@imanimanyara
imanimanyara merged commit 8012cb5 into main Sep 6, 2026
10 of 11 checks passed
@imanimanyara
imanimanyara deleted the chore/pint-action-uses-shared-config branch September 6, 2026 17:30
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