Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit fdd2d7d

Browse files
authored
Sync analysis_options.yaml & cleanups (#117327)
1 parent 81bc54b commit fdd2d7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+88
-151
lines changed

analysis_options.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ linter:
8888
# - cascade_invocations # doesn't match the typical style of this repo
8989
- cast_nullable_to_non_nullable
9090
# - close_sinks # not reliable enough
91+
- collection_methods_unrelated_type
9192
- combinators_ordering
9293
# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142
9394
- conditional_uri_does_not_exist
9495
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
9596
- control_flow_in_finally
9697
- curly_braces_in_flow_control_structures
98+
# - dangling_library_doc_comments # not yet tested
9799
- depend_on_referenced_packages
98100
- deprecated_consistency
99101
# - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib)
@@ -103,15 +105,18 @@ linter:
103105
- empty_catches
104106
- empty_constructor_bodies
105107
- empty_statements
108+
- enable_null_safety
106109
- eol_at_end_of_file
107110
- exhaustive_cases
108111
- file_names
109112
- flutter_style_todos
110113
- hash_and_equals
111114
- implementation_imports
115+
- implicit_call_tearoffs
112116
- iterable_contains_unrelated_type
113117
# - join_return_with_assignment # not required by flutter style
114118
- leading_newlines_in_multiline_strings
119+
# - library_annotations # not yet tested
115120
- library_names
116121
- library_prefixes
117122
- library_private_types_in_public_api
@@ -204,6 +209,7 @@ linter:
204209
- unnecessary_getters_setters
205210
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
206211
- unnecessary_late
212+
- unnecessary_library_directive
207213
- unnecessary_new
208214
- unnecessary_null_aware_assignments
209215
- unnecessary_null_aware_operator_on_extension_on_nullable
@@ -218,6 +224,7 @@ linter:
218224
- unnecessary_string_interpolations
219225
- unnecessary_this
220226
- unnecessary_to_list_in_spreads
227+
- unreachable_from_main
221228
- unrelated_type_equality_checks
222229
- unsafe_html
223230
- use_build_context_synchronously
@@ -235,6 +242,7 @@ linter:
235242
- use_rethrow_when_possible
236243
- use_setters_to_change_properties
237244
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
245+
- use_string_in_part_of_directives
238246
- use_super_parameters
239247
- use_test_throws_matchers
240248
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review

dev/benchmarks/test_apps/stocks/lib/main.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
library stocks;
6-
75
import 'package:flutter/material.dart';
86
import 'package:flutter/rendering.dart' show
97
debugPaintBaselinesEnabled,

dev/bots/analyze_snippet_code.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ class _SnippetChecker {
457457
'// ignore_for_file: directives_ordering',
458458
'// ignore_for_file: prefer_final_locals',
459459
'// ignore_for_file: unnecessary_import',
460+
'// ignore_for_file: unreachable_from_main',
460461
'// ignore_for_file: unused_element',
461462
'// ignore_for_file: unused_local_variable',
462463
];

dev/bots/post_process_docs.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import 'package:platform/platform.dart' as platform;
1212

1313
import 'package:process/process.dart';
1414

15-
const String kDocsRoot = 'dev/docs';
16-
const String kPublishRoot = '$kDocsRoot/doc';
17-
1815
class CommandException implements Exception {}
1916

2017
Future<void> main() async {

dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
// @dart = 2.12
66

7-
// This is a dummy dart:ui package for the sample code analyzer tests to use.
8-
7+
/// This is a dummy dart:ui package for the sample code analyzer tests to use.
98
library dart.ui;
109

1110
/// Bla bla bla bla bla bla bla bla bla.

dev/bots/test/analyze_snippet_code_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ const List<String> expectedMainErrors = <String>[
3333
];
3434

3535
const List<String> expectedUiErrors = <String>[
36-
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:15:7: (top-level declaration) (prefer_typing_uninitialized_variables)',
37-
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:15:7: (top-level declaration) (missing_const_final_var_or_type)',
38-
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:17:20: (top-level declaration) (prefer_final_fields)',
39-
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:17:20: (top-level declaration) (unused_field)',
36+
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:14:7: (top-level declaration) (prefer_typing_uninitialized_variables)',
37+
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:14:7: (top-level declaration) (missing_const_final_var_or_type)',
38+
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:16:20: (top-level declaration) (prefer_final_fields)',
39+
'dev/bots/test/analyze-snippet-code-test-dart-ui/ui.dart:16:20: (top-level declaration) (unused_field)',
4040
];
4141

4242
final RegExp errorPrefixRE = RegExp(r'^([-a-z0-9/_.:]+): .*(\([-a-z_ ]+\) \([-a-z_ ]+\))$');

dev/devicelab/bin/tasks/plugin_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ import 'package:flutter_devicelab/tasks/plugin_tests.dart';
77

88
Future<void> main() async {
99
await task(combine(<TaskFunction>[
10-
PluginTest('apk', <String>['-a', 'java', '--platforms=android']),
11-
PluginTest('apk', <String>['-a', 'kotlin', '--platforms=android']),
10+
PluginTest('apk', <String>['-a', 'java', '--platforms=android']).call,
11+
PluginTest('apk', <String>['-a', 'kotlin', '--platforms=android']).call,
1212
// These create the plugins using the new v2 plugin templates but create the
1313
// apps using the old v1 embedding app templates to make sure new plugins
1414
// are by default backward compatible.
1515
PluginTest('apk', <String>['-a', 'java', '--platforms=android'], pluginCreateEnvironment:
16-
<String, String>{'ENABLE_ANDROID_EMBEDDING_V2': 'true'}),
16+
<String, String>{'ENABLE_ANDROID_EMBEDDING_V2': 'true'}).call,
1717
PluginTest('apk', <String>['-a', 'kotlin', '--platforms=android'], pluginCreateEnvironment:
18-
<String, String>{'ENABLE_ANDROID_EMBEDDING_V2': 'true'}),
18+
<String, String>{'ENABLE_ANDROID_EMBEDDING_V2': 'true'}).call,
1919
// Test that Dart-only plugins are supported.
20-
PluginTest('apk', <String>['--platforms=android'], dartOnlyPlugin: true),
20+
PluginTest('apk', <String>['--platforms=android'], dartOnlyPlugin: true).call,
2121
// Test that FFI plugins are supported.
22-
PluginTest('apk', <String>['--platforms=android'], template: 'plugin_ffi'),
22+
PluginTest('apk', <String>['--platforms=android'], template: 'plugin_ffi').call,
2323
]));
2424
}

