Skip to content

Commit

Permalink
Merge 3e0c47b into dc6a598
Browse files Browse the repository at this point in the history
  • Loading branch information
bdferris-v2 authored May 5, 2023
2 parents dc6a598 + 3e0c47b commit 68964e2
Show file tree
Hide file tree
Showing 87 changed files with 366 additions and 373 deletions.
8 changes: 4 additions & 4 deletions RULES.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Each Notice is associated with a severity: `INFO`, `WARNING`, `ERROR`.
| [`missing_required_column`](#missing_required_column) | A required column is missing in the input file. |
| [`missing_required_field`](#missing_required_field) | A required field is missing. |
| [`missing_required_file`](#missing_required_file) | A required file is missing. |
| [`missing_stop_name`](#missing_stop_name) | `stops.stop_name` is required for `location_type` equal to `0`, `1`, or `2`. |
| [`missing_stop_name`](#missing_stop_name) | `stops.stop_name` is required for `location_type` equal to `0`, `1`, or `2`. |
| [`missing_trip_edge`](#missing_trip_edge) | Missing trip edge `arrival_time` or `departure_time`. |
| [`new_line_in_value`](#new_line_in_value) | New line or carriage return in a value in CSV file. |
| [`number_out_of_range`](#number_out_of_range) | Out of range value. |
Expand All @@ -81,7 +81,7 @@ Each Notice is associated with a severity: `INFO`, `WARNING`, `ERROR`.
| [`stop_time_timepoint_without_times`](#stop_time_timepoint_without_times) | `arrival_time` or `departure_time` not specified for timepoint. |
| [`stop_time_with_arrival_before_previous_departure_time`](#stop_time_with_arrival_before_previous_departure_time) | Backwards time travel between stops in `stop_times.txt` |
| [`stop_time_with_only_arrival_or_departure_time`](#stop_time_with_only_arrival_or_departure_time) | Missing `stop_times.arrival_time` or `stop_times.departure_time`. |
| [`stop_without_location`](#stop_without_location) | `stop_lat` and/or `stop_lon` is missing for stop with `location_type` equal to`0`, `1`, or `2`
| [`stop_without_location`](#stop_without_location) | `stop_lat` and/or `stop_lon` is missing for stop with `location_type` equal to`0`, `1`, or `2` |
| [`stop_without_zone_id`](#stop_without_zone_id) | Stop without value for `stops.zone_id`. |
| [`too_many_rows`](#too_many_rows) | A CSV file has too many rows. |
| [`transfer_with_invalid_stop_location_type`](#transfer_with_invalid_stop_location_type) | A stop id field from GTFS file `transfers.txt` references a stop that has a `location_type` other than 0 or 1 (aka Stop/Platform or Station). |
Expand All @@ -101,7 +101,7 @@ Each Notice is associated with a severity: `INFO`, `WARNING`, `ERROR`.
| [`duplicate_route_name`](#duplicate_route_name) | Two distinct routes have either the same `route_short_name`, the same `route_long_name`, or the same combination of `route_short_name` and `route_long_name`. |
| [`empty_row`](#empty_row) | A row in the input file has only spaces. |
| [`equal_shape_distance_same_coordinates`](#equal_shape_distance_same_coordinates) | Two consecutive points have equal `shape_dist_traveled` and the same lat/lon coordinates in `shapes.txt`. |
| [`expired_calendar`](#expired_calendar) | Dataset should not contain date ranges for services that have already expired.
| [`expired_calendar`](#expired_calendar) | Dataset should not contain date ranges for services that have already expired. |
| [`fast_travel_between_consecutive_stops`](#fast_travel_between_consecutive_stops) | A transit vehicle moves too fast between two consecutive stops. |
| [`fast_travel_between_far_stops`](#fast_travel_between_far_stops) | A transit vehicle moves too fast between two far stops. |
| [`feed_expiration_date7_days`](#feed_expiration_date7_days) | Dataset should be valid for at least the next 7 days. |
Expand All @@ -114,7 +114,7 @@ Each Notice is associated with a severity: `INFO`, `WARNING`, `ERROR`.
| [`missing_recommended_field`](#missing_recommended_field) | A recommended field is missing. |
| [`missing_timepoint_column`](#missing_timepoint_column) | `timepoint` column is missing for a dataset. |
| [`missing_timepoint_value`](#missing_timepoint_value) | `stop_times.timepoint` value is missing for a record. |
| [`mixed_case_recommended_field`](#mixed_case_recommended_field) | This field has customer-facing text and should use Mixed Case (should contain upper and lower case letters). |
| [`mixed_case_recommended_field`](#mixed_case_recommended_field) | This field has customer-facing text and should use Mixed Case (should contain upper and lower case letters). |
| [`more_than_one_entity`](#more_than_one_entity) | More than one row in CSV. |
| [`non_ascii_or_non_printable_char`](#non_ascii_or_non_printable_char) | Non ascii or non printable char in `id`. |
| [`pathway_dangling_generic_node`](#pathway_dangling_generic_node) | A generic node has only one incident location in a pathway graph. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* Parsing of a CSV file failed.
*
* <p>One common case of the problem is when a cell value contains more than 4096 characters.
*
* <p>Severity: {@code SeverityLevel.ERROR}
*/
@GtfsValidationNotice(severity = ERROR)
public class CsvParsingFailedNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice.UrlRef;

/**
* The values of the given key and rows are duplicates.
* Duplicated entity.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>The values of the given key and rows are duplicates.
*/
@GtfsValidationNotice(
severity = ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice.UrlRef;

/**
* The input file CSV header has the same column name repeated.
* Duplicated column in CSV.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>The input file CSV header has the same column name repeated.
*/
@GtfsValidationNotice(
severity = ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice.SectionRefs;

/**
* A column name is empty. Such columns are skipped by the validator.
* A column name is empty.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Such columns are skipped by the validator.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILE_REQUIREMENTS))
public class EmptyColumnNameNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
/**
* A CSV file is empty.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Empty csv file found in the archive: file does not have any headers, or is a required file and
* does not have any data. The GTFS specification requires the first line of each file to contain
* field names and required files must have data.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILE_REQUIREMENTS))
public class EmptyFileNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
*
* <p>Some CSV parsers, such as Univocity, may misinterpret it as a non-empty row that has a single
* column which is empty, hence we show a warning.
*
* <p>Severity: {@code SeverityLevel.WARNING}
*/
@GtfsValidationNotice(severity = WARNING, sections = @SectionRefs(FILE_REQUIREMENTS))
public class EmptyRowNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice.UrlRef;

/**
* The values of the given key and rows of one table cannot be found a values of the given key in
* another table.
* Wrong foreign key.
*
* <p>This is the case when a foreign key of one table references a non-existing value in its
* original table.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>A foreign key references the primary key of another file. A foreign key violation means that
* the foreign key referenced from a given row (the child file) cannot be found in the corresponding
* file (the parent file). The Foreign keys are defined in the specification under "Type" for each
* file.
*/
@GtfsValidationNotice(
severity = ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
import java.io.IOException;
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice;

/**
* This is related to Input and Output operations in the code.
*
* <p>Severity: {@code SeverityLevel.ERROR}
*/
/** Error in IO operation. */
@GtfsValidationNotice(severity = ERROR)
public class IOError extends SystemError {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
*
* <p>A color must be encoded as a six-digit hexadecimal number. The leading "#" is not included.
*
* <p>Example: {@code FFFFFF} for white, {@code 000000} for black or {@code 0039A6} for the A,C,E
* lines in NYMTA.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Example: `FFFFFF` for white, `000000` for black or `0039A6` for the A,C,E lines in NYC MTA.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidColorNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice.SectionRefs;

/**
* A currency amount field has a value that does not match the format (e.g. expected number of
* decimal places) of its corresponding currency code field.
* A currency amount field has a value that does not match the format of its corresponding currency
* code field.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Typically, this means the amount did not have the expected number of decimal places. The
* number of decimal places is specified by <a
* href="https://en.wikipedia.org/wiki/ISO_4217#Active_codes">ISO 4217</a>.
*
* @see org.mobilitydata.gtfsvalidator.annotation.CurrencyAmount
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@
* A field contains a wrong currency code.
*
* <p>Currency code must follow <a href="https://en.wikipedia.org/wiki/ISO_4217#Active_codes">ISO
* 4217</a>.
* 4217</a>
*
* <p>Example: {@code CAD} for Canadian dollars, {@code EUR} for euros or {@code JPY} for Japanese
* yen.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Example: `CAD` for Canadian dollars, `EUR` for euros or `JPY` for Japanese yen.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidCurrencyNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
*
* <p>Dates must have the YYYYMMDD format.
*
* <p>Example: {@code 20180913} for September 13th, 2018.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Example: `20180913` for September 13th, 2018.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidDateNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@
/**
* A field contains a malformed email address.
*
* <p>Definitions for valid emails are quite vague. We perform strict validation in the upstream
* using the Apache Commons EmailValidator.
*
* <p><a href="https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md">GTFS
* reference</a> does not provide any special requirements or standards.
* <p>Definitions for valid emails are quite vague. We perform strict validation using the Apache
* Commons EmailValidator.
*/
@GtfsValidationNotice(
severity = ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice;
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice.SectionRefs;

/**
* A field cannot be parsed as a floating point number.
*
* <p>Severity: {@code SeverityLevel.ERROR}
*/
/** A field cannot be parsed as a floating point number. */
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidFloatNotice extends ValidationNotice {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice;
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice.SectionRefs;

/**
* A field cannot be parsed as an integer.
*
* <p>Severity: {@code SeverityLevel.ERROR}
*/
/** A field cannot be parsed as an integer. */
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidIntegerNotice extends ValidationNotice {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
* <p>Language codes must follow <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">IETF BCP
* 47</a>.
*
* <p>Example: {@code en} for English, {@code en-US} for American English or {@code de} for German.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Example: `en` for English, `en-US` for American English or `de` for German.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidLanguageCodeNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
/**
* A field contains a malformed phone number.
*
* <p>Definitions for valid phone numbers are quite vague. We perform strict validation in the
* upstream using the Google libphonenumber.
*
* <p><a href="https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md">GTFS
* reference</a> does not provide any special requirements or standards.
* <p>This rule uses the
* [PhoneNumberUtil](https://www.javadoc.io/doc/com.googlecode.libphonenumber/libphonenumber/8.4.1/com/google/i18n/phonenumbers/PhoneNumberUtil.html)
* class to validate a phone number based on a country code. If no country code is provided in the
* parameters used to run the validator, this notice won't be emitted.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidPhoneNumberNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import org.mobilitydata.gtfsvalidator.annotation.GtfsValidationNotice.UrlRef;

/**
* A row in the input file has a different number of values than specified by the CSV header.
* Invalid csv row length.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>A row in the input file has a different number of values than specified by the CSV header.
*/
@GtfsValidationNotice(
severity = ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
/**
* A field cannot be parsed as time.
*
* <p>Time must be in the {@code H:MM:SS}, {@code HH:MM:SS} or {@code HHH:MM:SS} format.
* <p>Time must be in the `H:MM:SS`, `HH:MM:SS` or `HHH:MM:SS` format.
*
* <p>Example: {@code 14:30:00} for 2:30PM or {@code 25:35:00} for 1:35AM on the next day.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Example: `14:30:00` for 2:30PM or `25:35:00` for 1:35AM on the next day.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidTimeNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
* names never contain the space character but may contain an underscore. Refer to <a
* href="http://en.wikipedia.org/wiki/List_of_tz_zones">Wikipedia</a> for a list of valid values.
*
* <p>Example: {@code Asia/Tokyo}, {@code America/Los_Angeles} or {@code Africa/Cairo}.
*
* <p>Severity: {@code SeverityLevel.ERROR}
* <p>Example: `Asia/Tokyo`, `America/Los_Angeles` or `Africa/Cairo`.
*/
@GtfsValidationNotice(severity = ERROR, sections = @SectionRefs(FILED_TYPES))
public class InvalidTimezoneNotice extends ValidationNotice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,8 @@
/**
* A field contains a malformed URL.
*
* <p>Definitions for valid URLs are quite vague. We perform strict validation in the upstream using
* the Apache Common UrlValidator.
*
* <p><a href="https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md">GTFS
* reference</a> describes the requirements in the following way.
*
* <p><i>A fully qualified URL that includes http:// or https://, and any special characters in the
* URL must be correctly escaped. See the following <a
* href="http://www.w3.org/Addressing/URL/4_URI_Recommentations.html">URI recommentations</a> for a
* description of how to create fully qualified URL values.</i>
*
* <p>However, some production feeds may use certain characters without escaping and those URL may
* be still openable in modern browsers.
* <p>Definitions for valid URLs are quite vague. We perform strict validation using the Apache
* Commons UrlValidator.
*/
@GtfsValidationNotice(
severity = ERROR,
Expand Down
Loading

0 comments on commit 68964e2

Please sign in to comment.