Fix code style instead of just checking it, in the pull request workflow#567
Open
Fix code style instead of just checking it, in the pull request workflow#567
Conversation
Replace the dry-run CS check in build.yml with a dedicated workflow that automatically runs php-cs-fixer and commits any fixes directly to the PR branch via stefanzweifel/git-auto-commit-action. This removes the burden from contributors who forget to run CS Fixer locally, and ensures the correct PHP/CS Fixer version is always used regardless of the contributor's local environment. https://claude.ai/code/session_01WJEcEkXb8rGmmXPuF3nL95
php-cs-fixer ^3.92 requires PHP >=8.1, so running on 8.0 required the IGNORE_ENV workaround. Using 8.1 removes the need for it and ensures cs-fixer runs on a fully supported PHP version. https://claude.ai/code/session_01WJEcEkXb8rGmmXPuF3nL95
php-cs-fixer ^3.x supports ^7.4 || ^8.0 natively, so PHP 8.0 is fully supported and no workaround is required. https://claude.ai/code/session_01WJEcEkXb8rGmmXPuF3nL95
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #567 +/- ##
=========================================
Coverage 97.85% 97.85%
Complexity 646 646
=========================================
Files 83 83
Lines 1864 1864
=========================================
Hits 1824 1824
Misses 40 40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
This PR refactors the PHP code style checking process by moving PHP CS Fixer from the build workflow to a dedicated automated pull request workflow that automatically commits fixes.
Key Changes
Added new workflow:
.github/workflows/cs-fixer.yml- A dedicated GitHub Actions workflow that runs PHP CS Fixer on pull requests and automatically commits any style fixesgit-auto-commit-actionRemoved from build workflow: Removed the PHP CS Fixer dry-run check from
.github/workflows/build.ymlBenefits
https://claude.ai/code/session_01WJEcEkXb8rGmmXPuF3nL95