- Issue created by @scott_euser
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
Wouldnโt it be possible for the GitlabCI template to fallback to coreโs phpstan.neon.dist if the
contrib module does not include a phpstan.neon file? - ๐ฌ๐งUnited Kingdom scott_euser
Just checked how that would work: phpstan then actually throws errors if an ignore error is in place yet no occurrences of the error are actually found.
- Status changed to Fixed
about 1 year ago 10:22am 6 November 2023 - ๐ฌ๐งUnited Kingdom scott_euser
Okay turns out if I copy the full phpstan.neon.dist from core and remove the ignoreErrors that do not apply to my contrib module, it works fine:
# This file is copied from ./core/phpstan.neon.dist then set to only # ignore errors applicable to this project rather than all errors ignored # from Core as phpstan throws errors when ignore lines here are unused. # Configuration file for PHPStan static code checking, see https://phpstan.org . # PHPStan is triggered on Drupal CI in commit-code-check.sh. includes: - phar://phpstan.phar/conf/bleedingEdge.neon parameters: level: 1 paths: - . ignoreErrors: # new static() is a best practice in Drupal, so we cannot fix that. - "#^Unsafe usage of new static#"
I will update the documentation page to clarify.
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
Just checked how that would work: phpstan then actually throws errors if an ignore error is in place yet no occurrences of the error are actually found.
Darn. You're right.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
about 1 year ago 2:19pm 4 December 2023 - ๐บ๐ธUnited States fathershawn New York
I'll also add it to the docs, but you can add
reportUnmatchedIgnoredErrors: false
to your neon file and it won't squeak about ignored errors that didn't happen.