Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit-test to ensure all validator subclasses are annotated with @GtfsValidator #1262

Closed
bdferris-v2 opened this issue Oct 4, 2022 · 0 comments · Fixed by #1263
Closed
Labels
enhancement New feature request or improvement on an existing feature status: Needs triage Applied to all new issues

Comments

@bdferris-v2
Copy link
Collaborator

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 by ValidatorLoader 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 or FileValidator 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

@bdferris-v2 bdferris-v2 added enhancement New feature request or improvement on an existing feature status: Needs triage Applied to all new issues labels Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request or improvement on an existing feature status: Needs triage Applied to all new issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant