|
2 | 2 | // for details. All rights reserved. Use of this source code is governed by a |
3 | 3 | // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
|
5 | | -import 'dart:io'; |
6 | 5 | import 'dart:ffi'; |
| 6 | +import 'dart:io'; |
7 | 7 |
|
8 | 8 | import 'package:args/args.dart'; |
9 | 9 | import 'package:yaml/yaml.dart'; |
10 | 10 |
|
11 | 11 | void main(List<String> arguments) async { |
12 | 12 | final parser = makeArgParser(); |
13 | 13 |
|
14 | | - final ArgResults argResults = parser.parse(arguments); |
| 14 | + final argResults = parser.parse(arguments); |
15 | 15 |
|
16 | 16 | final packages = loadPackagesFromPubspec(); |
17 | 17 |
|
@@ -69,9 +69,9 @@ ArgParser makeArgParser() { |
69 | 69 | /// task's name, its default state, and the help message for its corresponding |
70 | 70 | /// command-line flag. |
71 | 71 | /// |
72 | | -/// The main execution loop iterates through a list of [Task] instances. For each |
73 | | -/// instance, it uses [shouldRun] to determine if the task should be executed |
74 | | -/// based on the command-line flags, and if so, calls the [run] method. |
| 72 | +/// The main execution loop iterates through a list of [Task] instances. For |
| 73 | +/// each instance, it uses [shouldRun] to determine if the task should be |
| 74 | +/// executed based on the command-line flags, and if so, calls the [run] method. |
75 | 75 | abstract class Task { |
76 | 76 | /// The name of the task, used for the command-line flag. |
77 | 77 | /// |
@@ -151,7 +151,12 @@ class AnalyzeTask extends Task { |
151 | 151 | required List<String> packages, |
152 | 152 | required ArgResults argResults, |
153 | 153 | }) async { |
154 | | - await _runProcess('dart', ['analyze', '--fatal-infos', ...packages]); |
| 154 | + await _runProcess('dart', [ |
| 155 | + 'analyze', |
| 156 | + '--fatal-infos', |
| 157 | + ...packages, |
| 158 | + 'tool', |
| 159 | + ]); |
155 | 160 | } |
156 | 161 | } |
157 | 162 |
|
@@ -364,7 +369,7 @@ List<String> loadPackagesFromPubspec() { |
364 | 369 | final pubspecYaml = loadYaml( |
365 | 370 | File.fromUri(repositoryRoot.resolve('pubspec.yaml')).readAsStringSync(), |
366 | 371 | ); |
367 | | - final workspace = (pubspecYaml['workspace'] as List).cast<String>(); |
| 372 | + final workspace = ((pubspecYaml as Map)['workspace'] as List).cast<String>(); |
368 | 373 | final packages = workspace |
369 | 374 | .where( |
370 | 375 | (package) => |
@@ -426,7 +431,7 @@ Future<void> _runProcess( |
426 | 431 | final exitCode = await process.exitCode; |
427 | 432 |
|
428 | 433 | if (exitCode != 0) { |
429 | | - print('+$commandString failed with exitCode ${exitCode}.'); |
| 434 | + print('+$commandString failed with exitCode $exitCode.'); |
430 | 435 | exit(exitCode); |
431 | 436 | } |
432 | 437 | } |
0 commit comments