Skip to content

Commit

Permalink
fix(action): support preset checkers
Browse files Browse the repository at this point in the history
  • Loading branch information
Molmin committed Feb 7, 2024
1 parent 4b23dff commit 82e4a15
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hydrooj-problem-transmission/src/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import HydroAccountService from './basic/service'
import { SecretConfig } from './basic/secret'
import { Queue } from './queue'

const presetCheckers = [
'acmp', 'caseicmp', 'casencmp', 'casewcmp', 'dcmp', 'fcmp', 'hcmp',
'icmp', 'lcmp', 'ncmp', 'nyesno', 'pointscmp', 'pointsinfo',
'rcmp', 'rcmp4', 'rcmp6', 'rcmp9', 'rncmp', 'uncmp', 'wcmp', 'yesno',
]

interface SubtaskConfig {
id: number
if: number[]
Expand Down Expand Up @@ -170,7 +176,7 @@ function checkJudgeConfig(config: JudgeConfig, pid: string) {
}
}
}
if (config.checker) {
if (config.checker && !presetCheckers.includes(config.checker)) {
if (config.checker !== 'checker.cc')
throwError(pid, `Checker file must be 'checker.cc'.`)
data[pid].testdata.push(config.checker)
Expand Down

0 comments on commit 82e4a15

Please sign in to comment.