Problem/Motivation
The @group detection fails when you have a class annotation that is indented by more or less than one space. Which is a legimate thing to do, for example when using the namespace something { ... } syntax.
Core doesn't do that, and I guess we don't have coding standards for it, but phpstorm does it by default and I think it makes sense to support that.
Proposed resolution
There doesn't seem to be a reason to hardcode that we need one space in the regex. If we think that this could lease to false detections (I really don't know how?), then we could also do it with a dynamic number of spaces (but nothing else), but that seems to be unnecessarily complicated?
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | simpletest-regex-group-2491915-6-interdiff.txt | 2.47 KB | berdir |
| #6 | simpletest-regex-group-2491915-6.patch | 2.72 KB | berdir |
| #3 | simpletest-regex-group-2491915-3-test-only.patch | 964 bytes | berdir |
| #3 | simpletest-regex-group-2491915-3.patch | 1.97 KB | berdir |
Comments
Comment #1
berdirComment #2
alexpott\Drupal\Tests\simpletest\Unit\TestInfoParsingTest could test this.
Comment #3
berdirI like unit tests that don't require hundred lines of mocking code :)
Also found that I need to update a second check too or the @group ended up in the description.
Comment #5
miro_dietikerRan into this issue with monitoring / payment module tests.
https://www.drupal.org/node/2463769#comment-9946987
We should consistently check for the starting condition. Here is still a "^ " present that depends on single indentation.
I think we should safely check for the line beginning with any amount of spaces to avoid false detections in doc lines.
Comment #6
berdirMade the pattern more explicit, some documentation and extend the tests.
Comment #7
miro_dietikerYeah, now looks good to me.
Comment #8
alexpottCommitted 684602e and pushed to 8.0.x. Thanks!