Skip to content
Open
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
18 changes: 17 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ updates:
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 100
open-pull-requests-limit: 10
rebase-strategy: disabled
ignore:
- dependency-name: "com.android.application"
Expand All @@ -27,3 +27,19 @@ updates:
update-types: ["version-update:semver-major", "version-update:semver-minor"]
cooldown:
default-days: 7
- package-ecosystem: pre-commit
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
rebase-strategy: disabled
cooldown:
default-days: 7
- package-ecosystem: swift
directory: /iosApp
schedule:
interval: weekly
open-pull-requests-limit: 10
rebase-strategy: disabled
cooldown:
default-days: 7
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
entry: gradle-task :buildSrc:spotlessCheck :buildSrc:spotlessApply -w
files: ^buildSrc/.*\.(kt|kts)$
- repo: https://github.com/nicklockwood/SwiftFormat
rev: 0.57.2
rev: 0.61.1
hooks:
- id: swiftformat
stages: [pre-commit]
Expand Down
4 changes: 4 additions & 0 deletions config.swiftformat
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
--disable wrapMultilineStatementBraces
--disable trailingCommas

@KaylaBrady KaylaBrady Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabled these new rules from the latest SwiftFormat version based mostly on preference.
redundantViewBuilder I disabled b/c I saw mention in the changelog of it having issues in an earlier version and I don't remember / haven't looked into the consequences of removing the annotation when it is actually needed.

