v0.3.1
gruff-php 0.3.1 - agent-hook contract, fairer changed-code feedback, new test-quality rule
0.3.1 gives editors and coding agents a stable JSON hook contract for changed-code feedback. It also makes changed-region scanning fairer, adds one conservative test-quality rule, fixes Symfony YAML route and changed-region accounting edges in project-wide dead-code analysis, and moves the headline numbers to the top of text reports. No breaking changes.
Highlights
- Agent-hook contract
gruff.hook.v1.gruff-php hook --format jsongives editors and coding agents a stable, self-describing contract;--baseline/--diff/--sinceuse value-independent identities so pre-existing findings stay suppressed and only new ones surface. - Changed-code feedback is fairer.
--changed-scope=symbolreturns only findings on changed symbols (plus anything new vs baseline) and drops untouched file/class aggregates; new--changed-scope=filekeeps file-level aggregates. Full scans are unchanged. - New rule
test-quality.static-analysis-redundant-test. Advisory rule flagging tests whose main assertion only restates a static declaration (class_exists,method_exists, and similar); it recommends asserting behaviour. On by default. - Symfony YAML routes no longer make live controllers look dead.
dead-code.unused-internal-classnow recognisesFQCN::methodcontrollers under YAML_controllerand the 4.1+ top-levelcontroller:shortcut; service-ids and legacy strings are still ignored. - Text reports lead with the numbers.
analyseandsummarytext output now show the composite score and finding counts up top, with the subcommand in the header. JSON output is unchanged.