What happens
When the only staged PHP file is listed under parameters.excludePaths.analyse in the project's phpstan.neon, the commit gate runs phpstan on that file alone. phpstan answers [ERROR] No files found to analyse. and the gate reports a blocking finding:
BLOCKING …/clients/php/src/Types.php NOT checked — phpstan failed: [ERROR] No files found to analyse. (lint)
The file is excluded deliberately. It is generated code (azrtydxb/novamem clients/php/src/Types.php, written by go run ./clients/gen) with 244 level-6 findings by design, reviewed through its template instead. So every commit that regenerates it is blocked, unless it happens to stage a hand-written PHP file alongside it.
Repro (procoder 3.7.0)
phpstan.neon with paths: [src] and excludePaths: { analyse: [src/Types.php] }.
- Modify and stage only
src/Types.php.
- Run
procoder check or the PreToolUse hook on git commit. It blocks.
Expected
A file the project's phpstan config excludes should be skipped, the same as a .prettierignored file is for formatting. Equivalently, phpstan's "No files found to analyse" for paths that are all excluded should mean nothing to check, not a failure.
What happens
When the only staged PHP file is listed under
parameters.excludePaths.analysein the project'sphpstan.neon, the commit gate runs phpstan on that file alone. phpstan answers[ERROR] No files found to analyse.and the gate reports a blocking finding:The file is excluded deliberately. It is generated code (azrtydxb/novamem
clients/php/src/Types.php, written bygo run ./clients/gen) with 244 level-6 findings by design, reviewed through its template instead. So every commit that regenerates it is blocked, unless it happens to stage a hand-written PHP file alongside it.Repro (procoder 3.7.0)
phpstan.neonwithpaths: [src]andexcludePaths: { analyse: [src/Types.php] }.src/Types.php.procoder checkor the PreToolUse hook ongit commit. It blocks.Expected
A file the project's phpstan config excludes should be skipped, the same as a
.prettierignored file is for formatting. Equivalently, phpstan's "No files found to analyse" for paths that are all excluded should mean nothing to check, not a failure.