Summary: Allow `@todo` comments to be linted as TODOs as well as `TODO` comments.
Test Plan: I added a new test case (`todo.lint-test`)
Reviewers: #blessed_reviewers, epriestley
Reviewed By: epriestley
CC: Korvin, epriestley, aran
Differential Revision: https://secure.phabricator.com/D8389
foreach ($comments as $token) {
$value = $token->getValue();
+ if ($token->getTypeName() === 'T_DOC_COMMENT') {
+ $regex = '/(TODO|@todo)/';
+ } else {
+ $regex = '/TODO/';
+ }
+
$matches = null;
$preg = preg_match_all(
- '/TODO/',
+ $regex,
$value,
$matches,
PREG_OFFSET_CAPTURE);
--- /dev/null
+<?php
+
+// TODO: Something goes here.
+
+/**
+ * @todo Something else goes here.
+ */
+~~~~~~~~~~
+disabled:3:4
+disabled:6:4