Skip to content

Commit 98c79a9

Browse files
authored
[ci] Do not use empty exclude directories in analyze_command. (flutter#3748)
* Add CUSTOM_ANALYSIS_PLUGINS back with all the plugins that now have a custom analysis_options.yaml
1 parent 12ea8f2 commit 98c79a9

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

script/incremental_build.sh

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,39 @@ ALL_EXCLUDED=("")
1919
# because we adopted stricter analysis rules recently and needed to exclude
2020
# already failing packages to start linting the repo as a whole.
2121
#
22-
# TODO(mklim): Remove everything from this list. https://github.com/flutter/flutter/issues/45440
22+
# Finding all: `find packages -name analysis_options.yaml | sort | cut -d/ -f2`
23+
#
24+
# TODO(ecosystem): Remove everything from this list. https://github.com/flutter/flutter/issues/76229
2325
CUSTOM_ANALYSIS_PLUGINS=(
26+
android_alarm_manager
27+
android_intent
28+
battery
29+
camera
30+
connectivity
31+
cross_file
32+
device_info
33+
e2e
34+
espresso
35+
file_selector
36+
flutter_plugin_android_lifecycle
37+
google_maps_flutter
38+
google_sign_in
39+
image_picker
40+
in_app_purchase
41+
integration_test
42+
ios_platform_images
43+
local_auth
44+
package_info
45+
path_provider
46+
plugin_platform_interface
47+
quick_actions
48+
sensors
49+
share
50+
shared_preferences
51+
url_launcher
52+
video_player
53+
webview_flutter
54+
wifi_info_flutter
2455
)
2556

2657
# Comma-separated string of the list above

script/tool/lib/src/analyze_command.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ class AnalyzeCommand extends PluginCommand {
4242
continue;
4343
}
4444

45-
final bool whitelisted = argResults[_customAnalysisFlag].any(
45+
final bool allowed = argResults[_customAnalysisFlag].any(
4646
(String directory) =>
47+
directory != null &&
48+
directory.isNotEmpty &&
4749
p.isWithin(p.join(packagesDir.path, directory), file.path));
48-
if (whitelisted) {
50+
if (allowed) {
4951
continue;
5052
}
5153

script/tool/test/analyze_command_test.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,20 @@ void main() {
9393
pluginDir.path),
9494
]));
9595
});
96+
97+
// See: https://github.com/flutter/flutter/issues/78994
98+
test('takes an empty allow list', () async {
99+
await createFakePlugin('foo', withExtraFiles: <List<String>>[
100+
<String>['analysis_options.yaml']
101+
]);
102+
103+
final MockProcess mockProcess = MockProcess();
104+
mockProcess.exitCodeCompleter.complete(0);
105+
processRunner.processToReturn = mockProcess;
106+
107+
await expectLater(
108+
() => runner.run(<String>['analyze', '--custom-analysis', '']),
109+
throwsA(const TypeMatcher<ToolExit>()));
110+
});
96111
});
97112
}

0 commit comments

Comments
 (0)