diff --git a/src/TodoByVersionRule.php b/src/TodoByVersionRule.php index 8d27200..0fb8c82 100644 --- a/src/TodoByVersionRule.php +++ b/src/TodoByVersionRule.php @@ -30,7 +30,7 @@ final class TodoByVersionRule implements Rule @?[a-zA-Z0-9_-]*\s* # optional username \s*[:-]?\s* # optional colon or hyphen \s+ # keyword/version separator - (?P[<>=]?[^\s:\-]+) # version + (?P[<>=]?[0-9]+[^\s:\-]+) # version \s*[:-]?\s* # optional colon or hyphen (?P.*) # rest of line as comment text }ix diff --git a/tests/data/version.php b/tests/data/version.php index b9a0ff5..f237479 100644 --- a/tests/data/version.php +++ b/tests/data/version.php @@ -10,3 +10,8 @@ function doFoo():void { // TODO: <1.0.0 // TODO: <1.0 // TODO: 1.0 + +// should not error in TodoByVersionRule +// TODO php:8.0.0 +// TODO php:8.0 +// TODO php:8