Add unit-test to ensure all validator subclasses are annotated with @GtfsValidator #1262
Labels
enhancement
New feature request or improvement on an existing feature
status: Needs triage
Applied to all new issues
Describe the problem
When implementing a new validation rule, I forgot to annotate my validator with the
@GtfsValidator
annotation. This meant it wasn't picked up automatically byValidatorLoader
and not run as part of the default validation set, even though individual unit-tests for this validator ran successfully.Proposed solution
Add a unit-test that checks that any subclass of
SingleEntityValidator
orFileValidator
is also annotated with@GtfsValidator
.Alternatives you've considered
We could alternatively rewrite
ValidatorLoader
to ignore the@GtfsValidator
annotation and instead scan for subclasses directly. I'll admit I wasn't around for the original design choice, but I could see an argument for having a single annotation type across all validators, regardless of subclass, especially if the validator subclasses grows in the future. Either way, given current staffing on the project, I'm in favor of keeping the status quo for now.Additional context
No response
The text was updated successfully, but these errors were encountered: