🐛 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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user