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({ ...@@ -80,15 +80,11 @@ Future<LocalizationsGenerator> generateLocalizations({
throwToolExit(e.message); throwToolExit(e.message);
} }
final List<String> outputFileList = generator.outputFileList;
final File? untranslatedMessagesFile = generator.untranslatedMessagesFile;
if (options.format) { if (options.format) {
final List<String> formatFileList = outputFileList.toList(); // Only format Dart files using `dart format`.
if (untranslatedMessagesFile != null) { final List<String> formatFileList = generator.outputFileList
// Don't format the messages file using `dart format`. .where((String e) => e.endsWith('.dart'))
formatFileList.remove(untranslatedMessagesFile.absolute.path); .toList(growable: false);
}
if (formatFileList.isEmpty) { if (formatFileList.isEmpty) {
return generator; 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