Enable avoid_escaping_inner_quotes lint (#81153)

This commit is contained in:
Hattomo (TomohiroHattori)
2021-05-20 01:54:02 +09:00
committed by GitHub
parent 0c5f2f4ab9
commit 08a70e7ac8
81 changed files with 192 additions and 192 deletions

View File

@@ -1031,7 +1031,7 @@ class AdbLogReader extends DeviceLogReader {
final String lastLogcatTimestamp = await device.lastLogcatTimestamp();
args.addAll(<String>[
'-T',
if (lastLogcatTimestamp != null) '\'$lastLogcatTimestamp\'' else '0',
if (lastLogcatTimestamp != null) "'$lastLogcatTimestamp'" else '0',
]);
}
final Process process = await processManager.start(device.adbCommandForDevice(args));

View File

@@ -80,7 +80,7 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator
if (!appManifestFile.existsSync()) {
invalidFiles[appManifestFile.path] = 'Error: $appManifestFile does not '
'exist or could not be found. Please ensure an AndroidManifest.xml '
'exists for the app\'s base module.';
"exists for the app's base module.";
return false;
}
XmlDocument document;
@@ -222,37 +222,37 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator
final YamlMap data = loadYaml(cacheFile.readAsStringSync()) as YamlMap;
// validate yaml format.
if (!data.containsKey('loading-units')) {
invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'loading-units\' '
invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' "
'entry did not exist.';
return loadingUnits;
} else {
if (data['loading-units'] is! YamlList && data['loading-units'] != null) {
invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'loading-units\' '
invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' "
'is not a list.';
return loadingUnits;
}
if (data['loading-units'] != null) {
for (final dynamic loadingUnitData in data['loading-units']) {
if (loadingUnitData is! YamlMap) {
invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'loading-units\' '
invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' "
'is not a list of maps.';
return loadingUnits;
}
final YamlMap loadingUnitDataMap = loadingUnitData as YamlMap;
if (loadingUnitDataMap['id'] == null) {
invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, all '
'loading units must have an \'id\'';
"loading units must have an 'id'";
return loadingUnits;
}
if (loadingUnitDataMap['libraries'] != null) {
if (loadingUnitDataMap['libraries'] is! YamlList) {
invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'libraries\' '
invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'libraries' "
'is not a list.';
return loadingUnits;
}
for (final dynamic node in loadingUnitDataMap['libraries'] as YamlList) {
if (node is! String) {
invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'libraries\' '
invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'libraries' "
'is not a list of strings.';
return loadingUnits;
}

View File

@@ -388,7 +388,7 @@ final GradleHandledError minSdkVersion = GradleHandledError(
' }\n'
'}\n\n'
)+
'Note that your app won\'t be available to users running Android SDKs below ${minSdkVersionMatch.group(2)}.\n'
"Note that your app won't be available to users running Android SDKs below ${minSdkVersionMatch.group(2)}.\n"
'Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.'
);
return GradleBuildStatus.exit;

View File

@@ -110,13 +110,13 @@ distributionUrl=https\\://services.gradle.org/distributions/gradle-$gradleVersio
String getGradleVersionForAndroidPlugin(Directory directory, Logger logger) {
final File buildFile = directory.childFile('build.gradle');
if (!buildFile.existsSync()) {
logger.printTrace('$buildFile doesn\'t exist, assuming AGP version: $_defaultGradleVersion');
logger.printTrace("$buildFile doesn't exist, assuming AGP version: $_defaultGradleVersion");
return _defaultGradleVersion;
}
final String buildFileContent = buildFile.readAsStringSync();
final Iterable<Match> pluginMatches = _androidPluginRegExp.allMatches(buildFileContent);
if (pluginMatches.isEmpty) {
logger.printTrace('$buildFile doesn\'t provide an AGP version, assuming AGP version: $_defaultGradleVersion');
logger.printTrace("$buildFile doesn't provide an AGP version, assuming AGP version: $_defaultGradleVersion");
return _defaultGradleVersion;
}
final String androidPluginVersion = pluginMatches.first.group(1);

View File

@@ -90,7 +90,7 @@ class ErrorHandlingFileSystem extends ForwardingFileSystem {
if (file.existsSync()) {
throwToolExit(
'The Flutter tool tried to delete the file or directory ${file.path} but was '
'unable to. This may be due to the file and/or project\'s location on a read-only '
"unable to. This may be due to the file and/or project's location on a read-only "
'volume. Consider relocating the project and trying again',
);
}

View File

@@ -351,7 +351,7 @@ class _LinuxUtils extends _PosixUtils {
final String value = entryKeyValuePair[1];
// Remove quotes from either end of the value if they exist
final String quote = value[0];
if (quote == '\'' || quote == '"') {
if (quote == "'" || quote == '"') {
return value.substring(0, value.length - 1).substring(1);
} else {
return value;

View File

@@ -63,7 +63,7 @@ class BuildApkCommand extends BuildSubCommand {
"This command can build debug and release versions of your application. 'debug' builds support "
"debugging and a quick development cycle. 'release' builds don't support debugging and are "
'suitable for deploying to app stores. If you are deploying the app to the Play Store, '
'it\'s recommended to use app bundles or split the APK to reduce the APK size. Learn more at:\n\n'
"it's recommended to use app bundles or split the APK to reduce the APK size. Learn more at:\n\n"
' * https://developer.android.com/guide/app-bundle\n'
' * https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split';

View File

@@ -128,11 +128,11 @@ class GenerateLocalizationsCommand extends FlutterCommand {
'gen-inputs-and-outputs-list',
valueHelp: 'path-to-output-directory',
help: 'When specified, the tool generates a JSON file containing the '
'tool\'s inputs and outputs named gen_l10n_inputs_and_outputs.json.\n'
"tool's inputs and outputs named gen_l10n_inputs_and_outputs.json.\n"
'\n'
'This can be useful for keeping track of which files of the Flutter '
'project were used when generating the latest set of localizations. '
'For example, the Flutter tool\'s build system uses this file to '
"For example, the Flutter tool's build system uses this file to "
'keep track of when to call gen_l10n during hot reload.\n'
'\n'
'The value of this option is the directory where the JSON file will be '

View File

@@ -23,7 +23,7 @@ import '../runner/flutter_command.dart';
class PackagesCommand extends FlutterCommand {
PackagesCommand() {
addSubcommand(PackagesGetCommand('get', false));
addSubcommand(PackagesInteractiveGetCommand('upgrade', 'Upgrade the current package\'s dependencies to latest versions.'));
addSubcommand(PackagesInteractiveGetCommand('upgrade', "Upgrade the current package's dependencies to latest versions."));
addSubcommand(PackagesInteractiveGetCommand('add', 'Add a dependency to pubspec.yaml.'));
addSubcommand(PackagesInteractiveGetCommand('remove', 'Removes a dependency from the current package.'));
addSubcommand(PackagesTestCommand());

View File

@@ -261,7 +261,7 @@ class RunCommand extends RunCommandBase {
'or just dump the trace as soon as the application is running. The first frame '
'is detected by looking for a Timeline event with the name '
'"${Tracing.firstUsefulFrameEventName}". '
'By default, the widgets library\'s binding takes care of sending this event.',
"By default, the widgets library's binding takes care of sending this event.",
)
..addFlag('use-test-fonts',
negatable: true,

View File

@@ -44,7 +44,7 @@ class ScreenshotCommand extends FlutterCommand {
help: 'The type of screenshot to retrieve.',
allowed: const <String>[_kDeviceType, _kSkiaType, _kRasterizerType],
allowedHelp: const <String, String>{
_kDeviceType: 'Delegate to the device\'s native screenshot capabilities. This '
_kDeviceType: "Delegate to the device's native screenshot capabilities. This "
'screenshots the entire screen currently being displayed (including content '
'not rendered by Flutter, like the device status bar).',
_kSkiaType: 'Render the Flutter app as a Skia picture. Requires "--$_kObservatoryUrl".',

View File

@@ -246,15 +246,15 @@ class UpgradeCommandRunner {
if (errorString.contains('fatal: HEAD does not point to a branch')) {
throwToolExit(
'You are not currently on a release branch. Use git to '
'check out an official branch (\'stable\', \'beta\', \'dev\', or \'master\') '
"check out an official branch ('stable', 'beta', 'dev', or 'master') "
'and retry, for example:\n'
' git checkout stable'
);
} else if (errorString.contains('fatal: no upstream configured for branch')) {
throwToolExit(
'Unable to upgrade Flutter: no origin repository configured. '
'Run \'git remote add origin '
'https://github.com/flutter/flutter\' in $workingDirectory');
"Run 'git remote add origin "
"https://github.com/flutter/flutter' in $workingDirectory");
} else {
throwToolExit(errorString);
}

View File

@@ -1098,7 +1098,7 @@ List<PluginInterfaceResolution> resolvePlatformImplementation(
if (defaultImplementation == null) {
if (throwOnPluginPubspecError) {
globals.printError(
'Plugin `${plugin.name}` doesn\'t implement a plugin interface, nor sets '
"Plugin `${plugin.name}` doesn't implement a plugin interface, nor sets "
'a default implementation in pubspec.yaml.\n\n'
'To set a default implementation, use:\n'
'flutter:\n'

View File

@@ -106,7 +106,7 @@ class WebExpressionCompiler implements ExpressionCompiler {
}
return ExpressionCompilationResult(
'InternalError: frontend server failed to compile \'$expression\'',
"InternalError: frontend server failed to compile '$expression'",
true);
}

View File

@@ -107,7 +107,7 @@ String generateDateFormattingLogic(Message message) {
'the "${placeholder.type}" type. To properly resolve for the right '
'${placeholder.type} format, the "format" attribute needs to be set '
'to determine which DateFormat to use. \n'
'Check the intl library\'s DateFormat class constructors for allowed '
"Check the intl library's DateFormat class constructors for allowed "
'date formats.'
);
}
@@ -115,7 +115,7 @@ String generateDateFormattingLogic(Message message) {
throw L10nException(
'Date format "$placeholderFormat" for placeholder '
'${placeholder.name} does not have a corresponding DateFormat '
'constructor\n. Check the intl library\'s DateFormat class '
"constructor\n. Check the intl library's DateFormat class "
'constructors for allowed date formats.'
);
}
@@ -140,7 +140,7 @@ String generateNumberFormattingLogic(Message message) {
throw L10nException(
'Number format $placeholderFormat for the ${placeholder.name} '
'placeholder does not have a corresponding NumberFormat constructor.\n'
'Check the intl library\'s NumberFormat class constructors for allowed '
"Check the intl library's NumberFormat class constructors for allowed "
'number formats.'
);
}
@@ -765,7 +765,7 @@ class LocalizationsGenerator {
if (!directory.existsSync()) {
throw L10nException(
'Directory does not exist: $directory.\n'
'Please select a directory that contains the project\'s localizations '
"Please select a directory that contains the project's localizations "
'resource files.'
);
}
@@ -1078,18 +1078,18 @@ class LocalizationsGenerator {
final String? scriptCode = locale.scriptCode;
if (countryCode == null && scriptCode == null) {
return 'Locale(\'$languageCode\')';
return "Locale('$languageCode')";
} else if (countryCode != null && scriptCode == null) {
return 'Locale(\'$languageCode\', \'$countryCode\')';
return "Locale('$languageCode', '$countryCode')";
} else if (countryCode != null && scriptCode != null) {
return 'Locale.fromSubtags(languageCode: \'$languageCode\', countryCode: \'$countryCode\', scriptCode: \'$scriptCode\')';
return "Locale.fromSubtags(languageCode: '$languageCode', countryCode: '$countryCode', scriptCode: '$scriptCode')";
} else {
return 'Locale.fromSubtags(languageCode: \'$languageCode\', scriptCode: \'$scriptCode\')';
return "Locale.fromSubtags(languageCode: '$languageCode', scriptCode: '$scriptCode')";
}
});
final Set<String> supportedLanguageCodes = Set<String>.from(
_allBundles.locales.map<String>((LocaleInfo locale) => '\'${locale.languageCode}\'')
_allBundles.locales.map<String>((LocaleInfo locale) => "'${locale.languageCode}'")
);
final List<LocaleInfo> allLocales = _allBundles.locales.toList()..sort();

View File

@@ -408,7 +408,7 @@ class CocoaPods {
// the old parsed .flutter-plugins file, prompt the regeneration. Old line was:
// plugin_pods = parse_KV_file('../.flutter-plugins')
if (xcodeProject.podfile.existsSync() &&
xcodeProject.podfile.readAsStringSync().contains('.flutter-plugins\'')) {
xcodeProject.podfile.readAsStringSync().contains(".flutter-plugins'")) {
const String error = 'Warning: Podfile is out of date\n'
'$outOfDatePluginsPodfileConsequence\n'
'To regenerate the Podfile, run:\n';

View File

@@ -50,7 +50,7 @@ void main() {
Artifacts: () => Artifacts.test(),
});
testUsingContext('get devices\' platform types', () async {
testUsingContext("get devices' platform types", () async {
final List<String> platformTypes = Device.devicesPlatformTypes(
await globals.deviceManager.getAllConnectedDevices(),
);

View File

@@ -624,7 +624,7 @@ dev_dependencies:
DeviceManager: () => _FakeDeviceManager(<Device>[]),
});
testUsingContext('Don\'t build the asset manifest if --no-test-assets if informed', () async {
testUsingContext("Don't build the asset manifest if --no-test-assets if informed", () async {
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
final TestCommand testCommand = TestCommand(testRunner: testRunner);

View File

@@ -226,8 +226,8 @@ void main() {
'Analyzing',
'info $analyzerSeparator Avoid empty else statements',
'info $analyzerSeparator Avoid empty statements',
'info $analyzerSeparator The declaration \'_incrementCounter\' isn\'t',
'warning $analyzerSeparator The parameter \'onPressed\' is required',
"info $analyzerSeparator The declaration '_incrementCounter' isn't",
"warning $analyzerSeparator The parameter 'onPressed' is required",
],
exitMessageContains: '4 issues found.',
toolExit: true,
@@ -272,9 +272,9 @@ void main() {
arguments: <String>['analyze', '--no-pub'],
statusTextContains: <String>[
'Analyzing',
'info $analyzerSeparator The declaration \'_incrementCounter\' isn\'t',
"info $analyzerSeparator The declaration '_incrementCounter' isn't",
'info $analyzerSeparator Only throw instances of classes extending either Exception or Error',
'warning $analyzerSeparator The parameter \'onPressed\' is required',
"warning $analyzerSeparator The parameter 'onPressed' is required",
],
exitMessageContains: '3 issues found.',
toolExit: true,

View File

@@ -36,7 +36,7 @@ import '../../src/fakes.dart';
import '../../src/pubspec_schema.dart';
import '../../src/test_flutter_command_runner.dart';
const String _kNoPlatformsMessage = 'You\'ve created a plugin project that doesn\'t yet support any platforms.\n';
const String _kNoPlatformsMessage = "You've created a plugin project that doesn't yet support any platforms.\n";
const String frameworkRevision = '12345678';
const String frameworkChannel = 'omega';
const String _kDisabledPlatformRequestedMessage = 'currently not supported on your local environment.';

View File

@@ -34,7 +34,7 @@ void main() {
'-v',
'time',
'-T',
'\'$kLastLogcatTimestamp\'',
"'$kLastLogcatTimestamp'",
],
)
]);

View File

@@ -228,7 +228,7 @@ loading-units-spelled-wrong:
validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:'));
expect(logger.statusText, contains('Invalid loading units yaml file, \'loading-units\' entry did not exist.'));
expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' entry did not exist."));
expect(logger.statusText.contains('Previously existing loading units no longer exist:\n\n LoadingUnit 2\n Libraries:\n - lib1\n'), false);
});
@@ -253,7 +253,7 @@ loading-units: hello
validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:'));
expect(logger.statusText, contains('Invalid loading units yaml file, \'loading-units\' is not a list.'));
expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' is not a list."));
});
testWithoutContext('loadingUnitCache validator detects malformed file: not a list', () async {
@@ -278,7 +278,7 @@ loading-units:
validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:'));
expect(logger.statusText, contains('Invalid loading units yaml file, \'loading-units\' is not a list of maps.'));
expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' is not a list of maps."));
});
testWithoutContext('loadingUnitCache validator detects malformed file: missing id', () async {
@@ -307,7 +307,7 @@ loading-units:
validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:'));
expect(logger.statusText, contains('Invalid loading units yaml file, all loading units must have an \'id\''));
expect(logger.statusText, contains("Invalid loading units yaml file, all loading units must have an 'id'"));
});
testWithoutContext('loadingUnitCache validator detects malformed file: libraries is list', () async {
@@ -335,7 +335,7 @@ loading-units:
validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:'));
expect(logger.statusText, contains('Invalid loading units yaml file, \'libraries\' is not a list.'));
expect(logger.statusText, contains("Invalid loading units yaml file, 'libraries' is not a list."));
});
testWithoutContext('loadingUnitCache validator detects malformed file: libraries is list of strings', () async {
@@ -365,7 +365,7 @@ loading-units:
validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:'));
expect(logger.statusText, contains('Invalid loading units yaml file, \'libraries\' is not a list of strings.'));
expect(logger.statusText, contains("Invalid loading units yaml file, 'libraries' is not a list of strings."));
});
testWithoutContext('loadingUnitCache validator detects malformed file: empty libraries allowed', () async {
@@ -460,7 +460,7 @@ loading-units:
expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync().contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'), true);
expect(manifestOutput.readAsStringSync().contains('android:value="invalidmapping"'), false);
expect(manifestOutput.readAsStringSync().contains('<!-- Don\'t delete the meta-data below.'), true);
expect(manifestOutput.readAsStringSync().contains("<!-- Don't delete the meta-data below."), true);
});
testWithoutContext('androidStringMapping adds mapping when no existing mapping', () async {
@@ -518,7 +518,7 @@ loading-units:
.childFile('AndroidManifest.xml');
expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'));
expect(manifestOutput.readAsStringSync(), contains('<!-- Don\'t delete the meta-data below.'));
expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below."));
});
// The mapping is incorrectly placed in the activity instead of application.
@@ -579,7 +579,7 @@ loading-units:
.childFile('AndroidManifest.xml');
expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'));
expect(manifestOutput.readAsStringSync(), contains('<!-- Don\'t delete the meta-data below.'));
expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below."));
});
testWithoutContext('androidStringMapping generates base module loading unit mapping', () async {
@@ -640,7 +640,7 @@ loading-units:
.childFile('AndroidManifest.xml');
expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2,5:,6:"/>'));
expect(manifestOutput.readAsStringSync(), contains('<!-- Don\'t delete the meta-data below.'));
expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below."));
});
// Tests if all of the regexp whitespace detection is working.
@@ -707,6 +707,6 @@ loading-units:
expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync().contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'), true);
expect(manifestOutput.readAsStringSync().contains(RegExp(r'android:value[\s\n]*=[\s\n]*"invalidmapping"')), false);
expect(manifestOutput.readAsStringSync().contains('<!-- Don\'t delete the meta-data below.'), true);
expect(manifestOutput.readAsStringSync().contains("<!-- Don't delete the meta-data below."), true);
});
}

View File

@@ -677,7 +677,7 @@ assembleProfile
' }\n'
'}\n'
'\n'
'Note that your app won\'t be available to users running Android SDKs below 19.\n'
"Note that your app won't be available to users running Android SDKs below 19.\n"
'Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.\n'
''
)

View File

@@ -49,7 +49,7 @@ final RegExp _bannedQuotePatterns = RegExp(r" '|' |'\.|\('|'\)|`");
final RegExp _bannedArgumentReferencePatterns = RegExp(r'[^"=]--[^ ]');
final RegExp _questionablePatterns = RegExp(r'[a-z]\.[A-Z]');
final RegExp _bannedUri = RegExp(r'\b[Uu][Rr][Ii]\b');
const String _needHelp = 'Every option must have help explaining what it does, even if it\'s '
const String _needHelp = "Every option must have help explaining what it does, even if it's "
'for testing purposes, because this is the bare minimum of '
'documentation we can add just for ourselves. If it is not intended '
'for developers, then use "hide: !verboseHelp" to only show the '

View File

@@ -243,22 +243,22 @@ void main() {
'\n'
'// @dart = 2.12\n'
'\n'
'import \'package:path_provider_example/main.dart\' as entrypoint;\n'
'import \'dart:io\'; // flutter_ignore: dart_io_import.\n'
'import \'package:path_provider_linux/path_provider_linux.dart\';\n'
"import 'package:path_provider_example/main.dart' as entrypoint;\n"
"import 'dart:io'; // flutter_ignore: dart_io_import.\n"
"import 'package:path_provider_linux/path_provider_linux.dart';\n"
'\n'
'@pragma(\'vm:entry-point\')\n'
"@pragma('vm:entry-point')\n"
'class _PluginRegistrant {\n'
'\n'
' @pragma(\'vm:entry-point\')\n'
" @pragma('vm:entry-point')\n"
' static void register() {\n'
' if (Platform.isLinux) {\n'
' try {\n'
' PathProviderLinux.registerWith();\n'
' } catch (err) {\n'
' print(\n'
' \'`path_provider_linux` threw an error: \$err. \'\n'
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n'
" '`path_provider_linux` threw an error: \$err. '\n"
" 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n'
' rethrow;\n'
' }\n'
@@ -380,22 +380,22 @@ void main() {
'\n'
'// @dart = 2.12\n'
'\n'
'import \'file:///root/external.dart\' as entrypoint;\n'
'import \'dart:io\'; // flutter_ignore: dart_io_import.\n'
'import \'package:path_provider_linux/path_provider_linux.dart\';\n'
"import 'file:///root/external.dart' as entrypoint;\n"
"import 'dart:io'; // flutter_ignore: dart_io_import.\n"
"import 'package:path_provider_linux/path_provider_linux.dart';\n"
'\n'
'@pragma(\'vm:entry-point\')\n'
"@pragma('vm:entry-point')\n"
'class _PluginRegistrant {\n'
'\n'
' @pragma(\'vm:entry-point\')\n'
" @pragma('vm:entry-point')\n"
' static void register() {\n'
' if (Platform.isLinux) {\n'
' try {\n'
' PathProviderLinux.registerWith();\n'
' } catch (err) {\n'
' print(\n'
' \'`path_provider_linux` threw an error: \$err. \'\n'
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n'
" '`path_provider_linux` threw an error: \$err. '\n"
" 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n'
' rethrow;\n'
' }\n'

View File

@@ -144,7 +144,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(),
});
testWithoutContext('DebugBundleLinuxAssets\'s name depends on target platforms', () async {
testWithoutContext("DebugBundleLinuxAssets's name depends on target platforms", () async {
expect(const DebugBundleLinuxAssets(TargetPlatform.linux_x64).name, 'debug_bundle_linux-x64_assets');
expect(const DebugBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'debug_bundle_linux-arm64_assets');
});
@@ -183,7 +183,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(),
});
testWithoutContext('ProfileBundleLinuxAssets\'s name depends on target platforms', () async {
testWithoutContext("ProfileBundleLinuxAssets's name depends on target platforms", () async {
expect(const ProfileBundleLinuxAssets(TargetPlatform.linux_x64).name, 'profile_bundle_linux-x64_assets');
expect(const ProfileBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'profile_bundle_linux-arm64_assets');
});
@@ -222,7 +222,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(),
});
testWithoutContext('ReleaseBundleLinuxAssets\'s name depends on target platforms', () async {
testWithoutContext("ReleaseBundleLinuxAssets's name depends on target platforms", () async {
expect(const ReleaseBundleLinuxAssets(TargetPlatform.linux_x64).name, 'release_bundle_linux-x64_assets');
expect(const ReleaseBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'release_bundle_linux-arm64_assets');
});

View File

@@ -246,7 +246,7 @@ void main() {
expect(pingCommandWasExecuted, true);
});
testWithoutContext('CustomDevices.discoverDevices doesn\'t report device when ping command fails', () async {
testWithoutContext("CustomDevices.discoverDevices doesn't report device when ping command fails", () async {
final MemoryFileSystem fs = MemoryFileSystem.test();
final Directory dir = fs.directory('custom_devices_config_dir');
@@ -272,7 +272,7 @@ void main() {
expect(await discovery.discoverDevices(), hasLength(0));
});
testWithoutContext('CustomDevices.discoverDevices doesn\'t report device when ping command output doesn\'t match ping success regex', () async {
testWithoutContext("CustomDevices.discoverDevices doesn't report device when ping command output doesn't match ping success regex", () async {
final MemoryFileSystem fs = MemoryFileSystem.test();
final Directory dir = fs.directory('custom_devices_config_dir');

View File

@@ -467,7 +467,7 @@ void main() {
));
expect(
testLogger.errorText,
'Plugin `url_launcher_linux_1` doesn\'t implement a plugin interface, '
"Plugin `url_launcher_linux_1` doesn't implement a plugin interface, "
'nor sets a default implementation in pubspec.yaml.\n\n'
'To set a default implementation, use:\n'
'flutter:\n'
@@ -526,7 +526,7 @@ void main() {
));
expect(
testLogger.errorText,
'Plugin `url_launcher_linux` doesn\'t implement a plugin interface, '
"Plugin `url_launcher_linux` doesn't implement a plugin interface, "
'nor sets a default implementation in pubspec.yaml.\n\n'
'To set a default implementation, use:\n'
'flutter:\n'
@@ -540,7 +540,7 @@ void main() {
' plugin:\n'
' implements: <plugin-interface>'
'\n\n'
'Plugin `url_launcher_windows` doesn\'t implement a plugin interface, '
"Plugin `url_launcher_windows` doesn't implement a plugin interface, "
'nor sets a default implementation in pubspec.yaml.\n\n'
'To set a default implementation, use:\n'
'flutter:\n'
@@ -632,25 +632,25 @@ void main() {
'\n'
'// @dart = 2.8\n'
'\n'
'import \'package:app/main.dart\' as entrypoint;\n'
'import \'dart:io\'; // flutter_ignore: dart_io_import.\n'
'import \'package:url_launcher_linux/url_launcher_linux.dart\';\n'
'import \'package:awesome_macos/awesome_macos.dart\';\n'
'import \'package:url_launcher_macos/url_launcher_macos.dart\';\n'
'import \'package:url_launcher_windows/url_launcher_windows.dart\';\n'
"import 'package:app/main.dart' as entrypoint;\n"
"import 'dart:io'; // flutter_ignore: dart_io_import.\n"
"import 'package:url_launcher_linux/url_launcher_linux.dart';\n"
"import 'package:awesome_macos/awesome_macos.dart';\n"
"import 'package:url_launcher_macos/url_launcher_macos.dart';\n"
"import 'package:url_launcher_windows/url_launcher_windows.dart';\n"
'\n'
'@pragma(\'vm:entry-point\')\n'
"@pragma('vm:entry-point')\n"
'class _PluginRegistrant {\n'
'\n'
' @pragma(\'vm:entry-point\')\n'
" @pragma('vm:entry-point')\n"
' static void register() {\n'
' if (Platform.isLinux) {\n'
' try {\n'
' LinuxPlugin.registerWith();\n'
' } catch (err) {\n'
' print(\n'
' \'`url_launcher_linux` threw an error: \$err. \'\n'
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n'
" '`url_launcher_linux` threw an error: \$err. '\n"
" 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n'
' rethrow;\n'
' }\n'
@@ -660,8 +660,8 @@ void main() {
' AwesomeMacOS.registerWith();\n'
' } catch (err) {\n'
' print(\n'
' \'`awesome_macos` threw an error: \$err. \'\n'
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n'
" '`awesome_macos` threw an error: \$err. '\n"
" 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n'
' rethrow;\n'
' }\n'
@@ -670,8 +670,8 @@ void main() {
' MacOSPlugin.registerWith();\n'
' } catch (err) {\n'
' print(\n'
' \'`url_launcher_macos` threw an error: \$err. \'\n'
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n'
" '`url_launcher_macos` threw an error: \$err. '\n"
" 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n'
' rethrow;\n'
' }\n'
@@ -681,8 +681,8 @@ void main() {
' WindowsPlugin.registerWith();\n'
' } catch (err) {\n'
' print(\n'
' \'`url_launcher_windows` threw an error: \$err. \'\n'
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n'
" '`url_launcher_windows` threw an error: \$err. '\n"
" 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n'
' rethrow;\n'
' }\n'

View File

@@ -348,7 +348,7 @@ void main() {
classNameString: defaultClassNameString,
).loadResources();
} on L10nException catch (e) {
expect(e.message, contains('The following .arb file\'s locale could not be determined'));
expect(e.message, contains("The following .arb file's locale could not be determined"));
return;
}

View File

@@ -427,7 +427,7 @@ void main() {
expect(licenseResult.dependencies, isEmpty);
expect(licenseResult.errorMessages.single,
'package foo specified an additional license at /foo.txt, but this file could not be read:'
'\nFileSystemException: Invalid UTF-8 byte, path = \'/foo.txt\'',
"\nFileSystemException: Invalid UTF-8 byte, path = '/foo.txt'",
);
});
}

View File

@@ -372,7 +372,7 @@ void main() {
final FlutterProject projectUnderTest = setupProjectUnderTest();
fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile'))
..createSync()
..writeAsStringSync('plugin_pods = parse_KV_file(\'../.flutter-plugins\')');
..writeAsStringSync("plugin_pods = parse_KV_file('../.flutter-plugins')");
await expectLater(cocoaPodsUnderTest.processPods(
xcodeProject: projectUnderTest.ios,
@@ -396,7 +396,7 @@ void main() {
projectUnderTest.macos.podfile
..createSync()
..writeAsStringSync('plugin_pods = parse_KV_file(\'../.flutter-plugins\')');
..writeAsStringSync("plugin_pods = parse_KV_file('../.flutter-plugins')");
projectUnderTest.macos.podfileLock
..createSync()
..writeAsStringSync('Existing lock file.');

View File

@@ -915,7 +915,7 @@ flutter:
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('pluginClass: none doesn\'t trigger registrant entry on macOS', () async {
testUsingContext("pluginClass: none doesn't trigger registrant entry on macOS", () async {
flutterProject.isModule = true;
// Create a plugin without a pluginClass.
final Directory pluginDirectory = createFakePlugin(fs);
@@ -997,7 +997,7 @@ flutter:
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('pluginClass: none doesn\'t trigger registrant entry on Linux', () async {
testUsingContext("pluginClass: none doesn't trigger registrant entry on Linux", () async {
// Create a plugin without a pluginClass.
final Directory pluginDirectory = createFakePlugin(fs);
pluginDirectory.childFile('pubspec.yaml').writeAsStringSync('''
@@ -1100,7 +1100,7 @@ flutter:
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('pluginClass: none doesn\'t trigger registrant entry on Windows', () async {
testUsingContext("pluginClass: none doesn't trigger registrant entry on Windows", () async {
// Create a plugin without a pluginClass.
final Directory pluginDirectory = createFakePlugin(fs);
pluginDirectory.childFile('pubspec.yaml').writeAsStringSync('''

View File

@@ -39,7 +39,7 @@ void main() {
templateDir.childFile('$imageName.img.tmpl').createSync(recursive: true);
final File sourceImage = imageSourceDir.childFile(imageName);
sourceImage.createSync(recursive: true);
sourceImage.writeAsStringSync('Ceci n\'est pas une pipe');
sourceImage.writeAsStringSync("Ceci n'est pas une pipe");
final Template template = Template(
templateDir,

View File

@@ -441,7 +441,7 @@ void main() {
command: args,
stderr: 'Inconsistency detected by ld.so: ../elf/dl-tls.c: 493: '
'_dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen '
'<= GL(dl_tls_generation)\' failed!',
"<= GL(dl_tls_generation)' failed!",
));
}

View File

@@ -52,7 +52,7 @@ void main() {
await expressionCompiler.compileExpressionToJs(
null, null, 1, 1, null, null, null, 'a');
expectResult(result, true, 'InternalError: frontend server failed to compile \'a\'');
expectResult(result, true, "InternalError: frontend server failed to compile 'a'");
});
}

View File

@@ -93,7 +93,7 @@ void main() {
'#l10n 38 (Hello for 123)\n'
'#l10n 39 (Hello for price USD123.00)\n'
'#l10n 40 (Hello for price BTC0.50 (with optional param))\n'
'#l10n 41 (Hello for price BTC\'0.50 (with special character))\n'
"#l10n 41 (Hello for price BTC'0.50 (with special character))\n"
'#l10n 42 (Hello for price BTC"0.50 (with special character))\n'
'#l10n 43 (Hello for price BTC"\'0.50 (with special character))\n'
'#l10n 44 (Hello for Decimal Pattern 1,200,000)\n'
@@ -114,8 +114,8 @@ void main() {
'#l10n 59 ([Hello] -World- #123#)\n'
'#l10n 60 (\$!)\n'
'#l10n 61 (One \$)\n'
'#l10n 62 (Flutter\'s amazing!)\n'
'#l10n 63 (Flutter\'s amazing, times 2!)\n'
"#l10n 62 (Flutter's amazing!)\n"
"#l10n 63 (Flutter's amazing, times 2!)\n"
'#l10n 64 (Flutter is "amazing"!)\n'
'#l10n 65 (Flutter is "amazing", times 2!)\n'
'#l10n 66 (--- es ---)\n'
@@ -143,8 +143,8 @@ void main() {
'#l10n 88 (ES - [Hola] -Mundo- #123#)\n'
'#l10n 89 (ES - \$!)\n'
'#l10n 90 (ES - One \$)\n'
'#l10n 91 (ES - Flutter\'s amazing!)\n'
'#l10n 92 (ES - Flutter\'s amazing, times 2!)\n'
"#l10n 91 (ES - Flutter's amazing!)\n"
"#l10n 92 (ES - Flutter's amazing, times 2!)\n"
'#l10n 93 (ES - Flutter is "amazing"!)\n'
'#l10n 94 (ES - Flutter is "amazing", times 2!)\n'
'#l10n 95 (--- es_419 ---)\n'

View File

@@ -103,7 +103,7 @@ Future<void> pollForServiceExtensionValue<T>({
}
}
fail(
'Did not find expected value for service extension \'$extension\'. All call'
' attempts responded with \'$continuePollingValue\'.',
"Did not find expected value for service extension '$extension'. All call"
" attempts responded with '$continuePollingValue'.",
);
}

View File

@@ -55,6 +55,6 @@ void main() {
});
expect(result.exitCode, 1);
expect(result.stderr, contains('ERROR: Requested build with Flutter local engine at \'release_foo_bar\''));
expect(result.stderr, contains("ERROR: Requested build with Flutter local engine at 'release_foo_bar'"));
});
}

View File

@@ -191,7 +191,7 @@ Future<void> checkStaticScope(FlutterTestDriver flutter) async {
Future<void> evaluateErrorExpressions(FlutterTestDriver flutter) async {
final ObjRef res = await flutter.evaluateInFrame('typo');
expectError(res, 'CompilationError: Getter not found: \'typo\'.\ntypo\n^^^^');
expectError(res, "CompilationError: Getter not found: 'typo'.\ntypo\n^^^^");
}
Future<void> evaluateTrivialExpressions(FlutterTestDriver flutter) async {

View File

@@ -16,7 +16,7 @@ void main() {
}
final RegExp globalImport = RegExp(r"import.*(?:globals|globals_null_migrated)\.dart' as globals;");
final RegExp globalNullUnsafeImport = RegExp('import.*globals.dart\' as globals;');
final RegExp globalNullUnsafeImport = RegExp("import.*globals.dart' as globals;");
void countGlobalImports(Directory directory) {
int count = 0;