-
Notifications
You must be signed in to change notification settings - Fork 38
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
MTC Field length validation #276
Conversation
Some modifications regarding passing additional FeedValidator classes are included. BREAKING CHANGE: Change in the type of optional arguments for GTFS.validate and Feed.validate
…th callback approach.
…h Java's BiFunction equivalent.
Codecov Report
@@ Coverage Diff @@
## dev #276 +/- ##
============================================
+ Coverage 64.99% 65.28% +0.28%
- Complexity 866 879 +13
============================================
Files 134 135 +1
Lines 6725 6743 +18
Branches 789 794 +5
============================================
+ Hits 4371 4402 +31
+ Misses 2055 2040 -15
- Partials 299 301 +2
Continue to review full report at Codecov.
|
Unassigning myself until #277 gets merged. |
@@ -65,44 +58,51 @@ public Feed (DataSource dataSource, String tablePrefix) { | |||
routes = new JDBCTableReader(Table.ROUTES, dataSource, tablePrefix, EntityPopulator.ROUTE); | |||
stops = new JDBCTableReader(Table.STOPS, dataSource, tablePrefix, EntityPopulator.STOP); | |||
trips = new JDBCTableReader(Table.TRIPS, dataSource, tablePrefix, EntityPopulator.TRIP); | |||
// shapePoints = new JDBCTableReader(Table.SHAPES, dataSource, tablePrefix, EntityPopulator.SHAPE_POINT); |
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 realize this has been commented out for a while since @landonreed committed 9244ff0. But why? Should we add it back?
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.
Perhaps we should. It might be worth revisiting #130.
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.
Would like to have a method renamed as indicated. Also curious what's up with the shape stuff being commented out or deleted.
…gtfs-lib into field-length-validator
PR requests addressed, and the tests are passing now... Please review. |
@@ -11,6 +11,7 @@ | |||
URL_FORMAT(Priority.MEDIUM, "URL format should be <scheme>://<authority><path>?<query>#<fragment>"), | |||
LANGUAGE_FORMAT(Priority.LOW, "Language should be specified with a valid BCP47 tag."), | |||
ILLEGAL_FIELD_VALUE(Priority.MEDIUM, "Fields may not contain tabs, carriage returns or new lines."), | |||
// The error type below is an MTC-specific requirement. |
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.
Let's organize these into sections instead of having an individual comment for potentially each error type.
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.
Did you have anything in mind for reorganizing?
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'd say one section for errors that apply during all types of validation and another section for MTC-specific errors.
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.
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.
Just one comment about a comment. Good to go otherwise.
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.
Love the alphabetization!
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.
Nice work! FYI I'm going to update the PR description to ref the issue in the Data Tools repo.
🎉 This PR is included in version 6.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Checklist
dev
before they can be merged tomaster
)Description
This PR adds the following (in pursuit of ibi-group/datatools-ui#544):
GTFS.validate()
and related methods.MTCValidator
for custom validation of 511 MTC guidelines on GTFS field length.NewGTFSErrorType
for field values that are too long.