analyzer: Prefer string interpolations

ignore prefer_interpolation_to_compose_strings and
constant_identifier_names in generated files.

Change-Id: I963504e298f8e439734522fed9ac09911750f419
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243646
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Sam Rawlins 2022-05-04 20:45:25 +00:00 committed by Commit Bot
parent 6af134d78b
commit 531e6e175f
16 changed files with 45 additions and 5 deletions

View file

@ -22,8 +22,6 @@ analyzer:
non_constant_identifier_names: ignore
overridden_fields: ignore
prefer_function_declarations_over_variables: ignore
# todo: add ignore to `protocol_generated.dart`
prefer_interpolation_to_compose_strings: ignore
prefer_void_to_null: ignore
provide_deprecation_message: ignore

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
const String PROTOCOL_VERSION = '1.33.0';
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
import 'dart:convert' hide JsonDecoder;
import 'package:analysis_server/protocol/protocol.dart';

View file

@ -2374,9 +2374,9 @@ extension MyClassExtension on MyClass {
// Wait for analysis then edit the content
await waitForTasksFinished();
var revisedContent = testFileContent.substring(0, 0) +
'i' +
testFileContent.substring(completionOffset);
var precedingContent = testFileContent.substring(0, 0);
var trailingContent = testFileContent.substring(completionOffset);
var revisedContent = '${precedingContent}i$trailingContent';
++completionOffset;
server.handleRequest(AnalysisUpdateContentParams(
{testFile.path: AddContentOverlay(revisedContent)}).toRequest('add1'));

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
/// Convenience methods for running integration tests.
import 'dart:async';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
/// Matchers for data types defined in the analysis server API.
import 'package:test/test.dart';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
import 'package:analysis_server_client/protocol.dart';
/// [NotificationHandler] processes analysis server notifications

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
import 'dart:convert' hide JsonDecoder;
import 'package:analysis_server_client/src/protocol/protocol_base.dart';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
const String PROTOCOL_VERSION = '1.33.0';
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
import 'dart:convert' hide JsonDecoder;
import 'package:analysis_server_client/src/protocol/protocol_base.dart';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
import 'dart:convert' hide JsonDecoder;
import 'package:analyzer_plugin/protocol/protocol.dart';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
const String ANALYSIS_NOTIFICATION_ERRORS = 'analysis.errors';
const String ANALYSIS_NOTIFICATION_ERRORS_ERRORS = 'errors';
const String ANALYSIS_NOTIFICATION_ERRORS_FILE = 'file';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
import 'dart:convert' hide JsonDecoder;
import 'package:analyzer_plugin/protocol/protocol.dart';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
/// Convenience methods for running integration tests.
import 'dart:async';

View file

@ -6,6 +6,9 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
/// Matchers for data types defined in the analysis server API.
import 'package:test/test.dart';

View file

@ -168,6 +168,9 @@ class 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".
// ignore_for_file: constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
''';
}
writeln(header.trim());