Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15469676
D8389.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
943 B
Referenced Files
None
Subscribers
None
D8389.diff
View Options
Index: src/lint/linter/ArcanistXHPASTLinter.php
===================================================================
--- src/lint/linter/ArcanistXHPASTLinter.php
+++ src/lint/linter/ArcanistXHPASTLinter.php
@@ -2036,9 +2036,15 @@
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);
Index: src/lint/linter/__tests__/xhpast/todo.lint-test
===================================================================
--- /dev/null
+++ src/lint/linter/__tests__/xhpast/todo.lint-test
@@ -0,0 +1,10 @@
+<?php
+
+// TODO: Something goes here.
+
+/**
+ * @todo Something else goes here.
+ */
+~~~~~~~~~~
+disabled:3:4
+disabled:6:4
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 5, 3:23 PM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7733313
Default Alt Text
D8389.diff (943 B)
Attached To
Mode
D8389: Correctly identify `@todo` comments as TODOs.
Attached
Detach File
Event Timeline
Log In to Comment