Index: test/rule_test.dart |
diff --git a/test/rule_test.dart b/test/rule_test.dart |
index cd35c06282b55487908908e8c6c77a1484881b89..4483032a67c691f884f90cda2170f11cb868e0f9 100644 |
--- a/test/rule_test.dart |
+++ b/test/rule_test.dart |
@@ -309,8 +309,14 @@ defineSoloRuleTest(String ruleToTest) { |
Annotation extractAnnotation(String line) { |
int index = line.indexOf(new RegExp(r'(//|#)[ ]?LINT')); |
- //Grab the first comment to see if there's one preceding the annotation. |
- int comment = line.indexOf(new RegExp(r'(//|#)')); |
+ |
+ // Grab the first comment to see if there's one preceding the annotation. |
+ // Check for '#' first to allow for lints on dartdocs. |
+ int comment = line.indexOf('#'); |
+ if (comment == -1) { |
+ comment = line.indexOf('//'); |
+ } |
+ |
if (index > -1 && comment == index) { |
int column; |
int length; |
@@ -330,7 +336,7 @@ Annotation extractAnnotation(String line) { |
String msg = null; |
if (msgIndex < line.length) { |
msg = line.substring(index + msgIndex).trim(); |
- if (msg.length == 0) { |
+ if (msg.isEmpty) { |
msg = null; |
} |
} |