Skip to content

Commit

Permalink
Add a space between icons and text.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Mar 23, 2024
1 parent bf493b1 commit 8d37cb5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/main/java/edu/hm/hafner/grading/GradingReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ public String getMarkdownDetails(final AggregatedScore score, final String title

private String createMarkdownTotal(final AggregatedScore score, final String title, final int size) {
if (score.getMaxScore() == 0) {
return "#".repeat(size) + " :sunny: " + title;
return "#".repeat(size) + " :sunny:   " + title;
}
return "#".repeat(size) + " :mortar_board: " + createTotal(score, title);
return "#".repeat(size) + " :mortar_board:   " + createTotal(score, title);
}

private String createTotal(final AggregatedScore score, final String title) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/hm/hafner/grading/ScoreMarkdown.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public String createSummary(final AggregatedScore aggregation) {

protected String getTitle(final S score, final int size) {
return "#".repeat(size)
+ String.format(" :%s: %s", getIcon(score), score.getName())
+ String.format(" :%s:   %s", getIcon(score), score.getName())
+ createScoreTitle(score);
}

Expand Down
10 changes: 5 additions & 5 deletions src/test/java/edu/hm/hafner/grading/AnalysisMarkdownTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void shouldShowScoreWithOneResult() {
var analysisMarkdown = new AnalysisMarkdown();

assertThat(analysisMarkdown.createSummary(score)).startsWith(
"- :warning: CheckStyle - 70 of 100: 10 warnings found (1 error, 2 high, 3 normal, 4 low)");
"- :warning:   CheckStyle - 70 of 100: 10 warnings found (1 error, 2 high, 3 normal, 4 low)");
assertThat(analysisMarkdown.createDetails(score))
.contains("CheckStyle - 70 of 100")
.contains("|CheckStyle 1|1|1|2|3|4|10|-30")
Expand Down Expand Up @@ -124,7 +124,7 @@ void shouldShowScoreWithTwoSubResults() {
var analysisMarkdown = new AnalysisMarkdown();

assertThat(analysisMarkdown.createSummary(score))
.startsWith("- :warning: CheckStyle - 50 of 100: 20 warnings found (5 errors, 5 high, 5 normal, 5 low)");
.startsWith("- :warning:   CheckStyle - 50 of 100: 20 warnings found (5 errors, 5 high, 5 normal, 5 low)");
assertThat(analysisMarkdown.createDetails(score))
.contains("CheckStyle - 50 of 100",
"|CheckStyle|1|1|2|3|4|10|-30",
Expand Down Expand Up @@ -159,7 +159,7 @@ void shouldShowNoImpactsWithTwoSubResults() {
var analysisMarkdown = new AnalysisMarkdown();

assertThat(analysisMarkdown.createSummary(score))
.startsWith("- :warning: CheckStyle: 20 warnings found (5 errors, 5 high, 5 normal, 5 low)");
.startsWith("- :warning:   CheckStyle: 20 warnings found (5 errors, 5 high, 5 normal, 5 low)");
assertThat(analysisMarkdown.createDetails(score))
.contains("CheckStyle",
"|CheckStyle|1|1|2|3|4|10",
Expand Down Expand Up @@ -213,8 +213,8 @@ void shouldShowScoreWithTwoResults() {
":moneybag:|:heavy_minus_sign:|*1*|*2*|*3*|*4*|:heavy_minus_sign:|:heavy_minus_sign:",
":moneybag:|:heavy_minus_sign:|*-11*|*-12*|*-13*|*-14*|:heavy_minus_sign:|:heavy_minus_sign:");
assertThat(analysisMarkdown.createSummary(score))
.contains("- :warning: Style - 60 of 100: 20 warnings found (2 errors, 4 high, 6 normal, 8 low)",
"- :warning: Bugs - 0 of 100: 20 warnings found (8 errors, 6 high, 4 normal, 2 low)")
.contains("- :warning:   Style - 60 of 100: 20 warnings found (2 errors, 4 high, 6 normal, 8 low)",
"- :warning:   Bugs - 0 of 100: 20 warnings found (8 errors, 6 high, 4 normal, 2 low)")
.doesNotContain("Total");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public List<String> getComments() {
@Override @SuppressWarnings("checkstyle:ParameterNumber")
protected void createComment(final CommentType commentType, final String relativePath, final int lineStart, final int lineEnd,
final String message, final String title,
final int columnStart, final int columnEnd, final String details) {
final int columnStart, final int columnEnd, final String details, final String markDownDetails) {
comments.add(String.format("[%s] %s:%d-%d: %s (%s)", commentType.name(), relativePath, lineStart, lineEnd, message, title));
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/edu/hm/hafner/grading/CoverageMarkdownTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void shouldShowMaximumScore() {
.contains("Code Coverage - 100 of 100", "|JaCoCo|100|0|100", IMPACT_CONFIGURATION)
.doesNotContain("Total");
assertThat(codeCoverageMarkdown.createSummary(score))
.startsWith("- :footprints: Code Coverage - 100 of 100: 100% coverage achieved");
.startsWith("- :footprints: &nbsp; Code Coverage - 100 of 100: 100% coverage achieved");

assertThat(new MutationCoverageMarkdown().createDetails(score)).contains(
"Mutation Coverage Score: not enabled");
Expand Down Expand Up @@ -97,7 +97,7 @@ void shouldShowScoreWithOneResult() {
.contains("Code Coverage - 20 of 100", "|JaCoCo|60|40|20", IMPACT_CONFIGURATION)
.doesNotContain("Total");
assertThat(codeCoverageMarkdown.createSummary(score))
.startsWith("- :footprints: Code Coverage - 20 of 100: 60% coverage achieved");
.startsWith("- :footprints: &nbsp; Code Coverage - 20 of 100: 60% coverage achieved");
assertThat(new MutationCoverageMarkdown().createDetails(score)).contains(
"Mutation Coverage Score: not enabled");
}
Expand Down Expand Up @@ -146,7 +146,7 @@ void shouldShowScoreWithTwoSubResults() {
"|**Total Ø**|**70**|**30**|**40**",
IMPACT_CONFIGURATION);
assertThat(codeCoverageMarkdown.createSummary(score)).startsWith(
"- :footprints: Code Coverage - 40 of 100: 70% coverage achieved");
"- :footprints: &nbsp; Code Coverage - 40 of 100: 70% coverage achieved");
assertThat(new MutationCoverageMarkdown().createDetails(score)).contains(
"Mutation Coverage Score: not enabled");
}
Expand Down Expand Up @@ -186,7 +186,7 @@ void shouldShowNoImpactsWithTwoSubResults() {
.doesNotContain(IMPACT_CONFIGURATION)
.doesNotContain("Impact");
assertThat(codeCoverageMarkdown.createSummary(score)).startsWith(
"- :footprints: Code Coverage: 70% coverage achieved");
"- :footprints: &nbsp; Code Coverage: 70% coverage achieved");
assertThat(new MutationCoverageMarkdown().createDetails(score)).contains(
"Mutation Coverage Score: not enabled");
}
Expand Down Expand Up @@ -246,14 +246,14 @@ void shouldShowScoreWithTwoResults() {
IMPACT_CONFIGURATION)
.doesNotContain("Mutation Coverage", "PIT");
assertThat(codeCoverageMarkdown.createSummary(score)).startsWith(
"- :footprints: JaCoCo - 40 of 100: 70% coverage achieved");
"- :footprints: &nbsp; JaCoCo - 40 of 100: 70% coverage achieved");

var mutationCoverageMarkdown = new MutationCoverageMarkdown();
assertThat(mutationCoverageMarkdown.createDetails(score)).contains(
"PIT - 20 of 100", IMPACT_CONFIGURATION)
.doesNotContain("JaCoCo", "Line Coverage", "Branch Coverage", "Total");
assertThat(mutationCoverageMarkdown.createSummary(score)).contains(
"- :microscope: PIT - 20 of 100: 60% mutations killed");
"- :microscope: &nbsp; PIT - 20 of 100: 60% mutations killed");
}

static ModuleNode createTwoReports(final ToolConfiguration tool) {
Expand Down
20 changes: 10 additions & 10 deletions src/test/java/edu/hm/hafner/grading/GradingReportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void shouldCreateAllResults() {
assertThat(results.getMarkdownSummary(score, "Summary")).contains(
"img title=\"Score percentage: 33%\"",
"percentages/033.svg",
"# :mortar_board: Summary - 167 of 500",
"# :mortar_board: &nbsp; Summary - 167 of 500",
"JUnit - 77 of 100",
"14 tests failed, 5 passed, 3 skipped",
"JaCoCo - 40 of 100",
Expand All @@ -130,10 +130,10 @@ void shouldCreateAllResults() {
"title=\"PIT: 20%\"",
"Style - 30 of 100",
"title=\"Style: 30%\"",
":warning: Style",
":warning: &nbsp; Style",
"Bugs - 0 of 100",
"title=\"Bugs: 0%\"",
":bug: Bugs");
":bug: &nbsp; Bugs");
}

@Test
Expand Down Expand Up @@ -203,18 +203,18 @@ void shouldSkipScores() {
entry("spotbugs", 10));

assertThat(results.getMarkdownSummary(aggregation, "Summary")).contains(
"### :sunny: Summary",
"- :vertical_traffic_light: JUnit: 14 tests failed, 5 passed, 3 skipped",
"- :footprints: JaCoCo: 70% coverage achieved",
"- :microscope: PIT: 60% mutations killed",
"- :warning: Style: 10 warnings found (1 error, 2 high, 3 normal, 4 low)",
"- :bug: Bugs: 10 warnings found (4 errors, 3 high, 2 normal, 1 low)");
"### :sunny: &nbsp; Summary",
"- :vertical_traffic_light: &nbsp; JUnit: 14 tests failed, 5 passed, 3 skipped",
"- :footprints: &nbsp; JaCoCo: 70% coverage achieved",
"- :microscope: &nbsp; PIT: 60% mutations killed",
"- :warning: &nbsp; Style: 10 warnings found (1 error, 2 high, 3 normal, 4 low)",
"- :bug: &nbsp; Bugs: 10 warnings found (4 errors, 3 high, 2 normal, 1 low)");
assertThat(results.getTextSummary(aggregation)).isEqualTo(
"Autograding score");
assertThat(results.getTextSummary(aggregation, "Quality Summary")).isEqualTo(
"Quality Summary");
assertThat(results.getMarkdownDetails(aggregation, "Quality Summary")).contains(
"# :sunny: Quality Summary",
"# :sunny: &nbsp; Quality Summary",
"JUnit",
"JaCoCo",
"title=\"JaCoCo: 70%\"",
Expand Down

0 comments on commit 8d37cb5

Please sign in to comment.