Skip to content

Add repository-wide PHPCS specification and PR enforcement workflow#572

Closed
Copilot wants to merge 2 commits intotrunkfrom
copilot/add-phpcs-action-and-specification
Closed

Add repository-wide PHPCS specification and PR enforcement workflow#572
Copilot wants to merge 2 commits intotrunkfrom
copilot/add-phpcs-action-and-specification

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 24, 2026

No coding standards were enforced in this repo, allowing non-WordPress-standard code (e.g., spaces instead of tabs) to land via PRs.

Changes

  • phpcs.xml.dist — Root-level PHPCS ruleset applying WordPress and WordPress-Docs standards to all PHP files repo-wide; excludes vendor/, node_modules/, and JS/CSS files.

  • composer.json — Root-level dev dependencies: squizlabs/php_codesniffer, wp-coding-standards/wpcs, phpcsstandards/phpcsutils, and dealerdirect/phpcodesniffer-composer-installer (auto-registers WPCS paths with PHPCS on composer install).

  • .github/workflows/phpcs.yml — Runs PHPCS on PRs and trunk pushes via shivammathur/setup-php. Outputs inline PR annotations via cs2pr. Uses continue-on-error: true to surface violations without immediately blocking PRs while existing code is brought into compliance. Scoped permissions: contents: read, checks: write.

  • .gitignore — Added vendor/ to root ignore.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add a PHPCS action for PRs, and a PHPCS specification for the entire repository</issue_title>
<issue_description>Currently there's nothing enforcing coding standards on this repo, which causes PRs using spaces at times.

Let's fix that.</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Add PHPCS action for PRs and specification for repository Add repository-wide PHPCS specification and PR enforcement workflow Mar 24, 2026
Copilot AI requested a review from dd32 March 24, 2026 03:53
Copilot finished work on behalf of dd32 March 24, 2026 03:53
@dd32
Copy link
Copy Markdown
Member

dd32 commented Mar 24, 2026

Claude took over in #573

@dd32 dd32 closed this Mar 24, 2026
@bazza bazza deleted the copilot/add-phpcs-action-and-specification branch March 24, 2026 04: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.

Add a PHPCS action for PRs, and a PHPCS specification for the entire repository

2 participants