The following valid deprecation fails:
* @deprecated in commerce:8.x-2.7 and will be removed from commerce:9.x-3.0.
* Use CurrencyFormatterInterface instead.
* @see https://www.drupal.org/node/2971732</blockquote>
With the following warnings:
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
-----------------------------------------------------------------------------
8 | WARNING | The deprecation in-version 'commerce:8.x-2.0' does not match the standard: drupal:n.n.n or project:n.x-n.n
8 | WARNING | The deprecation removal-version 'commerce:9.x-3.0' does not match the standard: drupal:n.n.n or project:n.x-n.n
-----------------------------------------------------------------------------
That's caused by the regexp for matching the project version that's missing a + quantifier.
Comments
Comment #2
jsacksick commentedhttps://github.com/pfrenssen/coder/pull/34
Comment #3
jonathan1055 commentedHi jsacksick,
Thanks for reporting this. I don't know how I missed that qualifier when I was writing the sniff, as I had my own local file of test case passes which included that type of case. And it fails now!
I confirm that that the addition of + fixes the problem (and also my local test data). The addition of the test case shows that this is now allowed and does not raise the warning.
Jonathan
Comment #4
jonathan1055 commentedRenamed the issue title as this only affects contrib deprecations not core deprecations.
I have just worked out how I missed this case. The regex was originally
preg_match('/^\w+:\d{1,2}\.x\-\d{1,2}\.\d{1,2}$/', $version)which was working fine, but was too generous as it allowed uppercase. I had to change it to force all lower-case, so it became
preg_match('/^[a-z\d_]:\d{1,2}\.x\-\d{1,2}\.\d{1,2}$/', $version)and that's where the + got lost. I knew it was working OK originally :-)
Comment #6
klausiThanks a lot for the quick follow up!
You 2 are definitely my favourite 2 Johnathans this month, contributing so generously here :-)
Comment #7
jonathan1055 commentedHey! I did not know that jsacksick was also a Jonathan. Good work.
Thanks Klausi for merging in the fix quickly too.
Comment #8
wim leersJust ran into the same problem at #2870435: Support additional stream wrappers. The fix is not yet in a release.
Comment #9
wim leersConfirmed that this is now blocking #2870435-77: Support additional stream wrappers: https://www.drupal.org/pift-ci-job/1276642
Comment #10
klausiWe have a bit of a fallout with this rule like in #3050416: @see for @deprecated tags too strict., so I would wait for another 1-2 weeks if other problems come up that we need to fix - and then make a release.
Comment #11
wim leers👍 Thanks for the info!
Comment #12
gábor hojtsyThere is also #3024461: Adopt consistent deprecation format for core and contrib deprecation messages where there is again no agreement on the right formats, so either coder needs to roll back the checks or we need more eyes on #3024461: Adopt consistent deprecation format for core and contrib deprecation messages to agree on consistent formats for trigger_error() and @deprecated.