Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ext/bestpractices/flex_location_group_empty.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type FlexLocationGroupEmptyCheck struct {
locationGroupStops map[string]int // location_group_id -> count of stops
}

func (e *FlexLocationGroupEmptyCheck) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (e *FlexLocationGroupEmptyCheck) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
if e.locationGroupStops == nil {
e.locationGroupStops = map[string]int{}
}
Expand Down Expand Up @@ -54,4 +54,3 @@ func (e *FlexLocationGroupEmptyCheck) Validate(ent tt.Entity) []error {

return nil
}

2 changes: 1 addition & 1 deletion ext/builders/agency_place_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewAgencyPlaceBuilder() *AgencyPlaceBuilder {
}
}

func (pp *AgencyPlaceBuilder) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (pp *AgencyPlaceBuilder) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Agency:
pp.agencyStops[eid] = map[string]int{}
Expand Down
2 changes: 1 addition & 1 deletion ext/builders/convex_hull_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewConvexHullBuilder() *ConvexHullBuilder {
}

// AfterWrite keeps track of which routes/agencies visit which stops
func (pp *ConvexHullBuilder) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (pp *ConvexHullBuilder) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Stop:
pp.stops[eid] = &stopGeom{
Expand Down
2 changes: 1 addition & 1 deletion ext/builders/onestop_id_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewOnestopIDBuilder() *OnestopIDBuilder {
}
}

func (pp *OnestopIDBuilder) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (pp *OnestopIDBuilder) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Agency:
pp.agencyNames[eid] = v.AgencyName.Val
Expand Down
2 changes: 1 addition & 1 deletion ext/builders/route_geometry_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewRouteGeometryBuilder() *RouteGeometryBuilder {
}

// Counts the number of times a shape is used for each route,direction_id
func (pp *RouteGeometryBuilder) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (pp *RouteGeometryBuilder) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *service.ShapeLine:
pts := make([]tlxy.Point, v.Geometry.Val.NumCoords())
Expand Down
2 changes: 1 addition & 1 deletion ext/builders/route_stop_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewRouteStopBuilder() *RouteStopBuilder {
}
}

func (pp *RouteStopBuilder) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (pp *RouteStopBuilder) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Route:
pp.routeAgencies[eid] = v.AgencyID.Val
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/apply_default_agency_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type ApplyDefaultAgencyFilter struct {
agencyCount int
}

func (e *ApplyDefaultAgencyFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *ApplyDefaultAgencyFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Agency:
if e.defaultAgencyId == "" {
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/apply_parent_timezone_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type ApplyParentTimezoneFilter struct {
parentStopTimezones map[string]string
}

func (e *ApplyParentTimezoneFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *ApplyParentTimezoneFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
// Remember filter happens before UpdateKeys or final ID available
switch v := ent.(type) {
case *gtfs.Agency:
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/apply_timezone_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type ApplyTimezoneFilter struct {
timezone string
}

func (e *ApplyTimezoneFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *ApplyTimezoneFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Agency:
v.AgencyTimezone.Set(e.timezone)
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/basic_route_type_fliter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
type BasicRouteTypeFilter struct{}

// Filter converts extended route_types to basic route_types.
func (e *BasicRouteTypeFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *BasicRouteTypeFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
// Filters can edit in place, add entity errors, etc.
v, ok := ent.(*gtfs.Route)
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/normalize_timezone_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
type NormalizeTimezoneFilter struct{}

// Validate .
func (e *NormalizeTimezoneFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *NormalizeTimezoneFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Agency:
n, ok := tt.IsValidTimezone(v.AgencyTimezone.Val)
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/prefix_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (filter *PrefixFilter) UnprefixFile(fn string) {
filter.setPrefixFile(fn, false)
}

func (filter *PrefixFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (filter *PrefixFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
ok := filter.prefixFileDefault
if prefixFile, prefixFileOk := filter.prefixFiles[ent.Filename()]; prefixFileOk {
ok = prefixFile
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/redate_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func newRedateFilterFromJson(args string) (*RedateFilter, error) {
return NewRedateFilter(opts.SourceDate.Val, opts.TargetDate.Val, int(a), int(b), opts.DOWAlign.Val)
}

func (tf *RedateFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (tf *RedateFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
ctx := context.TODO()
switch v := ent.(type) {
case *gtfs.Trip:
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/route_network_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (e *RouteNetworkIDFilter) Expand(ent tt.Entity, emap *tt.EntityMap) ([]tt.E
return ret, true, nil
}

func (e *RouteNetworkIDFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *RouteNetworkIDFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
// Unset any set NetworkID
if v, ok := ent.(*gtfs.Route); ok {
v.NetworkID = tt.String{}
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/simplify_calendar_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
type SimplifyCalendarFilter struct {
}

func (e *SimplifyCalendarFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *SimplifyCalendarFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
v, ok := ent.(*gtfs.Calendar)
if !ok {
return nil
Expand Down
2 changes: 1 addition & 1 deletion ext/filters/simplify_shape_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type SimplifyShapeFilter struct {
SimplifyValue float64
}

func (e *SimplifyShapeFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *SimplifyShapeFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
v, ok := ent.(*service.ShapeLine)
if !ok {
return nil
Expand Down
2 changes: 1 addition & 1 deletion ext/plus/plus.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (ext Ext) Entities() []tt.Entity {
}
}

func (ext *Ext) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (ext *Ext) Filter(ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Agency:
ext.defaultAgency = v.AgencyID.Val
Expand Down
2 changes: 1 addition & 1 deletion extract/setterfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type hasEntityKey interface {
}

// Filter overrides values on entities.
func (tx *SetterFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (tx *SetterFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
v, ok := ent.(hasEntityKey)
if !ok {
return nil
Expand Down
2 changes: 1 addition & 1 deletion extract/transform_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (tx *TransformFilter) AddValue(filename string, eid string, key string, fun
tx.nodes[*n] = entv
}

func (tx *TransformFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (tx *TransformFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
v, ok := ent.(hasEntityKey)
if !ok {
return nil
Expand Down
3 changes: 1 addition & 2 deletions rules/flex_geography_id_unique.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type FlexGeographyIDUniqueCheck struct {
geographyIDs map[string]string // geography_id -> filename
}

func (e *FlexGeographyIDUniqueCheck) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (e *FlexGeographyIDUniqueCheck) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
if e.geographyIDs == nil {
e.geographyIDs = map[string]string{}
}
Expand Down Expand Up @@ -99,4 +99,3 @@ func (e *FlexGeographyIDUniqueCheck) Validate(ent tt.Entity) []error {

return nil
}

2 changes: 1 addition & 1 deletion rules/flex_stop_location_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type FlexStopLocationTypeCheck struct {
flexStops map[string]bool // stops used in flex services
}

func (e *FlexStopLocationTypeCheck) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (e *FlexStopLocationTypeCheck) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
if e.locationTypes == nil {
e.locationTypes = map[string]int{}
}
Expand Down
3 changes: 1 addition & 2 deletions rules/flex_zone_id_conditional.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type FlexZoneIDConditionalCheck struct {
checkedFiles bool
}

func (e *FlexZoneIDConditionalCheck) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (e *FlexZoneIDConditionalCheck) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
// Check if fare_rules.txt has any entries
if _, ok := ent.(*gtfs.FareRule); ok {
e.hasFareRules = true
Expand Down Expand Up @@ -54,4 +54,3 @@ func (e *FlexZoneIDConditionalCheck) Validate(ent tt.Entity) []error {

return nil
}

2 changes: 1 addition & 1 deletion rules/invalid_parent_station.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type ParentStationLocationTypeCheck struct {
locationTypes map[string]int
}

func (e *ParentStationLocationTypeCheck) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (e *ParentStationLocationTypeCheck) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
if e.locationTypes == nil {
e.locationTypes = map[string]int{}
}
Expand Down
2 changes: 1 addition & 1 deletion rules/transfer_stop_location_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type TransferStopLocationTypeCheck struct {
locationTypes map[string]int
}

func (e *TransferStopLocationTypeCheck) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (e *TransferStopLocationTypeCheck) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
if e.locationTypes == nil {
e.locationTypes = map[string]int{}
}
Expand Down
2 changes: 1 addition & 1 deletion stats/fvsl.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func NewFeedVersionServiceLevelBuilder() *FeedVersionServiceLevelBuilder {
}
}

func (pp *FeedVersionServiceLevelBuilder) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (pp *FeedVersionServiceLevelBuilder) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Calendar:
pp.services[v.ServiceID.Val] = service.NewService(*v)
Expand Down
2 changes: 1 addition & 1 deletion stats/fvsw.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewFeedVersionServiceWindowBuilder() *FeedVersionServiceWindowBuilder {
return &FeedVersionServiceWindowBuilder{}
}

func (pp *FeedVersionServiceWindowBuilder) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (pp *FeedVersionServiceWindowBuilder) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Agency:
if tz, ok := tt.IsValidTimezone(v.AgencyTimezone.Val); ok {
Expand Down
2 changes: 1 addition & 1 deletion tldb/notnull.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
type NotNullFilter struct{}

// Validate .
func (e *NotNullFilter) Filter(ent tt.Entity, emap *tt.EntityMap) error {
func (e *NotNullFilter) Filter(ent tt.Entity, _ *tt.EntityMap) error {
switch v := ent.(type) {
case *gtfs.Agency:
// Used in textsearch
Expand Down
2 changes: 1 addition & 1 deletion validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (cr *testErrorHandler) HandleSourceErrors(fn string, errs []error, warns []
func (cr *testErrorHandler) HandleEntityErrors(ent tt.Entity, errs []error, warns []error) {
}

func (cr *testErrorHandler) AfterWrite(eid string, ent tt.Entity, emap *tt.EntityMap) error {
func (cr *testErrorHandler) AfterWrite(eid string, ent tt.Entity, _ *tt.EntityMap) error {
var errs []error
errs = append(errs, tt.CheckErrors(ent)...)
errs = append(errs, tt.CheckWarnings(ent)...)
Expand Down