Skip to content

v0.3.1

Choose a tag to compare

@mattyhansen mattyhansen released this 08 Jun 20:55
· 22 commits to main since this release
f036932

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 json gives editors and coding agents a stable, self-describing contract; --baseline/--diff/--since use value-independent identities so pre-existing findings stay suppressed and only new ones surface.
  • Changed-code feedback is fairer. --changed-scope=symbol returns only findings on changed symbols (plus anything new vs baseline) and drops untouched file/class aggregates; new --changed-scope=file keeps 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-class now recognises FQCN::method controllers under YAML _controller and the 4.1+ top-level controller: shortcut; service-ids and legacy strings are still ignored.
  • Text reports lead with the numbers. analyse and summary text output now show the composite score and finding counts up top, with the subcommand in the header. JSON output is unchanged.