Skip to content

devops: check php style with dresscode, so an agent's edit can be fixed as it is written - #232

Merged
landsman merged 4 commits into
mainfrom
worktree-dresscode
Oct 30, 2026
Merged

landsman merged 4 commits into
mainfrom
worktree-dresscode

Conversation

@landsman

@landsman landsman commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

phpcs with slevomat only reported, so a style mistake surfaced at make qa. dresscode checks the same rules and can fix them, which lets an agent's edit be corrected as it is written.

dresscode.neon keeps phpcs's three rules and takes over tabs, trailing whitespace, the final newline and strict_types from cli/lint.php. No coding standard is on, so nothing gets reformatted. Those four now need app/vendor; lint.php keeps the parse check, which still runs on a fresh clone. They also cover all of cli/ now, not only lint.php.

Why phpstan moved: dresscode 1.3.1 conflicts with phpstan below 2.3.4, and with the old pin composer quietly resolved 1.3.0.

Why --jobs 1: dresscode starts its workers through PHP_BINARY, which under php-cli is frankenphp, and it takes check for a command of its own.

Why not nette's php-fixer plugin: it needs a php on PATH and has the same PHP_BINARY problem. make dresscode-hook runs cli/dresscode-hook.php after an Edit or Write of a PHP file with the plugin's flags. It leaves rules the file already broke alone and never touches excluded files.

dresscode is young, 1.0.0 is from 2026-10-22, but it is a dev dependency, stripped from the package.

make qa, make check and make e2e pass (171, 40 and 3 scenarios). The rules were proven on a deliberately bad file, and each branch of the hook by piping its JSON in by hand; it has not yet run from a real agent session.

@landsman
landsman merged commit 32df0bc into main Oct 30, 2026
6 checks passed
@landsman
landsman deleted the worktree-dresscode branch October 30, 2026 21:39
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.

1 participant