-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow ignoring "@group legacy" annotated test methods when Symfony PHPUnit bridge is in use #64
Comments
This PHPDoc tag is specific to Drupal, it's very non-standard. You have two options here:
|
No, it's not a drupal-ism, it's Symfony https://symfony.com/doc/current/components/phpunit_bridge.html#mark-tests-as-legacy |
Doesn't matter - it's still PHPUnit/Symfony specific. |
@ondrejmirtes is there anyway that you'd consider making this somehow configurable? Like maybe a solution would be to allow projects to configure which annotations mean deprecated so projects that use make use of @legacy could make phpstan-deprecation-rules consider that the same as @deprecated. |
The suggestion:
So maybe this is a won't fix and our only choice is to mark the tests |
I'd accept a PR for a new extension type - it can be an interface similar to this one: https://github.com/phpstan/phpstan-src/blob/master/src/Rules/Exceptions/ExceptionTypeResolver.php It would allow users to have a custom logic called to decide if a scope is deprecated or not. |
Coming back to this: So we'd need a new extension type for deprecations. Like
Edit: I read more, so the extension would go here. Would we add configuration to this extension then, allowing to specify additional deprecated tag strings?
Or something which received the type, so more thorough inspection could be done? |
@ondrejmirtes I know you're super busy chasing down some performance items in PHPStan, but I wanted to ping and see if you had more guidance on how you'd like to see the extension. I'll have work time available to add this. I'd like to support |
Still quite relevant this. |
I gave this a shot in #99. It's quite a bit of changes but adds scope resolvers to extend what is considered a deprecated scope. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
It would be useful to allow skipping analysis of
@legacy
annotated PHPUnit test methods test in PHPUnit.Drupal runs deprecation tests via PHPUnit and the Symfony's PHPUnit bridge. Current policy for runtime deprecated code is to write a
@legacy
annotated test that explicitly contains calls to deprecated code. PHPStan would now report these calls as errors, which is a duplicated check vs. existing tools. We cannot ignore entire files since it may well be that normal and deprecation tests are part of the same test class.See also:
The text was updated successfully, but these errors were encountered: