Skip to content

Fix code style instead of just checking it, in the pull request workflow#567

Open
fain182 wants to merge 4 commits intomainfrom
claude/add-cs-fixer-ci-fi7jN
Open

Fix code style instead of just checking it, in the pull request workflow#567
fain182 wants to merge 4 commits intomainfrom
claude/add-cs-fixer-ci-fi7jN

Conversation

@fain182
Copy link
Collaborator

@fain182 fain182 commented Feb 13, 2026

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 fixes

    • Runs on PHP 8.0 with Composer v2.2
    • Includes Composer dependency caching for faster execution
    • Automatically commits fixes with a descriptive commit message using git-auto-commit-action
  • Removed from build workflow: Removed the PHP CS Fixer dry-run check from .github/workflows/build.yml

    • The conditional check that only ran on PHP 8.0 has been removed
    • This simplifies the build workflow and avoids redundant checks

Benefits

  • Automation: Code style fixes are automatically applied and committed to PRs, reducing manual work
  • Separation of concerns: Style fixing is now separate from build validation
  • Better developer experience: Contributors get automatic style corrections without needing to run tools locally
  • Cleaner build workflow: The main build workflow focuses on testing and analysis rather than style enforcement

https://claude.ai/code/session_01WJEcEkXb8rGmmXPuF3nL95

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
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.85%. Comparing base (6780dfe) to head (3ce6eae).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fain182 fain182 changed the title Move PHP CS Fixer to automated pull request workflow Fix code style instead of just checking it, in the pull request workflow Feb 13, 2026
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