Skip to content
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

Configure prettier formatting for sandbox code #6406

Merged
Changes from 4 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: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -15,3 +15,6 @@ ead33ffe280dd7caf72cae5ff7a41542e8427636

# json file reformatting with prettier
c287575df6798810a69fafc54c8c4e1867b71367

# prettier formatting for sandbox code
14f2d6bc7622649c817e9f45e4d1a9e6dd94847d
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
import java.util.Set;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.opentripplanner.transit.model.basic.Distance;
import org.opentripplanner.ext.fares.model.FareDistance;
import org.opentripplanner.ext.fares.model.FareDistance.LinearDistance;
import org.opentripplanner.ext.fares.model.FareLegRule;
@@ -23,6 +22,7 @@
import org.opentripplanner.model.plan.Place;
import org.opentripplanner.model.plan.PlanTestConstants;
import org.opentripplanner.transit.model._data.TimetableRepositoryForTest;
import org.opentripplanner.transit.model.basic.Distance;
import org.opentripplanner.transit.model.basic.Money;
import org.opentripplanner.transit.model.framework.FeedScopedId;

@@ -331,21 +331,29 @@ class DistanceFares {
List<FareLegRule> distanceRules = List.of(
FareLegRule
.of(DISTANCE_ID, tenKmProduct)
.withFareDistance(new LinearDistance(
Distance.ofKilometersBoxed(7d, ignore -> {}).orElse(null),
Distance.ofKilometersBoxed(10d, ignore -> {}).orElse(null)))
.withFareDistance(
new LinearDistance(
Distance.ofKilometersBoxed(7d, ignore -> {}).orElse(null),
Distance.ofKilometersBoxed(10d, ignore -> {}).orElse(null)
)
)
.build(),
FareLegRule
.of(DISTANCE_ID, threeKmProduct)
.withFareDistance(new LinearDistance(
Distance.ofKilometersBoxed(3d, ignore -> {}).orElse(null),
Distance.ofKilometersBoxed(6d, ignore -> {}).orElse(null)))
.withFareDistance(
new LinearDistance(
Distance.ofKilometersBoxed(3d, ignore -> {}).orElse(null),
Distance.ofKilometersBoxed(6d, ignore -> {}).orElse(null)
)
)
.build(),
FareLegRule
.of(DISTANCE_ID, twoKmProduct)
.withFareDistance(new LinearDistance(
Distance.ofMetersBoxed(0d, ignore -> {}).orElse(null),
Distance.ofMetersBoxed(2000d, ignore -> {}).orElse(null))
.withFareDistance(
new LinearDistance(
Distance.ofMetersBoxed(0d, ignore -> {}).orElse(null),
Distance.ofMetersBoxed(2000d, ignore -> {}).orElse(null)
)
)
.build()
);
Original file line number Diff line number Diff line change
@@ -226,12 +226,12 @@ void calculateFareThatIncludesNoFreeTransfers() {
);
calculateFare(rides, FareType.youth, Money.ZERO_USD);
// We don't get any fares for the skagit transit leg below here because they don't accept ORCA (electronic)
calculateFare(rides, FareType.electronicSpecial, ONE_DOLLAR.plus(ONE_DOLLAR).plus(DEFAULT_TEST_RIDE_PRICE.times(2)));
calculateFare(
rides,
FareType.electronicRegular,
DEFAULT_TEST_RIDE_PRICE.times(4)
FareType.electronicSpecial,
ONE_DOLLAR.plus(ONE_DOLLAR).plus(DEFAULT_TEST_RIDE_PRICE.times(2))
);
calculateFare(rides, FareType.electronicRegular, DEFAULT_TEST_RIDE_PRICE.times(4));
calculateFare(
rides,
FareType.electronicSenior,
Original file line number Diff line number Diff line change
@@ -96,7 +96,4 @@ public static StopTime regularStop(int arrivalTime, int departureTime) {
stopTime.setTrip(TRIP);
return stopTime;
}



}
Original file line number Diff line number Diff line change
@@ -45,10 +45,7 @@ private static List<List<StopTime>> isNotScheduledDeviatedTripCases() {
areaWithContinuousStopping("10:40"),
regularStop("10:50", "11:00")
),
List.of(
regularStop("10:10"),
regularStop("10:20")
)
List.of(regularStop("10:10"), regularStop("10:20"))
);
}

@@ -57,6 +54,4 @@ private static List<List<StopTime>> isNotScheduledDeviatedTripCases() {
void isNotScheduledDeviatedTrip(List<StopTime> stopTimes) {
assertFalse(ScheduledDeviatedTrip.isScheduledDeviatedFlexTrip(stopTimes));
}


}
}
Original file line number Diff line number Diff line change
@@ -48,12 +48,20 @@ class IsUnscheduledTrip {

private static final StopTime SCHEDULED_STOP = FlexStopTimesForTest.regularStop("10:00");
private static final StopTime UNSCHEDULED_STOP = FlexStopTimesForTest.area("10:10", "10:20");
private static final StopTime CONTINUOUS_PICKUP_STOP = FlexStopTimesForTest.regularStopWithContinuousPickup("10:30");
private static final StopTime CONTINUOUS_DROP_OFF_STOP = FlexStopTimesForTest.regularStopWithContinuousDropOff("10:40");
private static final StopTime CONTINUOUS_PICKUP_STOP = FlexStopTimesForTest.regularStopWithContinuousPickup(
"10:30"
);
private static final StopTime CONTINUOUS_DROP_OFF_STOP = FlexStopTimesForTest.regularStopWithContinuousDropOff(
"10:40"
);

// disallowed by the GTFS spec
private static final StopTime FLEX_AND_CONTINUOUS_PICKUP_STOP = FlexStopTimesForTest.areaWithContinuousPickup("10:50");
private static final StopTime FLEX_AND_CONTINUOUS_DROP_OFF_STOP = FlexStopTimesForTest.areaWithContinuousDropOff("11:00");
private static final StopTime FLEX_AND_CONTINUOUS_PICKUP_STOP = FlexStopTimesForTest.areaWithContinuousPickup(
"10:50"
);
private static final StopTime FLEX_AND_CONTINUOUS_DROP_OFF_STOP = FlexStopTimesForTest.areaWithContinuousDropOff(
"11:00"
);

static List<List<StopTime>> notUnscheduled() {
return List.of(
Original file line number Diff line number Diff line change
@@ -46,5 +46,4 @@ private <D extends Enum<?>, A extends Enum<?>> void verifyExplicitMatch(
}
assertTrue(rest.isEmpty());
}

}
Loading