IECQ002: score_constants¶
Score() values use the CORRECT/INCORRECT constants, not string literals.
Category: code_quality ยท Applies to: eval, helper
What it does¶
Flags Score(value="C") and the other literals "I", "CORRECT" and "INCORRECT". One diagnostic per call.
Why is this bad?¶
inspect_ai's metrics compare against the constants. A literal that drifts from them, or that inspect_ai later changes, scores silently wrong.
Example¶
return Score(value="C")
Use instead:
from inspect_ai.scorer import CORRECT
return Score(value=CORRECT)
Suppress on a line with # inspect-evals-lint: ignore[IECQ002] or ignore[score_constants]; select or ignore it in configuration by either, or by the prefix IECQ.