--disable redundantViewBuilder
--disable wrapFunctionBodies
--disable wrapPropertyBodies
--maxwidth 120
44 changes: 22 additions & 22 deletions iosApp/iosApp.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUI
/// In the filtered stop details state, non-vehicle-based upcoming trips should not link to the trip details page.
/// This will render a button if there there is a SheetNavigationStackEntry to navigate to, otherwise it renders a
/// regular label.
struct OptionalNavigationLink<Label>: View where Label: View {
struct OptionalNavigationLink<Label: View>: View {
@ObserveInjection var inject

let value: SheetNavigationStackEntry?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ struct RouteCardDepartures: View {
if index < stopData.data.count - 1 {
HaloSeparator()
}
} else {
EmptyView()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/ComponentViews/SheetNavigationLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import SwiftUI

struct SheetNavigationLink<Label>: View where Label: View {
struct SheetNavigationLink<Label: View>: View {
@ObserveInjection var inject
let value: SheetNavigationStackEntry
let action: (SheetNavigationStackEntry) -> Void
Expand Down
4 changes: 2 additions & 2 deletions iosApp/iosApp/IOSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDele

@main
struct IOSApp: App {
// register app delegate for Firebase setup
/// register app delegate for Firebase setup
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate

// When running unit tests or previews, don't mount the entire app which makes real API requests.
/// When running unit tests or previews, don't mount the entire app which makes real API requests.
private let isTestOrPreview = ProcessInfo.processInfo.arguments.contains("--dummy-test-app")
|| ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] != nil

Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/LocationDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extension LocationDataManager: CLLocationManagerDelegate {
}
}

// https://developer.apple.com/videos/play/wwdc2018/417/
/// https://developer.apple.com/videos/play/wwdc2018/417/
public protocol LocationFetcher: AnyObject {
var locationFetcherDelegate: LocationFetcherDelegate? { get set }
var authorizationStatus: CLAuthorizationStatus { get }
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/Network/MockSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SwiftPhoenixClient

open class MockSocket: PhoenixSocket {
public var channels: [PhoenixChannel] = []
// Channel.socket is weak, so we need to maintain a reference to the Socket
/// Channel.socket is weak, so we need to maintain a reference to the Socket
private let socket = Socket(endPoint: "/socket", transport: { _ in PhoenixTransportMock() })

public func attach() {}
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/Network/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PhoenixTransportMock: PhoenixTransport {
func send(data _: Data) {}
}

/*
/**
Return the decoded message in the expected [Any?] format:
[joinReference, messageReference, topic, eventName, eventPayload]

Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/Pages/AlertDetails/AlertDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct AlertDetails: View {
var stopId: String?
var now: EasternTimeInstant

@ScaledMetric()
@ScaledMetric
private var iconSize = 16

@State var areStopsExpanded = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Combine
import Shared
import SwiftUI

/*
/**
Functions for handling interactions with the map, like prop change, navigation, and tapping.
*/
extension HomeMapView {
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/Pages/Map/HomeMapViewLayerExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import Shared
import SwiftUI

/*
/**
Functions for manipulating the layers displayed on the map.
*/
extension HomeMapView {
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/Pages/Map/MapLayerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class MapLayerManager: iosApp.IMapLayerManager {
try map.addPersistentLayer(routeAnchorLayer, layerPosition: .below(stopAnchorLayerId))
}

/*
/**
Adds persistent layers so that they are persisted even if the underlying map style changes.

https://docs.mapbox.com/ios/maps/api/11.5.0/documentation/mapboxmaps/stylemanager/addpersistentlayer(_:layerposition:)
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/Pages/Onboarding/OnboardingPieces.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ enum OnboardingPieces {
@ViewBuilder let background: () -> Background

private var screenHeight: CGFloat { UIScreen.current?.bounds.height ?? 852.0 }
// Use less padding on smaller screens
/// Use less padding on smaller screens
private var bottomPadding: CGFloat { screenHeight < 812 ? 16 : 28 }

var body: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ private extension DateComponents {
get {
let calendar = Calendar(identifier: .iso8601)
let beforeDayStart = calendar.startOfDay(for: .now).addingTimeInterval(-0.01)
let result = calendar.nextDate(after: beforeDayStart, matching: self, matchingPolicy: .strict)!
return result
return calendar.nextDate(after: beforeDayStart, matching: self, matchingPolicy: .strict)!
}
set {
// in this file, we only use hour/minute/second
Expand Down
6 changes: 3 additions & 3 deletions iosApp/iosApp/Pages/Search/SearchInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ struct SearchInput: View {
var hint: String
var onClear: (() -> Void)?

// Don't update this FocusState isFocused directly, only toggle through searchObserver.isFocused,
// otherwise it's possible for the update in searchObserver to get skipped. It's also not
// possible to test state variable changes, while testing this will stay set to false.
/// Don't update this FocusState isFocused directly, only toggle through searchObserver.isFocused,
/// otherwise it's possible for the update in searchObserver to get skipped. It's also not
/// possible to test state variable changes, while testing this will stay set to false.
@FocusState var isFocused: Bool

@ScaledMetric var searchIconSize: CGFloat = 16
Expand Down
12 changes: 6 additions & 6 deletions iosApp/iosApp/Pages/StopDetails/DepartureTile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ struct DepartureTile: View {
case onPrediction(route: Route)
}

// Store the size that the tile should be for text to wrap properly.
// In order for wrapped text not to get cut off in the horizontal ScrollView, we need to set the fixed width
// rather than just using `maxWidth` (see https://stackoverflow.com/a/75331082)
// Calculating the size based on an approach taken in
// https://nilcoalescing.com/blog/AdaptiveLayoutsWithViewThatFits/#expandable-text-with-line-limit
// the ideal width is measured on the background in the initial render, then used on subsequent renders.
/// Store the size that the tile should be for text to wrap properly.
/// In order for wrapped text not to get cut off in the horizontal ScrollView, we need to set the fixed width
/// rather than just using `maxWidth` (see https://stackoverflow.com/a/75331082)
/// Calculating the size based on an approach taken in
/// https://nilcoalescing.com/blog/AdaptiveLayoutsWithViewThatFits/#expandable-text-with-line-limit
/// the ideal width is measured on the background in the initial render, then used on subsequent renders.
@State var computedMultilineWidth: CGFloat? = nil

let maxTileWidth: CGFloat = 195.0
Expand Down
14 changes: 0 additions & 14 deletions iosApp/iosApp/Pages/StopDetails/DirectionPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ struct DirectionPicker: View {
let selectedDirectionId: Int32?
let updateDirectionId: (Int32) -> Void

init(
availableDirections: [Int32],
directions: [Direction],
route: Route,
selectedDirectionId: Int32?,
updateDirectionId: @escaping (Int32) -> Void
) {
self.availableDirections = availableDirections
self.directions = directions
self.route = route
self.selectedDirectionId = selectedDirectionId
self.updateDirectionId = updateDirectionId
}

var body: some View {
if availableDirections.count > 1 {
HStack(alignment: .center, spacing: 2) {
Expand Down
31 changes: 0 additions & 31 deletions iosApp/iosApp/Pages/StopDetails/StopDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import Foundation

import OrderedCollections
import Shared
import SwiftPhoenixClient
Expand Down Expand Up @@ -35,36 +34,6 @@ struct StopDetailsView: View {

let inspection = Inspection<Self>()

init(
filters: StopDetailsPageFilters,
routeData: StopDetailsViewModel.RouteData?,
favorites: Favorites,
global: GlobalResponse?,
now: Date,
onUpdateFavorites: @escaping () -> Void,
setStopFilter: @escaping (StopDetailsFilter?) -> Void,
setTripFilter: @escaping (TripDetailsFilter?) -> Void,
navCallbacks: NavigationCallbacks,
errorBannerVM: IErrorBannerViewModel,
nearbyVM: NearbyViewModel,
mapVM: IMapViewModel,
stopDetailsVM: IStopDetailsViewModel,
) {
self.filters = filters
self.routeData = routeData
self.favorites = favorites
self.global = global
self.now = now
self.onUpdateFavorites = onUpdateFavorites
self.setStopFilter = setStopFilter
self.setTripFilter = setTripFilter
self.navCallbacks = navCallbacks
self.errorBannerVM = errorBannerVM
self.nearbyVM = nearbyVM
self.mapVM = mapVM
self.stopDetailsVM = stopDetailsVM
}

var body: some View {
if let stopFilter = filters.stopFilter {
StopDetailsFilteredView(
Expand Down
Loading
Loading