Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: pkg/analyzer/lib/src/dart/error/todo_codes.dart

Issue 2442463002: Split out error codes into separate files (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/error/lint_codes.dart ('k') | pkg/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/error/todo_codes.dart
diff --git a/pkg/analyzer/lib/src/dart/error/todo_codes.dart b/pkg/analyzer/lib/src/dart/error/todo_codes.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3980f57e6f598db14af72efe9aaaddeef97f7ac6
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/error/todo_codes.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analyzer.src.dart.error.todo_codes;
+
+import 'package:analyzer/error/error.dart';
+
+/**
+ * The error code indicating a marker in code for work that needs to be finished
+ * or revisited.
+ */
+class TodoCode extends ErrorCode {
+ /**
+ * The single enum of TodoCode.
+ */
+ static const TodoCode TODO = const TodoCode('TODO');
+
+ /**
+ * This matches the two common Dart task styles
+ *
+ * * TODO:
+ * * TODO(username):
+ *
+ * As well as
+ * * TODO
+ *
+ * But not
+ * * todo
+ * * TODOS
+ */
+ static RegExp TODO_REGEX =
+ new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(TODO:?\$))");
+
+ /**
+ * Initialize a newly created error code to have the given [name].
+ */
+ const TodoCode(String name) : super(name, "{0}");
+
+ @override
+ ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
+
+ @override
+ ErrorType get type => ErrorType.TODO;
+}
« no previous file with comments | « pkg/analyzer/lib/src/dart/error/lint_codes.dart ('k') | pkg/analyzer/lib/src/error/codes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698