You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on an attempt to create a deprecation baseline for Drupal, I realised that on top of the baseline file it would be good to have the possibility to skip/silence some deprecation patterns. In a way, similar to what PHPStan is doing, where you can have an errors baseline file + a separate section of ignoreErrors patterns in its configuration file. Then, BOTH when generating a baseline AND when using it, any deprecation matching any pattern from the list should be skipped (i.e. during generation -> not written to the baseline file, during usage -> not reported).
Example
For example (maybe not the best one, but this is one that generates a lot of noise), we have a deprecation triggered within a test listener:
The \"Drupal\\Tests\\Listeners\\DrupalListener\" class uses \"PHPUnit\\Framework\\TestListenerDefaultImplementation\" that is deprecated The 'TestListener' interface is deprecated.
this deprecation would be triggered for every test, and we have thousands. Also, it's a deprecation from PHPUnit, so nothing directly actionable by the Drupal community.
Having an ignoreFile option indicating a file that lists patterns of deprecations to be silenced like
SYMFONY_DEPRECATIONS_HELPER='generateBaseline=true&baselineFile=./tests/allowed.json&ignoreFile=./tests/ignored.json'
would do.
The text was updated successfully, but these errors were encountered:
… file that lists deprecation messages to ignore (mondrake)
This PR was squashed before being merged into the 6.1 branch.
Discussion
----------
[PhpUnitBridge] Add option `ignoreFile` to configure a file that lists deprecation messages to ignore
| Q | A
| ------------- | ---
| Branch? | 6.1
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no
| Tickets | Fix#45223
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against the latest branch.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
Commits
-------
2809e40 [PhpUnitBridge] Add option `ignoreFile` to configure a file that lists deprecation messages to ignore
Uh oh!
There was an error while loading. Please reload this page.
Description
While working on an attempt to create a deprecation baseline for Drupal, I realised that on top of the baseline file it would be good to have the possibility to skip/silence some deprecation patterns. In a way, similar to what PHPStan is doing, where you can have an errors baseline file + a separate section of
ignoreErrors
patterns in its configuration file. Then, BOTH when generating a baseline AND when using it, any deprecation matching any pattern from the list should be skipped (i.e. during generation -> not written to the baseline file, during usage -> not reported).Example
For example (maybe not the best one, but this is one that generates a lot of noise), we have a deprecation triggered within a test listener:
The \"Drupal\\Tests\\Listeners\\DrupalListener\" class uses \"PHPUnit\\Framework\\TestListenerDefaultImplementation\" that is deprecated The 'TestListener' interface is deprecated.
this deprecation would be triggered for every test, and we have thousands. Also, it's a deprecation from PHPUnit, so nothing directly actionable by the Drupal community.
Having an
ignoreFile
option indicating a file that lists patterns of deprecations to be silenced likeSYMFONY_DEPRECATIONS_HELPER='generateBaseline=true&baselineFile=./tests/allowed.json&ignoreFile=./tests/ignored.json'
would do.
The text was updated successfully, but these errors were encountered: