Skip to content

DevEx: phpc lint --json emits GitHub issue URLs from UnsupportedRegistry #484

@PurHur

Description

@PurHur

Problem

phpc lint --all examples/003-MiniWebApp --json reports node kinds and registry issue numbers (e.g. 115, 145), but contributors must manually open https://github.com/PurHur/php-compiler/issues/N. The MiniWebApp README blocker matrix links issues by hand.

Goal

Each JSON diagnostic includes a stable tracker URL when UnsupportedRegistry maps a node kind to an issue id:

{
  "file": "examples/003-MiniWebApp/src/Router.php",
  "line": 18,
  "message": "unsupported … ClassMethod",
  "issue": 145,
  "issue_url": "https://github.com/PurHur/php-compiler/issues/145"
}

Optional: make web-smoke prints the same URLs when logging 003 lint failures (#455).

Scope

  • lib/Lint/ JSON serializer adds issue_url when issue id present
  • bin/phpc.php lint --json help documents fields
  • test/unit/PhpcLintJsonTest.php asserts URL for a known registry mapping (e.g. Stmt_BreakLanguage: break and continue for loops and switch #115)
  • Update examples/003-MiniWebApp/README.md to reference JSON field (optional)

Acceptance criteria

docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  ./phpc lint --all examples/003-MiniWebApp --json | grep -q 'issues/145'

Exit 0 after implementation.

Verification (local / Docker only)

./script/ci-fast.sh --filter PhpcLintJson

No GitHub Actions required.

Dependencies

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions