staabm / phpstan-todo-by

Todo comments with expiration
https://staabm.github.io/2023/12/17/phpstan-todo-by-published.html
MIT License
173 stars 4 forks source link

Support more variations of todo comments #7

Closed m29corey closed 9 months ago

m29corey commented 9 months ago
  1. Adjusted parsing to handle php doc style comments, which then required parsing multi-line comments.
  2. Changed the regular expression to be case insensitive, and to use the 'x' modifier for pattern clarity.
  3. Added in support for multi-line php doc comments, so message points to correct line.
  4. Skipped checking if the comment starts with "todo" as that was more complicated when handling php doc comments. Ended up not being a performance issue when I tested on a large project with thousands of regular and php doc comments.
  5. Changed the message format to always start with "Expired on {$date}".

closes https://github.com/staabm/phpstan-todo-by/issues/3

m29corey commented 9 months ago

Oh, I also imported the global scope functions just because that seems to be the style that PHPStan itself uses.

staabm commented 9 months ago

thank you