From 0571cfe6552bbfccc167fdc23cc685ab79def613 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 28 Jan 2022 19:21:15 +0000 Subject: [PATCH] [dartdev] turn on the prefer_single_quotes lint Change-Id: I43c964c769a98ca4796e7172254835088adbc088 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230800 Auto-Submit: Devon Carew Commit-Queue: Devon Carew Reviewed-by: Ben Konyi Commit-Queue: Ben Konyi --- pkg/dartdev/analysis_options.yaml | 1 + pkg/dartdev/lib/src/commands/doc.dart | 4 ++-- pkg/dartdev/lib/src/commands/run.dart | 2 +- pkg/dartdev/test/no_such_file_test.dart | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/dartdev/analysis_options.yaml b/pkg/dartdev/analysis_options.yaml index 3faacee7e6a..094baf6edf6 100644 --- a/pkg/dartdev/analysis_options.yaml +++ b/pkg/dartdev/analysis_options.yaml @@ -8,4 +8,5 @@ linter: # Enable additional rules. depend_on_referenced_packages: true directives_ordering: true + prefer_single_quotes: true sort_pub_dependencies: true diff --git a/pkg/dartdev/lib/src/commands/doc.dart b/pkg/dartdev/lib/src/commands/doc.dart index 11e1df7c5f8..907bba6b4b2 100644 --- a/pkg/dartdev/lib/src/commands/doc.dart +++ b/pkg/dartdev/lib/src/commands/doc.dart @@ -67,13 +67,13 @@ For additional documentation generation options, see the 'dartdoc_options.yaml' // At least one argument, the input directory, is required, // when we're not generating docs for the Dart SDK. if (args.rest.isEmpty) { - usageException("Error: Input directory not specified"); + usageException('Error: Input directory not specified'); } // Determine input directory. final dir = io.Directory(args.rest[0]); if (!dir.existsSync()) { - usageException("Error: Input directory doesn't exist: ${dir.path}"); + usageException('Error: Input directory doesn\'t exist: ${dir.path}'); } options.add('--input=${dir.path}'); } diff --git a/pkg/dartdev/lib/src/commands/run.dart b/pkg/dartdev/lib/src/commands/run.dart index ea0ce59cda6..94b0141ab6b 100644 --- a/pkg/dartdev/lib/src/commands/run.dart +++ b/pkg/dartdev/lib/src/commands/run.dart @@ -20,7 +20,7 @@ import '../utils.dart'; import '../vm_interop_handler.dart'; class RunCommand extends DartdevCommand { - static const bool isProductMode = bool.fromEnvironment("dart.vm.product"); + static const bool isProductMode = bool.fromEnvironment('dart.vm.product'); static const String cmdName = 'run'; // kErrorExitCode, as defined in runtime/bin/error_exit.h diff --git a/pkg/dartdev/test/no_such_file_test.dart b/pkg/dartdev/test/no_such_file_test.dart index 1208a5e082e..4d8032d2185 100644 --- a/pkg/dartdev/test/no_such_file_test.dart +++ b/pkg/dartdev/test/no_such_file_test.dart @@ -33,7 +33,7 @@ void main() { expect(result.stderr, isNotEmpty); expect(result.stderr, contains("Error when reading 'foo.dart':")); expect(result.stdout, isNotEmpty); - expect(result.stdout, contains("Info: Compiling with sound null safety\n")); + expect(result.stdout, contains('Info: Compiling with sound null safety\n')); expect(result.exitCode, 254); }); }