refactor: formatting

This commit is contained in:
cogwheel0
2025-09-24 12:00:49 +05:30
parent b8c024d0b0
commit 5f013b1b73
27 changed files with 158 additions and 121 deletions

View File

@@ -56,12 +56,16 @@ Future<void> main(List<String> args) async {
if (trPh == null) {
// If string exists but no meta placeholders, warn only.
if (keys.contains(k) && basePh.isNotEmpty) {
warnings.add('[${f.path}] Key "$k" missing @meta placeholders; base has ${basePh.toList()..sort()}');
warnings.add(
'[${f.path}] Key "$k" missing @meta placeholders; base has ${basePh.toList()..sort()}',
);
}
continue;
}
if (basePh.length != trPh.length || !basePh.containsAll(trPh)) {
warnings.add('[${f.path}] Placeholder mismatch for "$k": expected ${basePh.toList()..sort()}, got ${trPh.toList()..sort()}');
warnings.add(
'[${f.path}] Placeholder mismatch for "$k": expected ${basePh.toList()..sort()}, got ${trPh.toList()..sort()}',
);
}
}
}
@@ -96,9 +100,7 @@ Map<String, dynamic> _readJson(File f) {
}
Set<String> _nonMetaKeys(Map<String, dynamic> m) {
return m.keys
.where((k) => !k.startsWith('@') && k != '@@locale')
.toSet();
return m.keys.where((k) => !k.startsWith('@') && k != '@@locale').toSet();
}
Map<String, Set<String>> _placeholdersMap(Map<String, dynamic> m) {

View File

@@ -42,7 +42,9 @@ Future<void> main() async {
}
if (missingMeta.isEmpty && missingDescription.isEmpty) {
stdout.writeln('ARB descriptions check passed: all keys have @meta.description.');
stdout.writeln(
'ARB descriptions check passed: all keys have @meta.description.',
);
return;
}
@@ -53,11 +55,12 @@ Future<void> main() async {
}
}
if (missingDescription.isNotEmpty) {
stderr.writeln('Missing description in @meta for keys (${missingDescription.length}):');
stderr.writeln(
'Missing description in @meta for keys (${missingDescription.length}):',
);
for (final k in missingDescription) {
stderr.writeln(' - $k');
}
}
exit(1);
}