Skip to content

Enforce PHPCS on committed code before push - #645

Open
pythonyx135793 wants to merge 1 commit into
quantacms:masterfrom
pythonyx135793:codex/phpcs-pre-push-r582
Open

pythonyx135793 wants to merge 1 commit into
quantacms:masterfrom
pythonyx135793:codex/phpcs-pre-push-r582

Conversation

@pythonyx135793

@pythonyx135793 pythonyx135793 commented Oct 24, 2026 •

Copy link
Copy Markdown

Fixes #148.

The existing pre-push hook always returns success, even when PHPCS fails or is missing. This propagates failures and checks committed files at each outgoing tip, so an uncommitted correction or a different checked-out branch cannot hide invalid code.

The existing Composer development dependency and Quanta rules are retained. Root and nested-site checker lookup is explicit, missing tooling/rules blocks code pushes, and deletion/no-op/non-code pushes remain usable. Setup and test commands are documented in the README.

Validation: 18 integration tests pass on both Linux and Windows using real Git pushes to local bare repositories, PHP 8.5.12 and unmodified PHPCS 3.13.6. Original-hook controls reproduced five cases where invalid or unchecked pushes were accepted. Syntax and the new helper’s project coding-style check also pass. Linux test results.

The tests use synthetic source fixtures with the real tools. They cover the hook; the full Quanta application and unrelated logger test were not run.

This branch has not been deployed

No deployments
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.

Coding Style fixing & git pre-push hook

1 participant