Skip to content

0.5.0: honour neon excludePaths (closes #1)#2

Merged
fdaviddpt merged 1 commit into
mainfrom
fix/issue-1-honour-neon-excludes
May 24, 2026
Merged

0.5.0: honour neon excludePaths (closes #1)#2
fdaviddpt merged 1 commit into
mainfrom
fix/issue-1-honour-neon-excludes

Conversation

@fdaviddpt
Copy link
Copy Markdown
Contributor

0.5.0: honour neon excludePaths (closes #1)

Summary

  • PhpstanRunner now caches excludePaths.{analyse,analyseAndScan} at boot via the existing dump-parameters --json call
  • analyse() returns [] when the file matches an exclude glob — before ensureWorker() on warm calls, so excluded files pay no worker boot cost
  • TDD: 5 unit tests written first (RED) then implementation (GREEN). Full suite 12/12.

Test plan

  • phpunit tests/Unit/PhpstanRunnerExcludeTest.php — 5/5
  • phpunit (full) — 12/12
  • Manual: a file in excludePaths returns errors: [] instead of false-positive property.unused reports
  • Re-run the original DVSI repro: ./supertool validate:Dvsi/dvsi-private/tests/unit/.../SomeTest.php should now skip cleanly

Warm worker was force-analyzing files the CLI phpstan would skip,
producing false positives on test files whose lifecycle bootstrap
(setUpBeforeClass / tearDownAfterClass) wasn't loaded.

PhpstanRunner now:
- Caches excludePaths.{analyse,analyseAndScan} at boot via the
  existing dump-parameters --json round-trip
- Short-circuits analyse() with [] when the file matches
- Check fires BEFORE ensureWorker() on warm calls — excluded
  files pay no worker boot cost
- fnmatch handles absolute + relative globs + any-suffix match
  on absolute paths (so `tests/unit/*` matches
  /repo/tests/unit/Foo.php)

TDD: 5 unit tests written first (RED), then implemented (GREEN).
Closes #1.

Co-Authored-By: Max <noreply>
@fdaviddpt fdaviddpt merged commit ad0dfd7 into main May 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Force-analyzes files excluded by neon → false-positive errors on test files

1 participant