Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more variations of todo comments #7

Merged
merged 6 commits into from
Dec 17, 2023
Merged

Conversation

m29corey
Copy link
Contributor

@m29corey m29corey commented Dec 16, 2023

  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 #3

@m29corey
Copy link
Contributor Author

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

tests/TodoByRuleTest.php Outdated Show resolved Hide resolved
src/TodoByRule.php Outdated Show resolved Hide resolved
src/TodoByRule.php Outdated Show resolved Hide resolved
Which then required parsing multi-line comments.
@staabm staabm changed the title Some suggested changes Support more variations of todo comments Dec 17, 2023
@staabm staabm merged commit 9ab6e8a into staabm:main Dec 17, 2023
10 checks passed
@staabm
Copy link
Owner

staabm commented Dec 17, 2023

thank you

@m29corey m29corey deleted the suggestions branch December 18, 2023 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestions
2 participants