Skip to content

Commit

Permalink
Add all the missing awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy committed Jul 16, 2024
1 parent f5d589d commit c9c2f16
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 23 deletions.
3 changes: 1 addition & 2 deletions sidekick/test/plugins_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:dcli/dcli.dart';
import 'package:dcli_core/dcli_core.dart';
import 'package:recase/recase.dart';
import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_core/src/commands/plugins/create_plugin_command.dart';
Expand Down Expand Up @@ -55,7 +54,7 @@ void main() {

'git init'.start(workingDirectory: pluginDir.path);
'git add .'.start(workingDirectory: pluginDir.path);
withEnvironment(
await withEnvironment(
() async =>
'git commit -m "initial"'.start(workingDirectory: pluginDir.path),
// without this, `git commit` crashes on CI
Expand Down
2 changes: 1 addition & 1 deletion sidekick/test/recompile_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void main() {
printOnFailure(stdout);
final stderr = await updateProcess.stderrStream().join('\n');
printOnFailure(stderr);
updateProcess.shouldExit(0);
await updateProcess.shouldExit(0);
expect(stderr, contains('Installing dashi command line application'));
expect(stderr, contains('Getting dependencies'));
expect(stderr, contains('Bundling assets'));
Expand Down
1 change: 1 addition & 0 deletions sidekick_core/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ include: package:lint/analysis_options_package.yaml
linter:
rules:
avoid_print: false
unawaited_futures: true
# public_member_api_docs: true
2 changes: 1 addition & 1 deletion sidekick_core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
cli_completion: ^0.3.0
dart_console2: '>=3.0.0 <3.1.0'
dartx: ^1.1.0
dcli: ^4.0.0
dcli: ^4.0.4
glob: ^2.0.2
http: '>=0.13.5 <2.0.0'
meta: ^1.5.0
Expand Down
6 changes: 3 additions & 3 deletions sidekick_core/test/format_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,15 @@ name: dashi
..writeAsStringSync(_dartFile140);
final fakeStdout = FakeStdoutStream();
final fakeStderr = FakeStdoutStream();
overrideIoStreams(
await overrideIoStreams(
stderr: () => fakeStderr,
stdout: () => fakeStdout,
body: () {
body: () async {
final runner = initializeSidekick(
dartSdkPath: systemDartSdkPath(),
);
runner.addCommand(FormatCommand());
expectLater(
await expectLater(
() => runner.run(['format', '--verify']),
throwsA(isA<DartFileFormatException>()),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
tempDir.deleteSync(recursive: true);
env['SIDEKICK_PACKAGE_HOME'] = null;
});
tempDir.file('test').writeAsString('# entrypoint file');
tempDir.file('test').writeAsStringSync('# entrypoint file');
sidekickDir.file('pubspec.yaml').writeAsStringSync('name: test_sidekick');
final cliMainFile = sidekickDir.file('lib/test_sidekick.dart')
..createSync(recursive: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
tempDir.deleteSync(recursive: true);
env['SIDEKICK_PACKAGE_HOME'] = null;
});
tempDir.file('dash').writeAsString('# entrypoint file');
tempDir.file('dash').writeAsStringSync('# entrypoint file');
sidekickDir.file('pubspec.yaml').writeAsStringSync('name: dash_sidekick');
final cliMainFile = sidekickDir.file('lib/dash_sidekick.dart')
..createSync(recursive: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
tempDir.deleteSync(recursive: true);
env['SIDEKICK_PACKAGE_HOME'] = null;
});
tempDir.file('dash').writeAsString('# entrypoint file');
tempDir.file('dash').writeAsStringSync('# entrypoint file');
sidekickDir.file('pubspec.yaml').writeAsStringSync('name: dash_sidekick');
final cliMainFile = sidekickDir.file('lib/dash_sidekick.dart')
..createSync(recursive: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
tempDir.deleteSync(recursive: true);
env['SIDEKICK_PACKAGE_HOME'] = null;
});
tempDir.file('dash').writeAsString('# entrypoint file');
tempDir.file('dash').writeAsStringSync('# entrypoint file');
sidekickDir.file('pubspec.yaml').writeAsStringSync('name: dash_sidekick');
final gitignore = sidekickDir.file('.gitignore');
gitignore.writeAsStringSync(testCase.fileContentBefore);
Expand Down
2 changes: 1 addition & 1 deletion sidekick_core/test/update/update_2_0_0_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void main() {
tempDir.deleteSync(recursive: true);
env['SIDEKICK_PACKAGE_HOME'] = null;
});
tempDir.file('test').writeAsString('# entrypoint file');
tempDir.file('test').writeAsStringSync('# entrypoint file');
final pubspecFile = sidekickDir.file('pubspec.yaml');
final oldHttpVersion = Version(0, 13, 6);
pubspecFile.writeAsStringSync('''
Expand Down
3 changes: 2 additions & 1 deletion sidekick_plugin_installer/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ include: package:lint/analysis_options_package.yaml

linter:
rules:
avoid_print: false
avoid_print: false
unawaited_futures: true
8 changes: 4 additions & 4 deletions sidekick_plugin_installer/test/register_plugin_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() {
dir.file('packages/dash/lib/dash.dart').writeAsStringSync(
initialCliFileContentWithoutImportAndCommand,
);
registerPlugin(
await registerPlugin(
sidekickCli:
DartPackage.fromDirectory(dir.directory('packages/dash'))!,
command: 'MyCommand()',
Expand All @@ -29,7 +29,7 @@ void main() {
dir.file('packages/dash/lib/dash.dart').writeAsStringSync(
initialCliFileContentWithMyCommand,
);
registerPlugin(
await registerPlugin(
sidekickCli:
DartPackage.fromDirectory(dir.directory('packages/dash'))!,
command: 'MyCommand()',
Expand All @@ -46,7 +46,7 @@ void main() {
dir.file('packages/dash/lib/dash.dart').writeAsStringSync(
initialCliFileContentWithoutImportAndCommand,
);
registerPlugin(
await registerPlugin(
sidekickCli:
DartPackage.fromDirectory(dir.directory('packages/dash'))!,
import: "import 'package:my_package/src/my_command.dart';",
Expand All @@ -64,7 +64,7 @@ void main() {
dir.file('packages/dash/lib/dash.dart').writeAsStringSync(
initialCliFileContentWithMyImport,
);
registerPlugin(
await registerPlugin(
sidekickCli:
DartPackage.fromDirectory(dir.directory('packages/dash'))!,
import: "import 'package:my_package/src/my_command.dart';",
Expand Down
3 changes: 2 additions & 1 deletion sidekick_vault/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ include: package:lint/analysis_options_package.yaml

linter:
rules:
avoid_print: false
avoid_print: false
unawaited_futures: true
1 change: 0 additions & 1 deletion sidekick_vault/test/delete_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:dcli_core/dcli_core.dart';
import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_vault/sidekick_vault.dart';
import 'package:test/test.dart';
Expand Down
1 change: 0 additions & 1 deletion sidekick_vault/test/unlock_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:dcli_core/dcli_core.dart';
import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_vault/sidekick_vault.dart';
import 'package:test/test.dart';
Expand Down
1 change: 0 additions & 1 deletion sidekick_vault/test/vault_command_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:dcli_core/dcli_core.dart';
import 'package:sidekick_core/sidekick_core.dart';
import 'package:sidekick_vault/sidekick_vault.dart';
import 'package:test/test.dart';
Expand Down
4 changes: 2 additions & 2 deletions sidekick_vault/tool/install.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Future<void> main() async {

print("- Generating package:${package.name}/src/vault.dart");
_writeVaultFile(vaultDir, package);
addImport(
await addImport(
package.libDir.file('${package.name}.dart'),
"import 'package:${package.name}/src/vault.dart';",
);

print("- Adding vault command");
registerPlugin(
await registerPlugin(
sidekickCli: package,
import: "import 'package:sidekick_vault/sidekick_vault.dart';",
command: 'VaultCommand(vault: vault)',
Expand Down

0 comments on commit c9c2f16

Please sign in to comment.