etalab / transport-validator

GTFS validator
https://transport.data.gouv.fr/validation/
MIT License
38 stars 10 forks source link

Wrong color format is not detected #147

Closed AntoineAugusti closed 1 year ago

AntoineAugusti commented 1 year ago

If a route has a wrong color value, an error is raised by gtfs_structures but the validator does not pick it up it seems.

The GTFS file is not well formated.: CSVError { file_name: "routes.txt", source: Error(Deserialize { pos: Some(Position { byte: 14991, line: 213, record: 213 }), err: DeserializeError { field: None, kind: Message("'' is not a valid color; RRGGBB format is expected, without a leading `#`") } }), line_in_error: Some(LineError { headers: ["route_id", "agency_id", "route_short_name", "route_long_name", "route_desc", "route_type", "route_url", "route_color", "route_text_color"], values: ["SNCF:1000", "SNCF", "", "Rennes - Brest", "", "2", "", "", ""] }) }'

Wondering if it should be handled explicitly here?

https://github.com/rust-transit/gtfs-structure/blob/348052aa229f21a2452971078d7c8d721ea9352b/src/error.rs#L28-L30

AntoineAugusti commented 1 year ago

My bad, this issue is only on gtfs-to-geojson because it misses https://github.com/rust-transit/gtfs-structure/commit/2b342876bd82f04b407ad1f6d71516566e4995cb at the moment.

https://github.com/rust-transit/gtfs-to-geojson/pull/8 may fix it.