-
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
chore: check stops.zone_id presence #936
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 :)
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/StopZoneIdValidator.java
Show resolved
Hide resolved
This Java code was not formatted, so an autoformat commit was submitted automatically. As we discussed before, such commits have a disadvantage - they hide the actual ownership of changed lines.
|
Indeed, we have a workflow to check said formatting. After verification it used to only execute on push on |
} | ||
for (GtfsStop stop : stopTable.getEntities()) { | ||
if (isStationOrEntrance(stop)) { | ||
return; |
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.
This return
exits the whole validate
function and interrupts validation of the rest of the file. Same for the return
below.
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.
The logic here has been modified in #972 where validate
is as follows:
gtfs-validator/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/StopZoneIdValidator.java
Line 48 in 18c7921
public void validate(NoticeContainer noticeContainer) { |
closes #237
Summary:
This PR provides support to implement #237
Expected behavior:
New notice:
StopWithoutZoneIdNotice
(severity level =WARNING
- to be upgraded toERROR
in the future).Per GTFS specification,
stops.zone_id
should be provided if fare information is provided usingfare_rules.txt
- if this requirement is not met, a notice should be emitted.Note that this rule does not apply to records from
stops.txt
that represent a stop or en entrance (i.e.stops.location_type = 1 or 2
) - in this case, no notice should be emitted.Gtfs specification reference:
from https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md#stopstxt
Please make sure these boxes are checked before submitting your pull request - thanks!
gradle test
to make sure you didn't break anything[ ] Include screenshot(s) showing how this pull request works and fixes the issue(s)