diff --git a/lib/src/command_runner/commands/handle_completion_command.dart b/lib/src/command_runner/commands/handle_completion_command.dart index 7ec5286..b124c12 100644 --- a/lib/src/command_runner/commands/handle_completion_command.dart +++ b/lib/src/command_runner/commands/handle_completion_command.dart @@ -62,14 +62,9 @@ class HandleCompletionRequestCommand extends Command { } // Parse the completion level into completion suggestions - final completionResults = CompletionParser( - completionLevel: completionLevel, - ).parse(); - + CompletionParser(completionLevel: completionLevel).parse() // Render the completion suggestions - for (final completionResult in completionResults) { - runner.renderCompletionResult(completionResult); - } + .forEach(runner.renderCompletionResult); } on Exception { // Do not output any Exception here, since even error messages are // interpreted as completion suggestions diff --git a/pubspec.yaml b/pubspec.yaml index cc45ea1..fe007f6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,4 +21,4 @@ dependencies: dev_dependencies: mocktail: ^1.0.4 test: ^1.25.8 - very_good_analysis: ^9.0.0 + very_good_analysis: ">=10.0.0 <11.0.0" diff --git a/test/src/installer/completion_configuration_test.dart b/test/src/installer/completion_configuration_test.dart index 351ec54..be3e789 100644 --- a/test/src/installer/completion_configuration_test.dart +++ b/test/src/installer/completion_configuration_test.dart @@ -1,5 +1,4 @@ // Not required for test files -// ignore_for_file: prefer_const_constructors import 'dart:collection'; import 'dart:io'; diff --git a/test/src/installer/completion_installation_test.dart b/test/src/installer/completion_installation_test.dart index 68b9903..aefea0b 100644 --- a/test/src/installer/completion_installation_test.dart +++ b/test/src/installer/completion_installation_test.dart @@ -225,7 +225,6 @@ void main() { expect(configFile.existsSync(), true); // Different format needed for matching cli output - // ignore: leading_newlines_in_multiline_strings expect(configFile.readAsStringSync(), ''' \n## [very_good] ## Completion config for "very_good" @@ -287,7 +286,6 @@ void main() { installation.writeToShellConfigFile('very_good'); // Different format needed for matching cli output - // ignore: leading_newlines_in_multiline_strings expect(rcFile.readAsStringSync(), ''' \n## [Completion] ## Completion scripts setup. Remove the following line to uninstall @@ -435,7 +433,6 @@ void main() { // rc fle includes one reference to the global config // Different format needed for matching cli output - // ignore: leading_newlines_in_multiline_strings expect(rcFile.readAsStringSync(), ''' \n## [Completion] ## Completion scripts setup. Remove the following line to uninstall @@ -450,7 +447,6 @@ void main() { ); // Different format needed for matching cli output - // ignore: leading_newlines_in_multiline_strings expect(globalConfig.readAsStringSync(), ''' \n## [very_good] ## Completion config for "very_good" @@ -491,7 +487,6 @@ void main() { ..install('not_good'); // Different format needed for matching cli output - // ignore: leading_newlines_in_multiline_strings expect(bashProfile.readAsStringSync(), ''' \n## [Completion] ## Completion scripts setup. Remove the following line to uninstall