change quote to avoid escapes (#50368)

This commit is contained in:
Alexandre Ardhuin
2020-02-11 20:58:27 +01:00
committed by GitHub
parent fd1062debd
commit f15c887c63
171 changed files with 362 additions and 362 deletions

View File

@@ -73,7 +73,7 @@ Future<void> main(List<String> arguments) async {
final StringBuffer contents = StringBuffer('library temp_doc;\n\n');
for (final String libraryRef in libraryRefs()) {
contents.writeln('import \'package:$libraryRef\';');
contents.writeln("import 'package:$libraryRef';");
}
File('$kDocsRoot/lib/temp_doc.dart').writeAsStringSync(contents.toString());

View File

@@ -52,7 +52,7 @@ void main(List<String> args) {
kJustPrint,
negatable: false,
help:
'Don\'t actually roll the dev channel; '
"Don't actually roll the dev channel; "
'just print the would-be version and quit.',
);
argParser.addFlag(kYes, negatable: false, abbr: 'y', help: 'Skip the confirmation prompt.');

View File

@@ -53,7 +53,7 @@ Future<void> main(List<String> arguments) async {
'By default, the tool will generate the supported locales list in '
'alphabetical order. Use this flag if you would like to default to '
'a different locale. \n\n'
'For example, pass in [\'en_US\'] if you would like your app to '
"For example, pass in ['en_US'] if you would like your app to "
'default to American English if a device supports it.',
);

View File

@@ -126,7 +126,7 @@ const Set<String> numberFormatsWithNamedParameters = <String>{
};
List<String> generateIntlMethodArgs(Message message) {
final List<String> methodArgs = <String>['name: \'${message.resourceId}\''];
final List<String> methodArgs = <String>["name: '${message.resourceId}'"];
if (message.description != null)
methodArgs.add('desc: ${generateString(message.description)}');
if (message.placeholders.isNotEmpty) {
@@ -159,7 +159,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.'
);
}
@@ -167,7 +167,7 @@ String generateDateFormattingLogic(Message message) {
throw L10nException(
'Date format "${placeholder.format}" 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.'
);
}
@@ -192,7 +192,7 @@ String generateNumberFormattingLogic(Message message) {
throw L10nException(
'Number format ${placeholder.format} 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.'
);
}
@@ -584,14 +584,14 @@ class LocalizationsGenerator {
arbPathStrings.sort();
localeInfoList.sort();
supportedLanguageCodes.addAll(localeInfoList.map((LocaleInfo localeInfo) {
return '\'${localeInfo.languageCode}\'';
return "'${localeInfo.languageCode}'";
}));
if (preferredSupportedLocales != null) {
for (final LocaleInfo preferredLocale in preferredSupportedLocales) {
if (!localeInfoList.contains(preferredLocale)) {
throw L10nException(
'The preferred supported locale, \'$preferredLocale\', cannot be '
"The preferred supported locale, '$preferredLocale', cannot be "
'added. Please make sure that there is a corresponding arb file '
'with translations for the locale, or remove the locale from the '
'preferred supported locale list if there is no intent to support '
@@ -631,9 +631,9 @@ class LocalizationsGenerator {
final String languageCode = locale.languageCode;
final String countryCode = locale.countryCode;
resultingProperty += '\'$languageCode\'';
resultingProperty += "'$languageCode'";
if (countryCode != null)
resultingProperty += ', \'$countryCode\'';
resultingProperty += ", '$countryCode'";
resultingProperty += '),\n Locale(';
}
resultingProperty = resultingProperty.substring(0, resultingProperty.length - '),\n Locale('.length);

View File

@@ -518,7 +518,7 @@ void main() {
expect(generator.supportedLocales.contains(LocaleInfo.fromString('am')), false);
});
test('throws when arb file\'s locale could not be determined', () {
test("throws when arb file's locale could not be determined", () {
fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
..createSync(recursive: true)
..childFile('app.arb')

View File

@@ -18,7 +18,7 @@ void main(List<String> args) {
'help',
abbr: 'h',
negatable: false,
help: 'Display the tool\'s usage instructions and quit.',
help: "Display the tool's usage instructions and quit.",
);
parser.addOption(
@@ -36,7 +36,7 @@ void main(List<String> args) {
parser.addOption(
'part-of',
abbr: 'p',
help: 'Library name to add a dart \'part of\' clause for.',
help: "Library name to add a dart 'part of' clause for.",
);
parser.addOption(

View File

@@ -88,8 +88,8 @@ class PathAnimation {
if (commandType != currentCommandType)
throw Exception(
'Paths must be built from the same commands in all frames '
'command $commandIdx at frame 0 was of type \'$commandType\' '
'command $commandIdx at frame $i was of type \'$currentCommandType\''
"command $commandIdx at frame 0 was of type '$commandType' "
"command $commandIdx at frame $i was of type '$currentCommandType'"
);
for (int j = 0; j < numPointsInCommand; j += 1)
points[j].add(frame.paths[pathIdx].commands[commandIdx].points[j]);
@@ -529,7 +529,7 @@ final RegExp _pixelsExp = RegExp(r'^([0-9]+)px$');
int parsePixels(String pixels) {
if (!_pixelsExp.hasMatch(pixels))
throw ArgumentError(
'illegal pixels expression: \'$pixels\''
"illegal pixels expression: '$pixels'"
' (the tool currently only support pixel units).');
return int.parse(_pixelsExp.firstMatch(pixels).group(1));
}
@@ -540,7 +540,7 @@ String _extractAttr(XmlElement element, String name) {
.value;
} catch (e) {
throw ArgumentError(
'Can\'t find a single \'$name\' attributes in ${element.name}, '
"Can't find a single '$name' attributes in ${element.name}, "
'attributes were: ${element.attributes}'
);
}