[tool] Add initial file-based command skipping (#8928)

Adds initial file-based filtering. This does not attempt to be comprehensive, just to get some low-hanging fruit, and to create a blueprint for anyone to follow in the future when adding more filtering. I expect that once this is in place, what will happen is that as we notice cases where PRs are hitting slow or flaky tests that they clearly don't need to, we can incrementally improve the filtering on demand.

Fixes https://github.com/flutter/flutter/issues/136394
This commit is contained in:
stuartmorgan-g
2025-04-18 07:19:25 -07:00
committed by GitHub
parent 4988af58c1
commit fdc1ec7c1c
19 changed files with 792 additions and 28 deletions

View File

@ -9,6 +9,7 @@ import 'dart:io';
import 'package:file/file.dart';
import 'common/core.dart';
import 'common/file_filters.dart';
import 'common/output_utils.dart';
import 'common/package_looping_command.dart';
import 'common/plugin_utils.dart';
@ -68,6 +69,11 @@ class DriveExamplesCommand extends PackageLoopingCommand {
Map<String, List<String>> _targetDeviceFlags = const <String, List<String>>{};
@override
bool shouldIgnoreFile(String path) {
return isRepoLevelNonCodeImpactingFile(path) || isPackageSupportFile(path);
}
@override
Future<void> initializeRun() async {
final List<String> platformSwitches = <String>[