OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library analyzer.src.dart.error.todo_codes; |
| 6 |
| 7 import 'package:analyzer/error/error.dart'; |
| 8 |
| 9 /** |
| 10 * The error code indicating a marker in code for work that needs to be finished |
| 11 * or revisited. |
| 12 */ |
| 13 class TodoCode extends ErrorCode { |
| 14 /** |
| 15 * The single enum of TodoCode. |
| 16 */ |
| 17 static const TodoCode TODO = const TodoCode('TODO'); |
| 18 |
| 19 /** |
| 20 * This matches the two common Dart task styles |
| 21 * |
| 22 * * TODO: |
| 23 * * TODO(username): |
| 24 * |
| 25 * As well as |
| 26 * * TODO |
| 27 * |
| 28 * But not |
| 29 * * todo |
| 30 * * TODOS |
| 31 */ |
| 32 static RegExp TODO_REGEX = |
| 33 new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(TODO:?\$))"); |
| 34 |
| 35 /** |
| 36 * Initialize a newly created error code to have the given [name]. |
| 37 */ |
| 38 const TodoCode(String name) : super(name, "{0}"); |
| 39 |
| 40 @override |
| 41 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
| 42 |
| 43 @override |
| 44 ErrorType get type => ErrorType.TODO; |
| 45 } |
OLD | NEW |