PHP: Materialze PHPSTAN_SCANDIRS even if phpstan.neon is missing#22
Merged
PHP: Materialze PHPSTAN_SCANDIRS even if phpstan.neon is missing#22
PHPSTAN_SCANDIRS even if phpstan.neon is missing#22Conversation
Previously, the `phpstan-adjust-scandirs` action and `php-sa` workflow required a `phpstan.neon` to be present for scan directories to be materialized and used. - `phpstan-adjust-scandirs`: Sets `PHPSTAN_CONFIG_GENERATED=1` when no `phpstan.neon` is found, signaling that level and scan paths must be supplied via CLI. - `php-sa`: Removes the `hashFiles(phpstan.neon)` guard from the "Adjust scanDirectories" step so it runs whenever `PHPSTAN_SCANDIRS` is set. Separates config detection from argument building; supplies `--level`, scan directories, and autoload via CLI when config is absent or generated. Filters discovered directories to only those containing PHP files. - `phpstan-adjust-scandirs.php`: Treats a missing config file as an empty config instead of an error, allowing the script to generate a fresh `phpstan.neon` from the provided scan directories alone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the
phpstan-adjust-scandirsaction andphp-saworkflow required aphpstan.neonto be present for scan directories to be materialized and used.phpstan-adjust-scandirs: SetsPHPSTAN_CONFIG_GENERATED=1when nophpstan.neonis found, signaling that level and scan paths must be supplied via CLI.php-sa: Removes thehashFiles(phpstan.neon)guard from the "Adjust scanDirectories" step so it runs wheneverPHPSTAN_SCANDIRSis set. Separates config detection from argument building; supplies--level, scan directories, and autoload via CLI when config is absent or generated. Filters discovered directories to only those containing PHP files.phpstan-adjust-scandirs.php: Treats a missing config file as an empty config instead of an error, allowing the script to generate a freshphpstan.neonfrom the provided scan directories alone.