Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
switch from using 'tuneup' to analyze to 'dart analyze'
  • Loading branch information
devoncarew committed Apr 29, 2021
commit 4c76f7ab971a0e831cf55c319be3e2a8429addfa
12 changes: 3 additions & 9 deletions script/tool/lib/src/analyze_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class AnalyzeCommand extends PluginCommand {
final String name = 'analyze';

@override
final String description = 'Analyzes all packages using package:tuneup.\n\n'
'This command requires "pub" and "flutter" to be in your path.';
final String description = 'Analyzes all packages using dart analyze.\n\n'
'This command requires "dart" and "flutter" to be in your path.';

@override
Future<void> run() async {
Expand All @@ -57,11 +57,6 @@ class AnalyzeCommand extends PluginCommand {
throw ToolExit(1);
}

print('Activating tuneup package...');
await processRunner.runAndStream(
'pub', <String>['global', 'activate', 'tuneup'],
workingDir: packagesDir, exitOnError: true);

await for (final Directory package in getPackages()) {
if (isFlutterPackage(package, fileSystem)) {
await processRunner.runAndStream('flutter', <String>['packages', 'get'],
Expand All @@ -75,8 +70,7 @@ class AnalyzeCommand extends PluginCommand {
final List<String> failingPackages = <String>[];
await for (final Directory package in getPlugins()) {
final int exitCode = await processRunner.runAndStream(
'pub', <String>['global', 'run', 'tuneup', 'check'],
workingDir: package);
'dart', <String>['analyze'], workingDir: package);
if (exitCode != 0) {
failingPackages.add(p.basename(package.path));
}
Expand Down
15 changes: 3 additions & 12 deletions script/tool/test/analyze_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,12 @@ void main() {
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall('pub', const <String>['global', 'activate', 'tuneup'],
mockPackagesDir.path),
ProcessCall(
'flutter', const <String>['packages', 'get'], plugin1Dir.path),
ProcessCall(
'flutter', const <String>['packages', 'get'], plugin2Dir.path),
ProcessCall('pub', const <String>['global', 'run', 'tuneup', 'check'],
plugin1Dir.path),
ProcessCall('pub', const <String>['global', 'run', 'tuneup', 'check'],
plugin2Dir.path),
ProcessCall('dart', const <String>['analyze'], plugin1Dir.path),
ProcessCall('dart', const <String>['analyze'], plugin2Dir.path),
]));
});

Expand Down Expand Up @@ -88,14 +84,9 @@ void main() {
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall('pub', const <String>['global', 'activate', 'tuneup'],
mockPackagesDir.path),
ProcessCall(
'flutter', const <String>['packages', 'get'], pluginDir.path),
ProcessCall(
'pub',
const <String>['global', 'run', 'tuneup', 'check'],
pluginDir.path),
ProcessCall('dart', const <String>['analyze'], pluginDir.path),
]));
});

Expand Down