Skip to content

Commit

Permalink
Version 3.5.0-148.0.dev
Browse files Browse the repository at this point in the history
Merge ee43e8b into dev
  • Loading branch information
Dart CI committed May 13, 2024
2 parents ff786d9 + ee43e8b commit f1a6336
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ class ConvertToFlutterStyleTodoTest extends FixProcessorLintTest {
@override
String get lintCode => LintNames.flutter_style_todos;

Future<void> test_commentContent() async {
await resolveTestCode('''
// Here's a TODO and a todo and a TODO.
void f() { }
''');
await assertHasFix('''
// Here's a `TODO` and a `todo` and a `TODO`.
void f() { }
''', errorFilter: (e) => e.errorCode != TodoCode.TODO);
}

Future<void> test_docComment() async {
await resolveTestCode('''
/// Docs.
Expand Down
2 changes: 1 addition & 1 deletion pkg/linter/lib/src/rules/flutter_style_todos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FlutterStyleTodos extends LintRule {
'flutter_style_todos', "To-do comment doesn't follow the Flutter style.",
correctionMessage: 'Try following the Flutter style for to-do comments.');

static final _todoRegExp = RegExp(r'//+(.* )?TODO\b', caseSensitive: false);
static final _todoRegExp = RegExp(r'//+\s*TODO\b', caseSensitive: false);

static final RegExp _todoExpectedRegExp =
RegExp(r'// TODO\([a-zA-Z0-9][-a-zA-Z0-9\.]*\): ');
Expand Down
19 changes: 10 additions & 9 deletions pkg/linter/test/rules/flutter_style_todos_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ class FlutterStyleTodosTest extends LintRuleTest {
);
}

test_charactersBeforeTODO() async {
await assertNoDiagnostics(
r'''
// comment TODO(user): bla
/// final todo = Todo(name: 'test todo', description: 'todo description');
/// Something interesting. TODO(someone): this is an ugly test case.
''',
);
}

test_docComment() async {
await assertDiagnostics(
r'/// TODO(user): bla',
Expand Down Expand Up @@ -110,15 +120,6 @@ class FlutterStyleTodosTest extends LintRuleTest {
);
}

test_leadingText() async {
await assertDiagnostics(
r'// comment TODO(user): bla',
[
lint(0, 26),
],
);
}

test_missingColon() async {
await assertDiagnostics(
r'// TODO(user) bla',
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 5
PATCH 0
PRERELEASE 147
PRERELEASE 148
PRERELEASE_PATCH 0

0 comments on commit f1a6336

Please sign in to comment.