diff --git a/pkg/analysis_server/integration_test/support/integration_test_methods.dart b/pkg/analysis_server/integration_test/support/integration_test_methods.dart index d259ce807c9..8625e6a6ce3 100644 --- a/pkg/analysis_server/integration_test/support/integration_test_methods.dart +++ b/pkg/analysis_server/integration_test/support/integration_test_methods.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + /// Convenience methods for running integration tests. library; diff --git a/pkg/analysis_server/integration_test/support/protocol_matchers.dart b/pkg/analysis_server/integration_test/support/protocol_matchers.dart index dab48f1c57b..cb2ae499550 100644 --- a/pkg/analysis_server/integration_test/support/protocol_matchers.dart +++ b/pkg/analysis_server/integration_test/support/protocol_matchers.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + /// Matchers for data types defined in the analysis server API. library; diff --git a/pkg/analysis_server/lib/protocol/protocol_constants.dart b/pkg/analysis_server/lib/protocol/protocol_constants.dart index 0c0562b01c3..2bcf0efc431 100644 --- a/pkg/analysis_server/lib/protocol/protocol_constants.dart +++ b/pkg/analysis_server/lib/protocol/protocol_constants.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + // ignore: constant_identifier_names const String PROTOCOL_VERSION = '1.40.1'; diff --git a/pkg/analysis_server/lib/protocol/protocol_generated.dart b/pkg/analysis_server/lib/protocol/protocol_generated.dart index a621c6b82df..cba5f314cf2 100644 --- a/pkg/analysis_server/lib/protocol/protocol_generated.dart +++ b/pkg/analysis_server/lib/protocol/protocol_generated.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + import 'dart:convert' hide JsonDecoder; import 'package:analysis_server/protocol/protocol.dart'; diff --git a/pkg/analysis_server_client/lib/handler/notification_handler.dart b/pkg/analysis_server_client/lib/handler/notification_handler.dart index e9e3059fd9d..5b9c58255c1 100644 --- a/pkg/analysis_server_client/lib/handler/notification_handler.dart +++ b/pkg/analysis_server_client/lib/handler/notification_handler.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + import 'package:analysis_server_client/protocol.dart'; /// [NotificationHandler] processes analysis server notifications diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart index 94a35bf8fca..9659fbf15a4 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + import 'dart:convert' hide JsonDecoder; import 'package:collection/collection.dart' show QueueList; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart index 0c0562b01c3..2bcf0efc431 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + // ignore: constant_identifier_names const String PROTOCOL_VERSION = '1.40.1'; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart index 278872ba738..b7ff6718dd2 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + import 'dart:convert' hide JsonDecoder; import 'package:analysis_server_client/src/protocol/protocol_base.dart'; diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart index eb1d342d99d..90abd7eb996 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + import 'dart:convert' hide JsonDecoder; import 'package:collection/collection.dart' show QueueList; diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart b/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart index 8103dc3e4d5..765a32eb6f9 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + const String ANALYSIS_NOTIFICATION_ERRORS = 'analysis.errors'; const String ANALYSIS_NOTIFICATION_ERRORS_ERRORS = 'errors'; const String ANALYSIS_NOTIFICATION_ERRORS_FILE = 'file'; diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart b/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart index 624ec4887e2..21234d776ed 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + import 'dart:convert' hide JsonDecoder; import 'package:analyzer_plugin/protocol/protocol.dart'; diff --git a/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart b/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart index f0f9c20c532..853bf6ecd90 100644 --- a/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart +++ b/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + /// Convenience methods for running integration tests. library; diff --git a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart index 738a2286254..c093409a52b 100644 --- a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart +++ b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart @@ -6,6 +6,9 @@ // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor + /// Matchers for data types defined in the analysis server API. library; diff --git a/pkg/analyzer_utilities/lib/tools.dart b/pkg/analyzer_utilities/lib/tools.dart index 81cb13d903c..0391188eb1b 100644 --- a/pkg/analyzer_utilities/lib/tools.dart +++ b/pkg/analyzer_utilities/lib/tools.dart @@ -40,8 +40,9 @@ String capitalize(String string) { /// Type of functions used to compute the contents of a set of generated files. /// [pkgRoot] is the path to the SDK's `pkg` directory. -typedef DirectoryContentsComputer = - Map Function(String pkgRoot); +typedef DirectoryContentsComputer = Map Function( + String pkgRoot, +); /// Type of functions used to compute the contents of a generated file. /// [pkgRoot] is the path to the SDK's `pkg` directory. @@ -191,6 +192,22 @@ mixin CodeGenerator { // This file has been automatically generated. Please do not edit it manually. // To regenerate the file, use the script // "pkg/analysis_server/tool/spec/generate_files". +'''; + // During the transition period to Dart language version 3.13, some + // generated files will be using language version 3.13, and will have the + // `unnecessary_type_name_in_constructor` lint enabled in order to + // encourage use of the new constructor declaration syntax. Others will be + // using older language versions that don't support this syntax. To ease + // the transition, ignore the `unnecessary_type_name_in_constructor` lint + // in generated code. Also ignore the `unnecessary_ignore` and + // `duplicate_ignore` lints, which would otherwise sometimes be triggered + // by the ignores we're adding. + // TODO(paulberry): clean this up once all generated code is using Dart + // language version 3.13. + header += ''' + +// ignore_for_file: unnecessary_ignore, duplicate_ignore +// ignore_for_file: unnecessary_type_name_in_constructor '''; } writeln(header.trim());