Skip to content

Commit 0bb196a

Browse files
committed
Fixed checkstyle so it reads weight from config file.
1 parent 7f56f92 commit 0bb196a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/chalkbox/java/checkstyle/Checkstyle.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ public Collection run(Collection collection) {
199199
// Subtract 2 for header/footer lines.
200200
int numViolations = Math.max(0, checkstyleOutput.split("\n").length - 2);
201201

202-
int grade = Math.max(0, 10 - numViolations);
202+
int grade = Math.max(0, options.weighting - numViolations);
203203

204204
result.set("score", grade);
205-
result.set("max_score", 10);
205+
result.set("max_score", options.weighting);
206206

207207
String formattedOutput = Arrays.stream(checkstyleOutput.split("\n"))
208208
.filter(n -> !n.contains("Starting audit") && !n.contains("Audit done"))

0 commit comments

Comments
 (0)