dev/devicelab/bin/tasks/plugin_test_ios.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import 'package:flutter_devicelab/tasks/plugin_tests.dart';
77

88
Future<void> main() async {
99
await task(combine(<TaskFunction>[
10-
PluginTest('ios', <String>['-i', 'objc', '--platforms=ios']),
11-
PluginTest('ios', <String>['-i', 'swift', '--platforms=ios']),
12-
PluginTest('macos', <String>['--platforms=macos']),
10+
PluginTest('ios', <String>['-i', 'objc', '--platforms=ios']).call,
11+
PluginTest('ios', <String>['-i', 'swift', '--platforms=ios']).call,
12+
PluginTest('macos', <String>['--platforms=macos']).call,
1313
// Test that Dart-only plugins are supported.
14-
PluginTest('ios', <String>['--platforms=ios'], dartOnlyPlugin: true),
15-
PluginTest('macos', <String>['--platforms=macos'], dartOnlyPlugin: true),
14+
PluginTest('ios', <String>['--platforms=ios'], dartOnlyPlugin: true).call,
15+
PluginTest('macos', <String>['--platforms=macos'], dartOnlyPlugin: true).call,
1616
// Test that FFI plugins are supported.
17-
PluginTest('ios', <String>['--platforms=ios'], template: 'plugin_ffi'),
18-
PluginTest('macos', <String>['--platforms=macos'], template: 'plugin_ffi'),
17+
PluginTest('ios', <String>['--platforms=ios'], template: 'plugin_ffi').call,
18+
PluginTest('macos', <String>['--platforms=macos'], template: 'plugin_ffi').call,
1919
]));
2020
}

dev/devicelab/bin/tasks/smoke_test_build_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:flutter_devicelab/tasks/build_test_task.dart';
1010
/// Smoke test of a successful task.
1111
Future<void> main(List<String> args) async {
1212
deviceOperatingSystem = DeviceOperatingSystem.fake;
13-
await task(FakeBuildTestTask(args));
13+
await task(FakeBuildTestTask(args).call);
1414
}
1515

1616
class FakeBuildTestTask extends BuildTestTask {

dev/devicelab/lib/tasks/gallery.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ final Directory galleryDirectory = dir('${flutterDirectory.path}/dev/integration
1818
///
1919
/// https://github.com/flutter/flutter/issues/103542
2020
TaskFunction createGalleryTransitionBuildTest(List<String> args, {bool semanticsEnabled = false}) {
21-
return GalleryTransitionBuildTest(args, semanticsEnabled: semanticsEnabled);
21+
return GalleryTransitionBuildTest(args, semanticsEnabled: semanticsEnabled).call;
2222
}
2323

2424
TaskFunction createGalleryTransitionTest({bool semanticsEnabled = false}) {
25-
return GalleryTransitionTest(semanticsEnabled: semanticsEnabled);
25+
return GalleryTransitionTest(semanticsEnabled: semanticsEnabled).call;
2626
}
2727

2828
TaskFunction createGalleryTransitionE2EBuildTest(
@@ -39,7 +39,7 @@ TaskFunction createGalleryTransitionE2EBuildTest(
3939
timelineTraceFile: null,
4040
driverFile: 'transitions_perf_e2e_test',
4141
enableImpeller: enableImpeller,
42-
);
42+
).call;
4343
}
4444

4545
TaskFunction createGalleryTransitionE2ETest({
@@ -56,7 +56,7 @@ TaskFunction createGalleryTransitionE2ETest({
5656
timelineTraceFile: null,
5757
driverFile: 'transitions_perf_e2e_test',
5858
enableImpeller: enableImpeller,
59-
);
59+
).call;
6060
}
6161

6262
TaskFunction createGalleryTransitionHybridBuildTest(
@@ -67,7 +67,7 @@ TaskFunction createGalleryTransitionHybridBuildTest(
6767
args,
6868
semanticsEnabled: semanticsEnabled,
6969
driverFile: semanticsEnabled ? 'transitions_perf_hybrid_with_semantics_test' : 'transitions_perf_hybrid_test',
70-
);
70+
).call;
7171
}
7272

7373
TaskFunction createGalleryTransitionHybridTest({bool semanticsEnabled = false}) {
@@ -76,7 +76,7 @@ TaskFunction createGalleryTransitionHybridTest({bool semanticsEnabled = false})
7676
driverFile: semanticsEnabled
7777
? 'transitions_perf_hybrid_with_semantics_test'
7878
: 'transitions_perf_hybrid_test',
79-
);
79+
).call;
8080
}
8181

8282
class GalleryTransitionTest {

0 commit comments

Comments
 (0)