Skip to content

DevEx: phpc lint --all for project trees (MiniWebApp blocker report) #286

@PurHur

Description

@PurHur

Problem

phpc lint only accepts a single entry file (bin/lint.php). Multi-file apps (#67, #246 examples/003-MiniWebApp/) need a directory-wide report listing every unsupported construct with issue links — not one file at a time.

#243 gates shipped examples in CI but does not define recursive lint for future MiniWebApp trees.

Goal

phpc lint --all examples/003-MiniWebApp
# or: phpc lint --project examples/003-MiniWebApp/public/index.php

Walks include/require with string-literal paths (best effort), prints aggregated issues, exits non-zero if any file fails.

Implementation hints

  1. bin/lint.php / lib/Lint/Linter.php: add --all <dir> or --project <entry> flag.
  2. Reuse LintCompiler + UnsupportedRegistry (docs/unsupported-syntax.md).
  3. BFS/DFS from entry: follow literal include/require paths relative to file dir; skip dynamic includes with warning.
  4. --json: emit array of {file, line, kind, issue} for Reference: MiniWebApp lint-first skeleton (examples/003-MiniWebApp) #246 README blocker table generation.
  5. CI: optional test/unit/PhpcLintProjectTest.php on examples/000-HelloWorld (expect exit 0).

Acceptance criteria

docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  ./phpc lint --all examples/003-MiniWebApp

When #246 scaffold exists: output lists #192, #53, #99, etc. with file:line; exit code 1 until blockers close.

Verification (local only)

./script/ci-local.sh --filter PhpcLint

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