Sync analysis_options.yaml & cleanups (#117327)
This commit is contained in:
committed by
GitHub
parent
81bc54be75
commit
fdd2d7d64a
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
library stocks;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart' show
|
||||
debugPaintBaselinesEnabled,
|
||||
|
||||
@@ -457,6 +457,7 @@ class _SnippetChecker {
|
||||
'// ignore_for_file: directives_ordering',
|
||||
'// ignore_for_file: prefer_final_locals',
|
||||
'// ignore_for_file: unnecessary_import',
|
||||
'// ignore_for_file: unreachable_from_main',
|
||||
'// ignore_for_file: unused_element',
|
||||
'// ignore_for_file: unused_local_variable',
|
||||
];
|
||||
|
||||
@@ -12,9 +12,6 @@ import 'package:platform/platform.dart' as platform;
|
||||
|
||||
import 'package:process/process.dart';
|
||||
|
||||
const String kDocsRoot = 'dev/docs';
|
||||
const String kPublishRoot = '$kDocsRoot/doc';
|
||||
|
||||
class CommandException implements Exception {}
|
||||
|
||||
Future<void> main() async {
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
// @dart = 2.12
|
||||
|
||||
// This is a dummy dart:ui package for the sample code analyzer tests to use.
|
||||
|
||||
/// This is a dummy dart:ui package for the sample code analyzer tests to use.
|
||||
library dart.ui;
|
||||
|
||||
/// Bla bla bla bla bla bla bla bla bla.
|
||||
|
||||
@@ -33,10 +33,10 @@ const List<String> expectedMainErrors = <String>[
|
||||
];
|
||||
|
||||
const List<String> expectedUiErrors = <String>[
|
||||
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:15:7: (top-level declaration) (prefer_typing_uninitialized_variables)',
|
||||
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:15:7: (top-level declaration) (missing_const_final_var_or_type)',
|
||||
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:17:20: (top-level declaration) (prefer_final_fields)',
|
||||
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:17:20: (top-level declaration) (unused_field)',
|
||||
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:14:7: (top-level declaration) (prefer_typing_uninitialized_variables)',
|
||||
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:14:7: (top-level declaration) (missing_const_final_var_or_type)',
|
||||
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:16:20: (top-level declaration) (prefer_final_fields)',
|
||||
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:16:20: (top-level declaration) (unused_field)',
|
||||
];
|
||||
|
||||
final RegExp errorPrefixRE = RegExp(r'^([-a-z0-9/_.:]+): .*(\([-a-z_ ]+\) \([-a-z_ ]+\))$');
|
||||
|
||||
@@ -7,18 +7,18 @@ import 'package:flutter_devicelab/tasks/plugin_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
await task(combine(<TaskFunction>[
|
||||
PluginTest('apk', <String>['-a', 'java', '--platforms=android']),
|
||||
PluginTest('apk', <String>['-a', 'kotlin', '--platforms=android']),
|
||||
PluginTest('apk', <String>['-a', 'java', '--platforms=android']).call,
|
||||
PluginTest('apk', <String>['-a', 'kotlin', '--platforms=android']).call,
|
||||
// These create the plugins using the new v2 plugin templates but create the
|
||||
// apps using the old v1 embedding app templates to make sure new plugins
|
||||
// are by default backward compatible.
|
||||
PluginTest('apk', <String>['-a', 'java', '--platforms=android'], pluginCreateEnvironment:
|
||||
<String, String>{'ENABLE_ANDROID_EMBEDDING_V2': 'true'}),
|
||||
<String, String>{'ENABLE_ANDROID_EMBEDDING_V2': 'true'}).call,
|
||||
PluginTest('apk', <String>['-a', 'kotlin', '--platforms=android'], pluginCreateEnvironment:
|
||||
<String, String>{'ENABLE_ANDROID_EMBEDDING_V2': 'true'}),
|
||||
<String, String>{'ENABLE_ANDROID_EMBEDDING_V2': 'true'}).call,
|
||||
// Test that Dart-only plugins are supported.
|
||||
PluginTest('apk', <String>['--platforms=android'], dartOnlyPlugin: true),
|
||||
PluginTest('apk', <String>['--platforms=android'], dartOnlyPlugin: true).call,
|
||||
// Test that FFI plugins are supported.
|
||||
PluginTest('apk', <String>['--platforms=android'], template: 'plugin_ffi'),
|
||||
PluginTest('apk', <String>['--platforms=android'], template: 'plugin_ffi').call,
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ import 'package:flutter_devicelab/tasks/plugin_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
await task(combine(<TaskFunction>[
|
||||
PluginTest('ios', <String>['-i', 'objc', '--platforms=ios']),
|
||||
PluginTest('ios', <String>['-i', 'swift', '--platforms=ios']),
|
||||
PluginTest('macos', <String>['--platforms=macos']),
|
||||
PluginTest('ios', <String>['-i', 'objc', '--platforms=ios']).call,
|
||||
PluginTest('ios', <String>['-i', 'swift', '--platforms=ios']).call,
|
||||
PluginTest('macos', <String>['--platforms=macos']).call,
|
||||
// Test that Dart-only plugins are supported.
|
||||
PluginTest('ios', <String>['--platforms=ios'], dartOnlyPlugin: true),
|
||||
PluginTest('macos', <String>['--platforms=macos'], dartOnlyPlugin: true),
|
||||
PluginTest('ios', <String>['--platforms=ios'], dartOnlyPlugin: true).call,
|
||||
PluginTest('macos', <String>['--platforms=macos'], dartOnlyPlugin: true).call,
|
||||
// Test that FFI plugins are supported.
|
||||
PluginTest('ios', <String>['--platforms=ios'], template: 'plugin_ffi'),
|
||||
PluginTest('macos', <String>['--platforms=macos'], template: 'plugin_ffi'),
|
||||
PluginTest('ios', <String>['--platforms=ios'], template: 'plugin_ffi').call,
|
||||
PluginTest('macos', <String>['--platforms=macos'], template: 'plugin_ffi').call,
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:flutter_devicelab/tasks/build_test_task.dart';
|
||||
/// Smoke test of a successful task.
|
||||
Future<void> main(List<String> args) async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.fake;
|
||||
await task(FakeBuildTestTask(args));
|
||||
await task(FakeBuildTestTask(args).call);
|
||||
}
|
||||
|
||||
class FakeBuildTestTask extends BuildTestTask {
|
||||
|
||||
@@ -18,11 +18,11 @@ final Directory galleryDirectory = dir('${flutterDirectory.path}/dev/integration
|
||||
///
|
||||
/// https://github.com/flutter/flutter/issues/103542
|
||||
TaskFunction createGalleryTransitionBuildTest(List<String> args, {bool semanticsEnabled = false}) {
|
||||
return GalleryTransitionBuildTest(args, semanticsEnabled: semanticsEnabled);
|
||||
return GalleryTransitionBuildTest(args, semanticsEnabled: semanticsEnabled).call;
|
||||
}
|
||||
|
||||
TaskFunction createGalleryTransitionTest({bool semanticsEnabled = false}) {
|
||||
return GalleryTransitionTest(semanticsEnabled: semanticsEnabled);
|
||||
return GalleryTransitionTest(semanticsEnabled: semanticsEnabled).call;
|
||||
}
|
||||
|
||||
TaskFunction createGalleryTransitionE2EBuildTest(
|
||||
@@ -39,7 +39,7 @@ TaskFunction createGalleryTransitionE2EBuildTest(
|
||||
timelineTraceFile: null,
|
||||
driverFile: 'transitions_perf_e2e_test',
|
||||
enableImpeller: enableImpeller,
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createGalleryTransitionE2ETest({
|
||||
@@ -56,7 +56,7 @@ TaskFunction createGalleryTransitionE2ETest({
|
||||
timelineTraceFile: null,
|
||||
driverFile: 'transitions_perf_e2e_test',
|
||||
enableImpeller: enableImpeller,
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createGalleryTransitionHybridBuildTest(
|
||||
@@ -67,7 +67,7 @@ TaskFunction createGalleryTransitionHybridBuildTest(
|
||||
args,
|
||||
semanticsEnabled: semanticsEnabled,
|
||||
driverFile: semanticsEnabled ? 'transitions_perf_hybrid_with_semantics_test' : 'transitions_perf_hybrid_test',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createGalleryTransitionHybridTest({bool semanticsEnabled = false}) {
|
||||
@@ -76,7 +76,7 @@ TaskFunction createGalleryTransitionHybridTest({bool semanticsEnabled = false})
|
||||
driverFile: semanticsEnabled
|
||||
? 'transitions_perf_hybrid_with_semantics_test'
|
||||
: 'transitions_perf_hybrid_test',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
class GalleryTransitionTest {
|
||||
|
||||
@@ -11,14 +11,14 @@ TaskFunction createChannelsIntegrationTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/channels',
|
||||
'lib/main.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createPlatformInteractionTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/platform_interaction',
|
||||
'lib/main.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createFlavorsTest() {
|
||||
@@ -26,7 +26,7 @@ TaskFunction createFlavorsTest() {
|
||||
'${flutterDirectory.path}/dev/integration_tests/flavors',
|
||||
'lib/main.dart',
|
||||
extraOptions: <String>['--flavor', 'paid'],
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createIntegrationTestFlavorsTest() {
|
||||
@@ -34,14 +34,14 @@ TaskFunction createIntegrationTestFlavorsTest() {
|
||||
'${flutterDirectory.path}/dev/integration_tests/flavors',
|
||||
'integration_test/integration_test.dart',
|
||||
extraOptions: <String>['--flavor', 'paid'],
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createExternalUiIntegrationTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/external_ui',
|
||||
'lib/main.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createPlatformChannelSampleTest({String? deviceIdOverride}) {
|
||||
@@ -49,35 +49,35 @@ TaskFunction createPlatformChannelSampleTest({String? deviceIdOverride}) {
|
||||
'${flutterDirectory.path}/examples/platform_channel',
|
||||
'test_driver/button_tap.dart',
|
||||
deviceIdOverride: deviceIdOverride,
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createPlatformChannelSwiftSampleTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/examples/platform_channel_swift',
|
||||
'test_driver/button_tap.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createEmbeddedAndroidViewsIntegrationTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/android_views',
|
||||
'lib/main.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createHybridAndroidViewsIntegrationTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/hybrid_android_views',
|
||||
'lib/main.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createAndroidSemanticsIntegrationTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/android_semantics_testing',
|
||||
'lib/main.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createIOSPlatformViewTests() {
|
||||
@@ -87,42 +87,42 @@ TaskFunction createIOSPlatformViewTests() {
|
||||
extraOptions: <String>[
|
||||
'--dart-define=ENABLE_DRIVER_EXTENSION=true',
|
||||
],
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createEndToEndKeyboardTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/keyboard_resize.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createEndToEndFrameNumberTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/frame_number.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createEndToEndDriverTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/driver.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createEndToEndScreenshotTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/screenshot.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createEndToEndKeyboardTextfieldTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/keyboard_textfield.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction dartDefinesTask() {
|
||||
@@ -132,21 +132,21 @@ TaskFunction dartDefinesTask() {
|
||||
'--dart-define=test.valueA=Example,A',
|
||||
'--dart-define=test.valueB=Value',
|
||||
],
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createEndToEndIntegrationTest() {
|
||||
return IntegrationTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'integration_test/integration_test.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createSpellCheckIntegrationTest() {
|
||||
return IntegrationTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/spell_check',
|
||||
'integration_test/integration_test.dart',
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createWindowsStartupDriverTest({String? deviceIdOverride}) {
|
||||
@@ -154,7 +154,7 @@ TaskFunction createWindowsStartupDriverTest({String? deviceIdOverride}) {
|
||||
'${flutterDirectory.path}/dev/integration_tests/windows_startup_test',
|
||||
'lib/main.dart',
|
||||
deviceIdOverride: deviceIdOverride,
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
class DriverTest {
|
||||
|
||||
@@ -12,11 +12,11 @@ import '../framework/task_result.dart';
|
||||
import '../framework/utils.dart';
|
||||
|
||||
TaskFunction createAndroidRunDebugTest() {
|
||||
return AndroidRunOutputTest(release: false);
|
||||
return AndroidRunOutputTest(release: false).call;
|
||||
}
|
||||
|
||||
TaskFunction createAndroidRunReleaseTest() {
|
||||
return AndroidRunOutputTest(release: true);
|
||||
return AndroidRunOutputTest(release: true).call;
|
||||
}
|
||||
|
||||
TaskFunction createMacOSRunDebugTest() {
|
||||
@@ -27,7 +27,7 @@ TaskFunction createMacOSRunDebugTest() {
|
||||
'lib/main.dart',
|
||||
release: false,
|
||||
allowStderr: true,
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createMacOSRunReleaseTest() {
|
||||
@@ -38,7 +38,7 @@ TaskFunction createMacOSRunReleaseTest() {
|
||||
'lib/main.dart',
|
||||
release: true,
|
||||
allowStderr: true,
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createWindowsRunDebugTest() {
|
||||
@@ -46,7 +46,7 @@ TaskFunction createWindowsRunDebugTest() {
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/empty.dart',
|
||||
release: false,
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
TaskFunction createWindowsRunReleaseTest() {
|
||||
@@ -54,7 +54,7 @@ TaskFunction createWindowsRunReleaseTest() {
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/empty.dart',
|
||||
release: true,
|
||||
);
|
||||
).call;
|
||||
}
|
||||
|
||||
class AndroidRunOutputTest extends RunOutputTask {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
library component1;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
String? unused;
|
||||
String? unused; // ignore: unreachable_from_main
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// ignore_for_file: enable_null_safety
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'null_enabled_api.dart';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// @dart = 2.12
|
||||
|
||||
String? x;
|
||||
String? x; // ignore: unreachable_from_main
|
||||
|
||||
void main() {
|
||||
print('--- TEST SUCCEEDED ---');
|
||||
|
||||
@@ -228,28 +228,6 @@ class OptionModel extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
class LabeledCheckbox extends StatelessWidget {
|
||||
const LabeledCheckbox({super.key, required this.label, this.onChanged, this.value});
|
||||
|
||||
final String label;
|
||||
final ValueChanged<bool?>? onChanged;
|
||||
final bool? value;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Checkbox(
|
||||
onChanged: onChanged,
|
||||
value: value,
|
||||
),
|
||||
Text(label),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Options extends StatefulWidget {
|
||||
const Options(this.model, {super.key});
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ void main(List<String> args) {
|
||||
}
|
||||
|
||||
if (argResults.wasParsed('part-of')) {
|
||||
generatedSb.write('part of ${argResults['part-of']};\n');
|
||||
generatedSb.write('part of ${argResults['part-of']}; // ignore: use_string_in_part_of_directives\n');
|
||||
}
|
||||
|
||||
final Animation animation = Animation.fromFrameData(frames);
|
||||
|
||||
Reference in New Issue
Block a user