[ci] Ensure repo tool is autoformatted (#7963)
Currently the autoformatter check is run per-package, so doesn't include script/tool. This adds a new CI step to check the formatting of the repo tooling, just as we have for running its unit tests.
diff --git a/.ci/scripts/plugin_tools_format.sh b/.ci/scripts/plugin_tools_format.sh
new file mode 100644
index 0000000..6effea0
--- /dev/null
+++ b/.ci/scripts/plugin_tools_format.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+# Copyright 2013 The Flutter Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+set -e
+
+cd script/tool
+dart format --set-exit-if-changed .
diff --git a/.ci/targets/repo_checks.yaml b/.ci/targets/repo_checks.yaml
index 6c643f5..be48143 100644
--- a/.ci/targets/repo_checks.yaml
+++ b/.ci/targets/repo_checks.yaml
@@ -4,6 +4,8 @@
infra_step: true # Note infra steps failing prevents "always" from running.
- name: tool unit tests
script: .ci/scripts/plugin_tools_tests.sh
+ - name: tool format
+ script: .ci/scripts/plugin_tools_format.sh
- name: format
script: .ci/scripts/tool_runner.sh
# Skip Swift formatting on Linux builders.
diff --git a/script/tool/lib/src/fetch_deps_command.dart b/script/tool/lib/src/fetch_deps_command.dart
index f9bdd1b..61a8248 100644
--- a/script/tool/lib/src/fetch_deps_command.dart
+++ b/script/tool/lib/src/fetch_deps_command.dart
@@ -87,10 +87,8 @@
flutterCommand,
<String>[
'precache',
- if (precacheIOS)
- '--ios',
- if (precacheMacOS)
- '--macos',
+ if (precacheIOS) '--ios',
+ if (precacheMacOS) '--macos',
],
);
if (precacheExitCode != 0) {
diff --git a/script/tool/test/build_examples_command_test.dart b/script/tool/test/build_examples_command_test.dart
index 53f1aeb..e2f78fc 100644
--- a/script/tool/test/build_examples_command_test.dart
+++ b/script/tool/test/build_examples_command_test.dart
@@ -485,7 +485,6 @@
);
});
-
test('building for macOS with Swift Package Manager on master channel',
() async {
mockPlatform.isMacOS = true;