Skip to content

Commit f682ed9

Browse files
committed
ignore gradle lint return code
1 parent f4d5fc9 commit f682ed9

File tree

7 files changed

+35
-6
lines changed

7 files changed

+35
-6
lines changed

dist/grading/types.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pawtograder.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"additionalProperties": false,
3232
"properties": {
3333
"policy": {
34-
"enum": ["fail", "warn", "ignore"],
34+
"enum": ["fail", "ignore"],
3535
"type": "string"
3636
},
3737
"preset": {

src/grading/builders/GradleBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default class GradleBuilder extends Builder {
3232
],
3333
this.logger
3434
)
35-
if (returnCode !== 0) {
35+
if (returnCode !== 0 && returnCode !== 130) {
3636
throw new Error(
3737
`Unable to invoke Gradle checkstyle task. Here is the output that Gradle produced on the grading server: ${output}`
3838
)

src/grading/graders/OverlayGrader.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,22 @@ export class OverlayGrader extends Grader<OverlayPawtograderConfig> {
296296

297297
console.log('Linting student submission')
298298
const lintResult = await this.builder.lint()
299+
if (this.config.build.linter?.policy === 'fail') {
300+
if (lintResult.status === 'fail') {
301+
this.logger.log(
302+
'visible',
303+
`Linting failed, submission can not be graded. Please fix the above errors below and resubmit. This submission will not count towards any submisison limits (if applicable for this assignment).`
304+
)
305+
this.logger.log('visible', lintResult.output)
306+
return {
307+
lint: lintResult,
308+
output: this.logger.getEachOutput(),
309+
tests: [],
310+
score: 0,
311+
artifacts: []
312+
}
313+
}
314+
}
299315

300316
console.log('Resetting to run instructor tests on student submission')
301317
await this.resetSolutionFiles()

src/grading/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface BuildConfig {
3535
artifacts?: GraderArtifact[]
3636
linter?: {
3737
preset: 'checkstyle'
38-
policy: 'fail' | 'warn' | 'ignore'
38+
policy: 'fail' | 'ignore'
3939
}
4040
student_tests?: {
4141
student_impl?: {

0 commit comments

Comments
 (0)