From a2a37bf2316b64b40bbcd3848d4129e2173a6ae4 Mon Sep 17 00:00:00 2001 From: nicklem Date: Tue, 23 Jan 2024 14:49:48 +0100 Subject: [PATCH 1/3] doc: Error messages --- src/main/scala/com/codacy/rules/ReportRules.scala | 2 +- .../com/codacy/transformation/GitFileNameUpdaterAndFilter.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/codacy/rules/ReportRules.scala b/src/main/scala/com/codacy/rules/ReportRules.scala index 72069ab3..5083874a 100644 --- a/src/main/scala/com/codacy/rules/ReportRules.scala +++ b/src/main/scala/com/codacy/rules/ReportRules.scala @@ -120,7 +120,7 @@ class ReportRules(coverageServices: => CoverageServices, gitFileFetcher: GitFile */ private[rules] def storeReport(report: CoverageReport, file: File) = { if (report.fileReports.isEmpty) - Left(s"The provided coverage report ${file.getAbsolutePath} generated an empty result.") + Left(s"The provided coverage report ${file.getAbsolutePath} is empty or contains no data for repository files.") else { val codacyReportFile = File.createTempFile("codacy-coverage-", ".json") diff --git a/src/main/scala/com/codacy/transformation/GitFileNameUpdaterAndFilter.scala b/src/main/scala/com/codacy/transformation/GitFileNameUpdaterAndFilter.scala index e80fe653..ddc07958 100644 --- a/src/main/scala/com/codacy/transformation/GitFileNameUpdaterAndFilter.scala +++ b/src/main/scala/com/codacy/transformation/GitFileNameUpdaterAndFilter.scala @@ -19,7 +19,7 @@ class GitFileNameUpdaterAndFilter(acceptableFileNames: Seq[String]) extends Tran if (maybeFilename.isEmpty) logger - .warn(s"File: $filename will be discarded and will not be considered for coverage calculation") + .warn(s"File: Ignoring $filename for coverage calculation, no matching file found in the repository.") maybeFilename } From dc646c0ac579e258d0001e3cca8b78e3d5c207c2 Mon Sep 17 00:00:00 2001 From: nicklem Date: Tue, 23 Jan 2024 15:13:03 +0100 Subject: [PATCH 2/3] doc: Error message tweaks --- src/main/scala/com/codacy/rules/ReportRules.scala | 2 +- .../com/codacy/transformation/GitFileNameUpdaterAndFilter.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/codacy/rules/ReportRules.scala b/src/main/scala/com/codacy/rules/ReportRules.scala index 5083874a..c155510c 100644 --- a/src/main/scala/com/codacy/rules/ReportRules.scala +++ b/src/main/scala/com/codacy/rules/ReportRules.scala @@ -120,7 +120,7 @@ class ReportRules(coverageServices: => CoverageServices, gitFileFetcher: GitFile */ private[rules] def storeReport(report: CoverageReport, file: File) = { if (report.fileReports.isEmpty) - Left(s"The provided coverage report ${file.getAbsolutePath} is empty or contains no data for repository files.") + Left(s"The uploaded coverage report ${file.getAbsolutePath} is empty or contains no data for repository files.") else { val codacyReportFile = File.createTempFile("codacy-coverage-", ".json") diff --git a/src/main/scala/com/codacy/transformation/GitFileNameUpdaterAndFilter.scala b/src/main/scala/com/codacy/transformation/GitFileNameUpdaterAndFilter.scala index ddc07958..0b9cb32b 100644 --- a/src/main/scala/com/codacy/transformation/GitFileNameUpdaterAndFilter.scala +++ b/src/main/scala/com/codacy/transformation/GitFileNameUpdaterAndFilter.scala @@ -19,7 +19,7 @@ class GitFileNameUpdaterAndFilter(acceptableFileNames: Seq[String]) extends Tran if (maybeFilename.isEmpty) logger - .warn(s"File: Ignoring $filename for coverage calculation, no matching file found in the repository.") + .warn(s"File: Ignoring $filename for coverage calculation. No matching file found in the repository.") maybeFilename } From 1b347d3d8b1094fd51c611f5c12d546c08312f24 Mon Sep 17 00:00:00 2001 From: Nicola Klemenc Date: Tue, 23 Jan 2024 16:05:39 +0100 Subject: [PATCH 3/3] feat: Apply review suggestion --- src/main/scala/com/codacy/rules/ReportRules.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/com/codacy/rules/ReportRules.scala b/src/main/scala/com/codacy/rules/ReportRules.scala index c155510c..b0a9134c 100644 --- a/src/main/scala/com/codacy/rules/ReportRules.scala +++ b/src/main/scala/com/codacy/rules/ReportRules.scala @@ -120,7 +120,7 @@ class ReportRules(coverageServices: => CoverageServices, gitFileFetcher: GitFile */ private[rules] def storeReport(report: CoverageReport, file: File) = { if (report.fileReports.isEmpty) - Left(s"The uploaded coverage report ${file.getAbsolutePath} is empty or contains no data for repository files.") + Left(s"The generated coverage report ${file.getAbsolutePath} is empty or contains no data for repository files.") else { val codacyReportFile = File.createTempFile("codacy-coverage-", ".json")