Repository navigation
Grade code style against the shared config, not Pint's defaults - #19
Merged
Merged
Conversation
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.
Benchmark results
|
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.
fix-php-code-style-issues.ymlranaglipanci/laravel-pint-actionwithconfigPath: 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 withcontents: writeandstefanzweifel/git-auto-commit-action, so on every PR touching a.phpfile it won, whilecomposer pintgraded against the sharedvendor/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
composer install+composer pint-fix— the same command thelintgate checks, so the fixer and the gate can no longer disagree.PostIncDecToPreIncDecRectoradded torector.php'swithSkip(). Rector rewrote$i++to++$iin 21 files and Pint'sincrement_stylerewrote every one back — observed by running them in sequence — so rector and pint could never both pass. Formatting goes to Pint.Verification
laranail-pint --testrector --dry-runphpstanThe test numbers are identical before and after the reformat, which is what establishes the change is style-only.