run method

  1. @override
void run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
void run() async {
  print('Checking unused l10n');

  Set<String> notUsed = getTranslationTerms();

  await ModularHelper.runSequence((path) {
    final dartFiles = find('lib/**.dart', workingDirectory: path).toList();
    notUsed = findNotUsedArbTerms(notUsed, dartFiles);
    stdout.writeln('.');
  });

  print('Total unused: ${notUsed.length}');
  if (notUsed.isNotEmpty) print('---------------------------');
  for (final t in notUsed) {
    print(t);
  }

  StatusHelper.success('unused-l10n');
}