Skip to content

[PHPUnitBridge] ignoreFile does not allow comments #45918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mondrake opened this issue Apr 2, 2022 · 0 comments · Fixed by #45921
Closed

[PHPUnitBridge] ignoreFile does not allow comments #45918

mondrake opened this issue Apr 2, 2022 · 0 comments · Fixed by #45921

Comments

@mondrake
Copy link
Contributor

mondrake commented Apr 2, 2022

Symfony version(s) affected

6.1.0

Description

The newly introduced ignoreFile does not accept lines starting with '#' as comments.

How to reproduce

Use an ignoreFile like

# PHPUnit 9.
/"PHPUnit\\Framework\\TestListener".*is deprecated/
/"PHPUnit\\Framework\\TestListenerDefaultImplementation".*is deprecated/
/xx"PHPUnit\\TextUI\\DefaultResultPrinter".*is considered internal/

you get an error like

Invalid pattern found in "/var/www/d10/core/deprecation-ignore.txt" on line "1": No ending delimiter '#' found
PHP Fatal error:  Uncaught RuntimeException: Invalid pattern found in "/var/www/d10/core/deprecation-ignore.txt" on line "1": No ending delimiter '#' found in /var/www/d10/vendor/symfony/phpunit-bridge/DeprecationErrorHandler/Configuration.php:124
Stack trace:
#0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler\Configuration::Symfony\Bridge\PhpUnit\DeprecationErrorHandler\{closure}()
#1 /var/www/d10/vendor/symfony/phpunit-bridge/DeprecationErrorHandler/Configuration.php(129): preg_match()
#2 /var/www/d10/vendor/symfony/phpunit-bridge/DeprecationErrorHandler/Configuration.php(345): Symfony\Bridge\PhpUnit\DeprecationErrorHandler\Configuration->__construct()
#3 /var/www/d10/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php(272): Symfony\Bridge\PhpUnit\DeprecationErrorHandler\Configuration::fromUrlEncodedString()
#4 /var/www/d10/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php(185): Symfony\Bridge\PhpUnit\DeprecationErrorHandler->getConfiguration()
#5 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->shutdown()
#6 {main}
  thrown in /var/www/d10/vendor/symfony/phpunit-bridge/DeprecationErrorHandler/Configuration.php on line 124

Apparently, parsing of the ignoreFile for patterns to be ignored does not consider lines starting with '#' as a comment.

Possible Solution

No response

Additional Context

No response

@mondrake mondrake added the Bug label Apr 2, 2022
nicolas-grekas added a commit that referenced this issue Apr 3, 2022
This PR was squashed before being merged into the 6.1 branch.

Discussion
----------

[PhpUnitBridge] Fix ignoreFile comments

| Q             | A
| ------------- | ---
| Branch?       | 6.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #45918
| License       | MIT

Commits
-------

72c0846 [PhpUnitBridge] Fix ignoreFile comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants