-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat: Check validator subclasses are annotated with @GtfsValidator #1263
feat: Check validator subclasses are annotated with @GtfsValidator #1263
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
+ ": " | ||
+ validatorBaseClass.getSimpleName() | ||
+ " validator subclass should be annotated with @GtfsValidator") | ||
.that(annotationInfo != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can probably use
.that(annotationInfo).isNotNull();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally wrote it this way, but the resulting error message from Truth isn't particular helpful / readable in the context of this check. With the isTrue() check, we get something like:
SometValidator: FileValidator validator subclass should be annotated with @GtfsValidator
expected to be true
With the alternate syntax, we get:
SometValidator: FileValidator validator subclass should be annotated with @GtfsValidator
expected not to be: null
I think the former is more understandable than the latter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@asvechnikov2 I think we got the permissions fixed, but you'll need to LGTM again |
+ ": " | ||
+ validatorBaseClass.getSimpleName() | ||
+ " validator subclass should be annotated with @GtfsValidator") | ||
.that(annotationInfo != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Closes #1262
Add a unit-test that checks that any subclass of SingleEntityValidator or FileValidator is also annotated with @GtfsValidator.
Please make sure these boxes are checked before submitting your pull request - thanks!
gradle test
to make sure you didn't break anything