Skip to content

Commit

Permalink
[ci] Ensure repo tool is autoformatted (flutter#7963)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stuartmorgan authored Oct 30, 2024
1 parent e55be96 commit ed7ee79
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .ci/scripts/plugin_tools_format.sh
Original file line number Diff line number Diff line change
@@ -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 .
2 changes: 2 additions & 0 deletions .ci/targets/repo_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ tasks:
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.
Expand Down
6 changes: 2 additions & 4 deletions script/tool/lib/src/fetch_deps_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ class FetchDepsCommand extends PackageLoopingCommand {
flutterCommand,
<String>[
'precache',
if (precacheIOS)
'--ios',
if (precacheMacOS)
'--macos',
if (precacheIOS) '--ios',
if (precacheMacOS) '--macos',
],
);
if (precacheExitCode != 0) {
Expand Down
1 change: 0 additions & 1 deletion script/tool/test/build_examples_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ void main() {
);
});


test('building for macOS with Swift Package Manager on master channel',
() async {
mockPlatform.isMacOS = true;
Expand Down

0 comments on commit ed7ee79

Please sign in to comment.