Skip to content

Commit

Permalink
Fix 'Invalid version constraint ">=php"' false -positive (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored Dec 20, 2023
1 parent 4950745 commit 565b264
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/TodoByVersionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<version>[<>=]?[^\s:\-]+) # version
(?P<version>[<>=]?[0-9]+[^\s:\-]+) # version
\s*[:-]?\s* # optional colon or hyphen
(?P<comment>.*) # rest of line as comment text
}ix
Expand Down
5 changes: 5 additions & 0 deletions tests/data/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 565b264

Please sign in to comment.