report static method

void report(
  1. String path, {
  2. GoldenReporter reporter = const GithubGoldenReporter(),
})

Implementation

static void report(String path,
    {GoldenReporter reporter = const GithubGoldenReporter()}) {
  final modifiedFileMessages = danger.git.modifiedFiles
      .where(
          (element) => element.startsWith(path) && element.endsWith('.png'))
      .map((e) => reporter.reportForModifiedFile(e));

  final createdFileMessages = danger.git.createdFiles
      .where(
          (element) => element.startsWith(path) && element.endsWith('.png'))
      .map((e) => reporter.reportForCreatedFile(e));

  if (modifiedFileMessages.isNotEmpty) {
    reporter.reportAllModifiedFiles(modifiedFileMessages.toList());
  }

  if (createdFileMessages.isNotEmpty) {
    reporter.reportAllCreatedFiles(createdFileMessages.toList());
  }
}