Skip to content

gate-16 misses the docblock above a multi-line PHP attribute #798

Description

@rubenvdlinde

Gate 16 (spec-coverage) reports missing @spec for a PHP method whose docblock carries @spec tags when a multi-line attribute sits between the docblock and the declaration.

Seen on ConductionNL/filinq, branch feat/template-charts-images-and-odf: lib/Service/CorrespondenceService.php::generate has three @spec openspec/... lines, then a 17-line #[McpTool(...)] attribute, then public function generate(.

Cause: _docblock_block() in hydra-gates/scripts/lib/check_spec_coverage.py walks up from the declaration and skips only lines that start with #[ or ]. The attribute's argument lines (name: 'generateCorrespondence',, comments, description: ...) stop the walk, so the gate finds no docblock.

Fix: when the walk meets a line ending an attribute ()]), skip back to the matching #[ line before looking for */.

Repro: any changed method with a multi-line attribute above it, run hydra-gates --scope-to-diff.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions