+ flutter_style_todos

Enabled `flutter_style_todos` in analyzer packages:

* `analyzer_cli`
* `analyzer_plugin`
* `analyzer_utilities`
* `meta`


Change-Id: I5fcd76bfa5a3bdeb14d6a81b8193129c6d83d0e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335405
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
pq 2023-11-13 00:14:09 +00:00 committed by Commit Queue
parent 57a2fb6167
commit f962700302
28 changed files with 107 additions and 90 deletions

View file

@ -11,6 +11,8 @@ import 'dart:convert' hide JsonDecoder;
import 'package:analysis_server_client/src/protocol/protocol_base.dart';
import 'package:analysis_server_client/src/protocol/protocol_internal.dart';
// ignore_for_file: flutter_style_todos
/// AddContentOverlay
///
/// {

View file

@ -25,6 +25,7 @@ linter:
directives_ordering: true
empty_catches: true
enable_null_safety: true
flutter_style_todos: true
# We import heavily from package:analyzer/src.
implementation_imports: false

View file

@ -173,7 +173,7 @@ class Driver implements CommandLineStarter {
// time during the following analysis.
SeverityProcessor defaultSeverityProcessor;
defaultSeverityProcessor = (AnalysisError error) {
// TODO(pq) get file path from `error.source.fullName`
// TODO(pq): get file path from `error.source.fullName`
return determineProcessedSeverity(
error, options, analysisDriver!.analysisOptions);
};
@ -507,7 +507,7 @@ class _AnalysisContextProvider {
return _analysisContext!.driver;
}
/// TODO(scheglov) Use analyzedFiles()
// TODO(scheglov): Use analyzedFiles()
PathFilter get pathFilter {
var contextRoot = analysisContext!.contextRoot;
var optionsFile = contextRoot.optionsFile;

View file

@ -306,7 +306,7 @@ class HumanErrorFormatter extends ErrorFormatter {
}
var contextMessages = <ContextMessage>[];
for (var message in error.contextMessages) {
// TODO(scheglov) We should add `LineInfo` to `DiagnosticMessage`.
// TODO(scheglov): We should add `LineInfo` to `DiagnosticMessage`.
var session = result.session.analysisContext;
if (session is DriverBasedAnalysisContext) {
var fileResult = session.driver.getFileSync(message.filePath);

View file

@ -142,14 +142,14 @@ class CommandLineOptions {
for (var variable in variables) {
var index = variable.indexOf('=');
if (index < 0) {
// TODO (brianwilkerson) Decide the semantics we want in this case.
// TODO(brianwilkerson): Decide the semantics we want in this case.
// The VM prints "No value given to -D option", then tries to load '-Dfoo'
// as a file and dies. Unless there was nothing after the '-D', in which
// case it prints the warning and ignores the option.
} else {
var name = variable.substring(0, index);
if (name.isNotEmpty) {
// TODO (brianwilkerson) Decide the semantics we want in the case where
// TODO(brianwilkerson): Decide the semantics we want in the case where
// there is no name. If there is no name, the VM tries to load a file
// named '-D' and dies.
declaredVariables[name] = variable.substring(index + 1);
@ -299,8 +299,8 @@ class CommandLineOptions {
/// are those that are typically used to control the way in which the code is
/// analyzed.
///
/// TODO(danrubel) Update DDC to support all the options defined in this method
/// then remove the [ddc] named argument from this method.
// TODO(danrubel): Update DDC to support all the options defined in this method
// then remove the [ddc] named argument from this method.
static void _defineAnalysisArguments(ArgParser parser,
{bool hide = true, bool ddc = false}) {
parser.addOption(_sdkPathOption,

View file

@ -13,6 +13,7 @@ linter:
#dangling_library_doc_comments: true
depend_on_referenced_packages: true
enable_null_safety: true
flutter_style_todos: true
implicit_call_tearoffs: true
library_annotations: true
omit_local_variable_types: true

View file

@ -231,13 +231,13 @@ abstract class ServerPlugin {
for (var event in parameters.events) {
switch (event.type) {
case WatchEventType.ADD:
// TODO(brianwilkerson) Handle the event.
// TODO(brianwilkerson): Handle the event.
break;
case WatchEventType.MODIFY:
await contentChanged([event.path]);
break;
case WatchEventType.REMOVE:
// TODO(brianwilkerson) Handle the event.
// TODO(brianwilkerson): Handle the event.
break;
default:
// Ignore unhandled watch event types.

View file

@ -11,6 +11,8 @@ import 'dart:convert' hide JsonDecoder;
import 'package:analyzer_plugin/protocol/protocol.dart';
import 'package:analyzer_plugin/src/protocol/protocol_internal.dart';
// ignore_for_file: flutter_style_todos
/// AddContentOverlay
///
/// {

View file

@ -95,7 +95,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
String? nameGroupName,
DartType? superclass,
String? superclassGroupName}) {
// TODO(brianwilkerson) Add support for type parameters, probably as a
// TODO(brianwilkerson): Add support for type parameters, probably as a
// parameterWriter parameter.
if (isAbstract) {
write(Keyword.ABSTRACT.lexeme);
@ -111,7 +111,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
write(' extends ');
writeType(superclass, groupName: superclassGroupName);
} else if (mixins != null && mixins.isNotEmpty) {
// TODO(brianwilkerson) Remove this branch when 2.1 semantics are
// TODO(brianwilkerson): Remove this branch when 2.1 semantics are
// supported everywhere.
write(' extends Object ');
}
@ -361,7 +361,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
void Function()? membersWriter,
String? nameGroupName,
Iterable<DartType>? superclassConstraints}) {
// TODO(brianwilkerson) Add support for type parameters, probably as a
// TODO(brianwilkerson): Add support for type parameters, probably as a
// parameterWriter parameter.
write('mixin ');
if (nameGroupName == null) {
@ -681,7 +681,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
@override
void writeParametersMatchingArguments(ArgumentList argumentList) {
// TODO(brianwilkerson) Handle the case when there are required parameters
// TODO(brianwilkerson): Handle the case when there are required parameters
// after named parameters.
var usedNames = <String>{};
List<Expression> arguments = argumentList.arguments;
@ -734,7 +734,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
write(' ');
}
}
// TODO(brianwilkerson) The name of the setter is unlikely to be a good name
// TODO(brianwilkerson): The name of the setter is unlikely to be a good name
// for the parameter. We need to find a better name to produce here.
write(name);
write(') ');
@ -917,7 +917,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
}
if (type is RecordType) {
// TODO(brianwilkerson) This should return `false` if the `records`
// TODO(brianwilkerson): This should return `false` if the `records`
// feature is not enabled.
return true;
}
@ -1069,7 +1069,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
if (suggestions.isNotEmpty) {
return suggestions;
}
// TODO(brianwilkerson) Verify that the name below is not in the set of used names.
// TODO(brianwilkerson): Verify that the name below is not in the set of used names.
return <String>['param$index'];
}
@ -1163,7 +1163,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
return;
}
// TODO(scheglov) We should use "methodBeingCopied" to verify that
// TODO(scheglov): We should use "methodBeingCopied" to verify that
// we really are just copying this type parameter.
if (element is TypeParameterElement) {
return;
@ -1295,7 +1295,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
}
if (type is RecordType) {
// TODO(brianwilkerson) This should return `false` if the `records`
// TODO(brianwilkerson): This should return `false` if the `records`
// feature is not enabled. More importantly, we can't currently return
// `false` if some portion of a type has already been written, so we
// need to figure out what to do when a record type is nested in another

View file

@ -174,7 +174,7 @@ class CompletionTarget {
// Try to replace with a comment token.
var commentToken = _getContainingCommentToken(entity, offset);
if (commentToken != null) {
// TODO(scheglov) This is duplicate of the code below.
// TODO(scheglov): This is duplicate of the code below.
// If the preceding comment is dartdoc token, then update
// the containing node to be the dartdoc comment.
// Otherwise completion is not required.

View file

@ -91,7 +91,7 @@ class OpType {
/// Indicates whether the completion location requires a constant expression
/// without being a constant context.
// TODO(brianwilkerson) Consider using this value to control whether non-const
// TODO(brianwilkerson): Consider using this value to control whether non-const
// elements are suggested.
bool mustBeConst = false;
@ -313,7 +313,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
optype.includeTypeNameSuggestions = true;
} else if (identical(entity, node.message)) {
optype.completionLocation = 'AssertInitializer_message';
// TODO(brianwilkerson) Consider including return value suggestions and
// TODO(brianwilkerson): Consider including return value suggestions and
// type name suggestions here.
}
}
@ -326,7 +326,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
optype.includeTypeNameSuggestions = true;
} else if (identical(entity, node.message)) {
optype.completionLocation = 'AssertStatement_message';
// TODO(brianwilkerson) Consider including return value suggestions and
// TODO(brianwilkerson): Consider including return value suggestions and
// type name suggestions here.
}
}
@ -623,7 +623,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
type = parent.staticType;
if (type is FunctionType) {
if (type.returnType is VoidType) {
// TODO(brianwilkerson) Determine whether the return type can ever
// TODO(brianwilkerson): Determine whether the return type can ever
// be inferred as void and remove this case if it can't be.
optype.includeVoidReturnSuggestions = true;
} else {
@ -1075,7 +1075,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
identical(entity, node.name) && node.returnType == null) {
optype.completionLocation = 'MethodDeclaration_returnType';
}
// TODO(brianwilkerson) In visitFunctionDeclaration, this is conditional. It
// TODO(brianwilkerson): In visitFunctionDeclaration, this is conditional. It
// seems like it should be the same in both places.
optype.includeTypeNameSuggestions = true;
}
@ -1769,7 +1769,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
} else if (parent is FunctionExpressionInvocation) {
return 'function';
} else if (parent is InstanceCreationExpression) {
// TODO(brianwilkerson) Enable this case.
// TODO(brianwilkerson): Enable this case.
// if (flutter.isWidgetType(parent.staticType)) {
// return 'widgetConstructor';
// }

View file

@ -169,7 +169,7 @@ class AnalyzerConverter {
} else if (element is analyzer.FieldElement && element.isEnumConstant
// MyEnum.values and MyEnum.one.index return isEnumConstant = true
// so these additional checks are necessary.
// TODO(danrubel) MyEnum.values is constant, but is a list
// TODO(danrubel): MyEnum.values is constant, but is a list
// so should it return isEnumConstant = true?
// MyEnum.one.index is final but *not* constant
// so should it return isEnumConstant = true?
@ -195,7 +195,7 @@ class AnalyzerConverter {
/// Return a textual representation of the parameters of the given [element],
/// or `null` if the element does not have any parameters.
String? _getParametersString(analyzer.Element element) {
// TODO(scheglov) expose the corresponding feature from ExecutableElement
// TODO(scheglov): expose the corresponding feature from ExecutableElement
List<analyzer.ParameterElement> parameters;
if (element is analyzer.ExecutableElement) {
// valid getters don't have parameters
@ -272,7 +272,7 @@ class AnalyzerConverter {
}
bool _isAbstract(analyzer.Element element) {
// TODO(scheglov) add isAbstract to Element API
// TODO(scheglov): add isAbstract to Element API
if (element is analyzer.ClassElement) {
return element.isAbstract;
} else if (element is analyzer.MethodElement) {
@ -284,7 +284,7 @@ class AnalyzerConverter {
}
bool _isConst(analyzer.Element element) {
// TODO(scheglov) add isConst to Element API
// TODO(scheglov): add isConst to Element API
if (element is analyzer.ConstructorElement) {
return element.isConst;
} else if (element is analyzer.VariableElement) {
@ -294,7 +294,7 @@ class AnalyzerConverter {
}
bool _isFinal(analyzer.Element element) {
// TODO(scheglov) add isFinal to Element API
// TODO(scheglov): add isFinal to Element API
if (element is analyzer.VariableElement) {
return element.isFinal;
}
@ -302,7 +302,7 @@ class AnalyzerConverter {
}
bool _isStatic(analyzer.Element element) {
// TODO(scheglov) add isStatic to Element API
// TODO(scheglov): add isStatic to Element API
if (element is analyzer.ExecutableElement) {
return element.isStatic;
} else if (element is analyzer.PropertyInducingElement) {

View file

@ -275,7 +275,7 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor<void> {
if (resolvedUri is DirectiveUriWithSource) {
final source = resolvedUri.source;
if (resourceProvider.getResource(source.fullName).exists) {
// TODO(brianwilkerson) If the analyzer ever resolves the URI to a
// TODO(brianwilkerson): If the analyzer ever resolves the URI to a
// library, use that library element to create the region.
var uriNode = node.uri;
if (computer._isWithinRequestedRange(uriNode.offset, uriNode.length)) {

View file

@ -141,7 +141,7 @@ abstract class AbstractAnalysisServerIntegrationTest
currentAnalysisErrors[params.file] = params.errors;
});
var serverConnected = Completer();
// TODO(brianwilkerson) Implement this.
// TODO(brianwilkerson): Implement this.
// onServerConnected.listen((_) {
// outOfTestExpect(serverConnected.isCompleted, isFalse);
// serverConnected.complete();
@ -185,7 +185,7 @@ abstract class AbstractAnalysisServerIntegrationTest
/// can be used.
Future standardAnalysisSetup({bool subscribeStatus = true}) {
var futures = <Future>[];
// TODO(brianwilkerson) Implement this.
// TODO(brianwilkerson): Implement this.
// if (subscribeStatus) {
// futures.add(sendServerSetSubscriptions([ServerService.STATUS]));
// }

View file

@ -13,6 +13,8 @@ import 'package:test/test.dart';
import 'integration_tests.dart';
// ignore_for_file: flutter_style_todos
/// AddContentOverlay
///
/// {

View file

@ -42,7 +42,7 @@ class PluginIsolateChannelTest {
done = true;
});
channel.close();
// TODO(brianwilkerson) Figure out how to wait until the handler has been
// TODO(brianwilkerson): Figure out how to wait until the handler has been
// called.
await _pumpEventQueue();
expect(done, isTrue);

View file

@ -315,7 +315,7 @@ class FileEditBuilderImplTest extends AbstractChangeBuilderTest {
}
Future<void> test_addDeletion_adjacent_lowerOffsetFirst() async {
// TODO(brianwilkerson) This should also merge the deletions, but is written
// TODO(brianwilkerson): This should also merge the deletions, but is written
// to ensure that existing uses of FileEditBuilder continue to work even
// without that change.
var firstOffset = 23;
@ -337,7 +337,7 @@ class FileEditBuilderImplTest extends AbstractChangeBuilderTest {
}
Future<void> test_addDeletion_adjacent_lowerOffsetSecond() async {
// TODO(brianwilkerson) This should also merge the deletions, but is written
// TODO(brianwilkerson): This should also merge the deletions, but is written
// to ensure that existing uses of FileEditBuilder continue to work even
// without that change.
var firstOffset = 23;

View file

@ -340,7 +340,7 @@ void g() {}
Future<void> test_assertInitializer_secondArgument() async {
addTestSource('class C { C() : assert(true, ^); }');
// TODO(brianwilkerson) This should have a location of
// TODO(brianwilkerson): This should have a location of
// 'AssertInitializer_message'
await assertOpType();
}
@ -356,7 +356,7 @@ void g() {}
Future<void> test_assertStatement_secondArgument() async {
addTestSource('main() {assert(true, ^)}');
// TODO(brianwilkerson) This should have a location of
// TODO(brianwilkerson): This should have a location of
// 'AssertStatement_message'
await assertOpType();
}
@ -386,7 +386,7 @@ void g() {}
main() {
int a;
^ b = 1;}''');
// TODO (danrubel) When entering 1st of 2 identifiers on assignment LHS
// TODO(danrubel): When entering 1st of 2 identifiers on assignment LHS
// the user may be either (1) entering a type for the assignment
// or (2) starting a new statement.
// Consider suggesting only types
@ -425,7 +425,7 @@ void g() {}
main() {
int a;
int^ b = 1;}''');
// TODO (danrubel) When entering 1st of 2 identifiers on assignment LHS
// TODO(danrubel): When entering 1st of 2 identifiers on assignment LHS
// the user may be either (1) entering a type for the assignment
// or (2) starting a new statement.
// Consider suggesting only types
@ -1366,7 +1366,7 @@ int x = E(^);
Future<void> test_forStatement_updaters() async {
// SimpleIdentifier ForStatement
addTestSource('main() {for (int index = 0; index < 10; i^)}');
// TODO (danrubel) might want to exclude methods/functions with void return
// TODO(danrubel): might want to exclude methods/functions with void return
await assertOpType(
completionLocation: 'ForParts_updater',
constructors: true,
@ -1514,7 +1514,7 @@ int x = E(^);
addTestSource('''
/// some dartdoc
^ zoo(z) { } String name;''');
// TODO(brianwilkerson) Perhaps this should have a location of
// TODO(brianwilkerson): Perhaps this should have a location of
// 'CompilationUnit_declaration' (or 'CompilationUnit_directive')
await assertOpType(
completionLocation: 'FunctionDeclaration_returnType', typeNames: true);
@ -1545,7 +1545,7 @@ int x = E(^);
test_functionDeclaration_returnType_afterStarDocComment2() async {
// FunctionDeclaration CompilationUnit
addTestSource('/** */^ zoo(z) { } String name;');
// TODO(brianwilkerson) Perhaps this should have a location of
// TODO(brianwilkerson): Perhaps this should have a location of
// 'CompilationUnit_declaration' (or 'CompilationUnit_directive')
await assertOpType(
completionLocation: 'FunctionDeclaration_returnType', typeNames: true);
@ -1810,7 +1810,7 @@ main() {
Future<void> test_literal_list() async {
// ']' ListLiteral ArgumentList MethodInvocation
addTestSource('main() {var Some; print([^]);}');
// TODO(brianwilkerson) This should have a location of
// TODO(brianwilkerson): This should have a location of
// 'ListLiteral_element'
await assertOpType(constructors: true, returnValue: true, typeNames: true);
}
@ -1834,7 +1834,7 @@ main() {
Future<void> test_mapLiteralEntry_emptyKey() async {
// MapLiteralEntry MapLiteral VariableDeclaration
addTestSource('foo = {^');
// TODO(brianwilkerson) This should have a location of
// TODO(brianwilkerson): This should have a location of
// 'SetOrMapLiteral_element'
await assertOpType(constructors: true, returnValue: true, typeNames: true);
}
@ -1881,7 +1881,7 @@ class C2 {
zoo(z) { } String name;
}
''');
// TODO(brianwilkerson) This should have a location of
// TODO(brianwilkerson): This should have a location of
// 'ClassDeclaration_member'
await assertOpType();
}
@ -1989,7 +1989,7 @@ class C2 {
^ zoo(z) { } String name;
}
''');
// TODO(brianwilkerson) Perhaps this should have a location of
// TODO(brianwilkerson): Perhaps this should have a location of
// 'ClassDeclaration_member'.
await assertOpType(
completionLocation: 'MethodDeclaration_returnType', typeNames: true);
@ -2004,7 +2004,7 @@ class C2 {
^ zoo(z) { } String name;
''');
// TODO(brianwilkerson) Perhaps this should have a location of
// TODO(brianwilkerson): Perhaps this should have a location of
// 'ClassDeclaration_member'.
await assertOpType(
completionLocation: 'MethodDeclaration_returnType', typeNames: true);
@ -2030,7 +2030,7 @@ class C2 {
test_methodDeclaration_inClass_returnType_afterStarDocComment() async {
// MethodDeclaration ClassDeclaration CompilationUnit
addTestSource('class C2 {/** */ ^ zoo(z) { } String name; }');
// TODO(brianwilkerson) Perhaps this should have a location of
// TODO(brianwilkerson): Perhaps this should have a location of
// 'ClassDeclaration_member'.
await assertOpType(
completionLocation: 'MethodDeclaration_returnType', typeNames: true);
@ -2040,7 +2040,7 @@ class C2 {
test_methodDeclaration_inClass_returnType_afterStarDocComment2() async {
// MethodDeclaration ClassDeclaration CompilationUnit
addTestSource('class C2 {/** */^ zoo(z) { } String name; }');
// TODO(brianwilkerson) Perhaps this should have a location of
// TODO(brianwilkerson): Perhaps this should have a location of
// 'ClassDeclaration_member'.
await assertOpType(
completionLocation: 'MethodDeclaration_returnType', typeNames: true);
@ -2135,7 +2135,7 @@ void f(int a, {int b}) {}
Future<void> test_postfixExpression_inOperator() async {
// SimpleIdentifier PostfixExpression ForStatement
addTestSource('int x = 0; main() {ax+^+;}');
// TODO(brianwilkerson) This should probably have a location of
// TODO(brianwilkerson): This should probably have a location of
// 'BinaryExpression_+_rightOperand'
await assertOpType(constructors: true, returnValue: true, typeNames: true);
}
@ -2200,7 +2200,7 @@ void f(int a, {int b}) {}
Future<void> test_propertyAccess_noTarget3() async {
// SimpleIdentifier PropertyAccess CascadeExpressions
addTestSource('main() {..^}');
// TODO(brianwilkerson) This should have a location of
// TODO(brianwilkerson): This should have a location of
// 'PropertyAccess_propertyName' (as should several others before this).
await assertOpType();
}
@ -2424,7 +2424,7 @@ void f() {
Future<void> test_simpleFormalParameter_functionType_name() async {
addTestSource('void Function(int ^) v;');
// TODO(brianwilkerson) This should not have a location.
// TODO(brianwilkerson): This should not have a location.
await assertOpType(
completionLocation: 'FormalParameterList_parameter', varNames: true);
}
@ -2436,7 +2436,7 @@ void f() {
Future<void> test_simpleFormalParameter_functionType_name_optional() async {
addTestSource('void Function([int ^]) v;');
// TODO(brianwilkerson) This should not have a location.
// TODO(brianwilkerson): This should not have a location.
await assertOpType(
completionLocation: 'FormalParameterList_parameter', varNames: true);
}
@ -2455,7 +2455,7 @@ void f() {
Future<void> test_simpleFormalParameter_name_typed() async {
addTestSource('f(String ^, int b) {}');
// TODO(brianwilkerson) This should not have a location.
// TODO(brianwilkerson): This should not have a location.
await assertOpType(
completionLocation: 'FormalParameterList_parameter', varNames: true);
}
@ -2467,7 +2467,7 @@ void f() {
Future<void> test_simpleFormalParameter_name_typed_last() async {
addTestSource('f(String ^) {}');
// TODO(brianwilkerson) This should not have a location.
// TODO(brianwilkerson): This should not have a location.
await assertOpType(
completionLocation: 'FormalParameterList_parameter', varNames: true);
}
@ -2527,7 +2527,7 @@ void f() {
Future<void> test_simpleFormalParameter_untyped() async {
addTestSource('main(final ^) {}');
// TODO(brianwilkerson) This should have a location of
// TODO(brianwilkerson): This should have a location of
// 'FormalParameterList_parameter'
await assertOpType(typeNames: true, varNames: false);
}
@ -2689,7 +2689,7 @@ m() {switch (x) {case ^}}
// no semicolon between completion point and next statement
set s1(I x) {} set _s2(I x) {this.^ m(null);}
}''');
// TODO(brianwilkerson) We should not be adding constructors here.
// TODO(brianwilkerson): We should not be adding constructors here.
await assertOpType(
constructors: true,
returnValue: true,
@ -2922,7 +2922,7 @@ m() {switch (x) {case ^}}
Future<void> test_tryStatement_catch_4a2() async {
addTestSource('main() {try {} c^ on SomeException {}}');
// TODO(brianwilkerson) This should not have a location.
// TODO(brianwilkerson): This should not have a location.
await assertOpType(completionLocation: 'Block_statement');
}
@ -2933,7 +2933,7 @@ m() {switch (x) {case ^}}
Future<void> test_tryStatement_catch_4b2() async {
addTestSource('main() {try {} c^ catch (e) {}}');
// TODO(brianwilkerson) This should not have a location.
// TODO(brianwilkerson): This should not have a location.
await assertOpType(completionLocation: 'Block_statement');
}
@ -2944,7 +2944,7 @@ m() {switch (x) {case ^}}
Future<void> test_tryStatement_catch_4c2() async {
addTestSource('main() {try {} c^ finally {}}');
// TODO(brianwilkerson) This should not have a location.
// TODO(brianwilkerson): This should not have a location.
await assertOpType(completionLocation: 'Block_statement');
}

View file

@ -127,7 +127,7 @@ class AbstractContextTest with ResourceProviderMixin {
}
/// Write an analysis options file based on the given arguments.
/// TODO(asashour) Use AnalysisOptionsFileConfig
// TODO(asashour): Use AnalysisOptionsFileConfig
void writeTestPackageAnalysisOptionsFile({
List<String>? lints,
}) {

View file

@ -324,7 +324,7 @@ enum E2 { three, four }''');
}
expect(element.parameters, isNull);
expect(element.returnType, '_E1');
// TODO(danrubel) determine why enum constant is not marked as deprecated
// TODO(danrubel): determine why enum constant is not marked as deprecated
//analyzer.ClassElement classElement = engineElement.enclosingElement3;
//expect(classElement.isDeprecated, isTrue);
expect(

View file

@ -295,13 +295,13 @@ abstract class DartCompletionContributorTest extends AbstractContextTest {
expect(element.kind, equals(ElementKind.FUNCTION_TYPE_ALIAS));
expect(element.name, equals(name));
expect(element.isDeprecated, equals(isDeprecated));
// TODO (danrubel) Determine why params are null
// TODO(danrubel): Determine why params are null
// String param = element.parameters;
// expect(param, isNotNull);
// expect(param[0], equals('('));
// expect(param[param.length - 1], equals(')'));
expect(element.returnType, equals(returnType ?? 'dynamic'));
// TODO (danrubel) Determine why param info is missing
// TODO(danrubel): Determine why param info is missing
// assertHasParameterInfo(cs);
return cs;
}
@ -375,9 +375,9 @@ abstract class DartCompletionContributorTest extends AbstractContextTest {
expect(element, isNotNull);
expect(element.kind, equals(ElementKind.SETTER));
expect(element.name, equals(name));
// TODO (danrubel) assert setter param
// TODO(danrubel): assert setter param
//expect(element.parameters, isNull);
// TODO (danrubel) it would be better if this was always null
// TODO(danrubel): it would be better if this was always null
if (element.returnType != null) {
expect(element.returnType, 'dynamic');
}

View file

@ -389,7 +389,7 @@ void main() {new A().f^}''');
expect(replacementLength, 0);
assertNotSuggested('A');
assertNotSuggested('int');
// TODO (danrubel) When entering 1st of 2 identifiers on assignment LHS
// TODO(danrubel): When entering 1st of 2 identifiers on assignment LHS
// the user may be either (1) entering a type for the assignment
// or (2) starting a new statement.
// Consider suggesting only types
@ -432,7 +432,7 @@ void main() {new A().f^}''');
expect(replacementLength, 3);
assertNotSuggested('A');
assertNotSuggested('int');
// TODO (danrubel) When entering 1st of 2 identifiers on assignment LHS
// TODO(danrubel): When entering 1st of 2 identifiers on assignment LHS
// the user may be either (1) entering a type for the assignment
// or (2) starting a new statement.
// Consider suggesting only types
@ -587,7 +587,7 @@ void main() {new A().f^}''');
assertNotSuggested('T8');
assertNotSuggested('clog');
assertNotSuggested('blog');
// TODO (danrubel) suggest HtmlElement as low relevance
// TODO(danrubel): suggest HtmlElement as low relevance
assertNotSuggested('HtmlElement');
assertNotSuggested('Uri');
assertNotSuggested('parseIPv6Address');
@ -685,7 +685,7 @@ void main() {new A().f^}''');
assertNotSuggested('T8');
assertNotSuggested('clog');
assertNotSuggested('blog');
// TODO (danrubel) suggest HtmlElement as low relevance
// TODO(danrubel): suggest HtmlElement as low relevance
assertNotSuggested('HtmlElement');
assertNotSuggested('Uri');
assertNotSuggested('parseIPv6Address');
@ -797,7 +797,7 @@ void main() {new A().f^}''');
assertNotSuggested('T8');
assertNotSuggested('clog');
assertNotSuggested('blog');
// TODO (danrubel) suggest HtmlElement as low relevance
// TODO(danrubel): suggest HtmlElement as low relevance
assertNotSuggested('HtmlElement');
assertNotSuggested('Uri');
assertNotSuggested('parseIPv6Address');
@ -895,7 +895,7 @@ void main() {new A().f^}''');
assertNotSuggested('T8');
assertNotSuggested('clog');
assertNotSuggested('blog');
// TODO (danrubel) suggest HtmlElement as low relevance
// TODO(danrubel): suggest HtmlElement as low relevance
assertNotSuggested('HtmlElement');
assertNotSuggested('Uri');
assertNotSuggested('parseIPv6Address');
@ -976,7 +976,7 @@ void main() {new A().f^}''');
//assertNotSuggested('T5');
//assertNotSuggested('_T6');
assertNotSuggested('==');
// TODO (danrubel) suggest HtmlElement as low relevance
// TODO(danrubel): suggest HtmlElement as low relevance
assertNotSuggested('HtmlElement');
}
@ -995,7 +995,7 @@ void main() {new A().f^}''');
expect(replacementOffset, completionOffset);
expect(replacementLength, 0);
// TODO (danrubel) prefer fields over getters
// TODO(danrubel): prefer fields over getters
// If add `get e1;` to interface I
// then suggestions include getter e1 rather than field e1
assertNotSuggested('e1');
@ -1092,7 +1092,7 @@ void main() {new A().f^}''');
expect(replacementOffset, completionOffset! - 1);
expect(replacementLength, 1);
assertNotSuggested('Foo');
// TODO(danrubel) implement
// TODO(danrubel): implement
assertNotSuggested('Foo2');
assertNotSuggested('Future');
}
@ -1433,7 +1433,7 @@ void main() {new A().f^}''');
await computeSuggestions();
// top level results are partially filtered based on first char
assertNotSuggested('T2');
// TODO (danrubel) getter is being suggested instead of top level var
// TODO(danrubel): getter is being suggested instead of top level var
//assertSuggestImportedTopLevelVar('T1', 'int');
}
@ -1458,7 +1458,7 @@ void main() {new A().f^}''');
assertNotSuggested('T2');
assertNotSuggested('A');
assertNotSuggested('F1');
// TODO (danrubel) getter is being suggested instead of top level var
// TODO(danrubel): getter is being suggested instead of top level var
//assertSuggestImportedTopLevelVar('T1', 'int');
}
@ -1477,7 +1477,7 @@ void main() {new A().f^}''');
await computeSuggestions();
// top level results are partially filtered based on first char
assertNotSuggested('T2');
// TODO (danrubel) getter is being suggested instead of top level var
// TODO(danrubel): getter is being suggested instead of top level var
//assertSuggestImportedTopLevelVar('T1', 'int');
}
@ -1502,7 +1502,7 @@ void main() {new A().f^}''');
assertNotSuggested('T2');
assertNotSuggested('A');
assertNotSuggested('F1');
// TODO (danrubel) getter is being suggested instead of top level var
// TODO(danrubel): getter is being suggested instead of top level var
//assertSuggestImportedTopLevelVar('T1', 'int');
}
@ -1521,7 +1521,7 @@ void main() {new A().f^}''');
await computeSuggestions();
// top level results are partially filtered based on first char
assertNotSuggested('T2');
// TODO (danrubel) getter is being suggested instead of top level var
// TODO(danrubel): getter is being suggested instead of top level var
//assertSuggestImportedTopLevelVar('T1', 'int');
}
@ -1680,7 +1680,7 @@ void main() {new A().f^}''');
assertNotSuggested('values');
}
/// TODO(scheglov) move this test into contributor independent suite
// TODO(scheglov): move this test into contributor independent suite
@FailingTest(reason: 'No index, not local anymore')
Future<void> test_enumConst_index() async {
addTestSource('enum E { one, two } main() {E.one.^}');
@ -1692,7 +1692,7 @@ void main() {new A().f^}''');
assertNotSuggested('values');
}
/// TODO(scheglov) move this test into contributor independent suite
// TODO(scheglov): move this test into contributor independent suite
@FailingTest(reason: 'No index, not local anymore')
Future<void> test_enumConst_index2() async {
addTestSource('enum E { one, two } main() {E.one.i^}');
@ -1704,7 +1704,7 @@ void main() {new A().f^}''');
assertNotSuggested('values');
}
/// TODO(scheglov) move this test into contributor independent suite
// TODO(scheglov): move this test into contributor independent suite
@FailingTest(reason: 'No index, not local anymore')
Future<void> test_enumConst_index3() async {
addTestSource('enum E { one, two } main() {E.one.^ int g;}');
@ -2174,7 +2174,7 @@ g(F.^
assertNotSuggested('T2');
assertNotSuggested('A');
assertNotSuggested('F1');
// TODO (danrubel) getter is being suggested instead of top level var
// TODO(danrubel): getter is being suggested instead of top level var
//assertSuggestImportedTopLevelVar('T1', 'int');
}
@ -2193,7 +2193,7 @@ g(F.^
await computeSuggestions();
// top level results are partially filtered based on first char
assertNotSuggested('T2');
// TODO (danrubel) getter is being suggested instead of top level var
// TODO(danrubel): getter is being suggested instead of top level var
//assertSuggestImportedTopLevelVar('T1', 'int');
}
@ -2256,7 +2256,7 @@ g(F.^
expect(replacementOffset, completionOffset);
expect(replacementLength, 0);
assertNotSuggested('Object');
// TODO(danrubel) should return top level var rather than getter
// TODO(danrubel): should return top level var rather than getter
assertNotSuggested('F1');
assertNotSuggested('D1');
assertNotSuggested('C1');

View file

@ -98,6 +98,8 @@ class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator {
writeln();
writeln("import 'integration_tests.dart';");
writeln();
writeln('// ignore_for_file: flutter_style_todos');
writeln();
var impliedTypes = computeImpliedTypes(api).values.toList();
impliedTypes.sort((ImpliedType first, ImpliedType second) =>
first.camelName.compareTo(second.camelName));

View file

@ -52,6 +52,8 @@ class CodegenCommonVisitor extends CodegenProtocolVisitor {
writeln(
"import 'package:$packageName/src/protocol/protocol_internal.dart';");
}
writeln();
writeln('// ignore_for_file: flutter_style_todos');
}
@override

View file

@ -303,7 +303,7 @@ class ToHtmlVisitor extends HierarchicalApiVisitor
link('refactorings', () => write('\u2191'));
write(')');
});
// TODO: Individual refactorings are not yet hyperlinked.
// TODO(brianwilkerson): Individual refactorings are not yet hyperlinked.
element('div', {'class': 'subindex'}, () {
element('ul', {}, () {
for (var refactoring in refactorings) {

View file

@ -13,6 +13,7 @@ linter:
- collection_methods_unrelated_type
- dangling_library_doc_comments
- depend_on_referenced_packages
- flutter_style_todos
- implicit_call_tearoffs
- library_annotations
- prefer_single_quotes

View file

@ -1 +1,5 @@
include: package:lints/recommended.yaml
linter:
rules:
- flutter_style_todos

View file

@ -533,7 +533,7 @@ class _Protected {
}
@Target({
// todo(pq): restrict to instance members only
// TODO(pq): restrict to instance members only
TargetKind.getter,
TargetKind.setter,
TargetKind.method,