Unverified Commit eab2087a authored by Alex Li's avatar Alex Li Committed by GitHub

🐛 Only format Dart files for `gen-l10n` (#131232)

Improves #119596. The tests remain valid, so no tests were updated in the request.

This does not resolve issue #128932, it's handled by another part of the code.
parent e099d67c
......@@ -80,15 +80,11 @@ Future<LocalizationsGenerator> generateLocalizations({
throwToolExit(e.message);
}
final List<String> outputFileList = generator.outputFileList;
final File? untranslatedMessagesFile = generator.untranslatedMessagesFile;
if (options.format) {
final List<String> formatFileList = outputFileList.toList();
if (untranslatedMessagesFile != null) {
// Don't format the messages file using `dart format`.
formatFileList.remove(untranslatedMessagesFile.absolute.path);
}
// Only format Dart files using `dart format`.
final List<String> formatFileList = generator.outputFileList
.where((String e) => e.endsWith('.dart'))
.toList(growable: false);
if (formatFileList.isEmpty) {
return generator;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment