Skip to content

Commit 060ed4d

Browse files
authored
Standardize code formatting (#497)
Modernise Swift Code Created configs for SwiftFormat and applied it to the codebase. This mostly tidied up a lot of whitespace and applied consistent indentation. It also removed unused variables and redundant calls to self and return statements. Imports and switch cases are now ordered alphabetically. Used the Preview macro in all cases except for one. Applied a standard header comment from SwiftFormat, which reduces noise ta the top of the file. The history of who created what file when can be found in git. Added an IDETemplateMacros.plist file to the project so that new files will have this new standard header. SwiftFormat(https://github.com/nicklockwood/SwiftFormat) has not been added as a dependency. It's easier for people to just run it locally before committing. Or somebody could periodically run it over the entire codebase to keep things tidy. Remove AppearanceProxies file It only had an extension on UILabel, and there are none left in the app. Sort by state abbreviation Since the keys come first it makes sense to sort by those rather than full names
1 parent f79ac05 commit 060ed4d

File tree

98 files changed

+1383
-1964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1383
-1964
lines changed

FiveCalls/.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.0

FiveCalls/.swiftformat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--header Copyright 5calls. All rights reserved. See LICENSE for details.
2+
--indent 4

FiveCalls/FiveCalls.xcodeproj/project.pbxproj

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 54;
6+
objectVersion = 70;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -110,7 +110,6 @@
110110
D0967EC12BA6B17200E03F14 /* InboxMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0967EC02BA6B17200E03F14 /* InboxMessage.swift */; };
111111
D0983DD92A8209DA00DC90A6 /* LocationCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0983DD82A8209DA00DC90A6 /* LocationCoordinator.swift */; };
112112
D09AA8032B04974C0012FF45 /* StatsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09AA8022B04974C0012FF45 /* StatsViewModel.swift */; };
113-
D09AA8062B0497C70012FF45 /* UNNotification+ScheduleReminders.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09AA8052B0497C70012FF45 /* UNNotification+ScheduleReminders.swift */; };
114113
D0A76F252A814786006EC2F5 /* LocationSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A76F242A814786006EC2F5 /* LocationSheet.swift */; };
115114
D0BA59AB1F9546510069DA58 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0BA59AA1F9546510069DA58 /* NotificationService.swift */; };
116115
D0BA59AF1F9546510069DA58 /* NotificationsService.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = D0BA59A81F9546510069DA58 /* NotificationsService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
@@ -131,7 +130,6 @@
131130
D0EB04E02C1759C500AE38F2 /* InboxRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0EB04DF2C1759C500AE38F2 /* InboxRouter.swift */; };
132131
D0EE101C2ACBD69300412128 /* IssueDone.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0EE101B2ACBD69300412128 /* IssueDone.swift */; };
133132
E00C4DA8DB93E99E40E87452 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF2A740FE5EBC6A70F2AB3CA /* SystemConfiguration.framework */; };
134-
F57BD8BA1E438E7600BD554C /* AppearanceProxies.swift in Sources */ = {isa = PBXBuildFile; fileRef = F57BD8B91E438E7600BD554C /* AppearanceProxies.swift */; };
135133
/* End PBXBuildFile section */
136134

137135
/* Begin PBXContainerItemProxy section */
@@ -279,7 +277,6 @@
279277
D0967EC02BA6B17200E03F14 /* InboxMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxMessage.swift; sourceTree = "<group>"; };
280278
D0983DD82A8209DA00DC90A6 /* LocationCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationCoordinator.swift; sourceTree = "<group>"; };
281279
D09AA8022B04974C0012FF45 /* StatsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatsViewModel.swift; sourceTree = "<group>"; };
282-
D09AA8052B0497C70012FF45 /* UNNotification+ScheduleReminders.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UNNotification+ScheduleReminders.swift"; path = "Extensions/UNNotification+ScheduleReminders.swift"; sourceTree = "<group>"; };
283280
D0A76F242A814786006EC2F5 /* LocationSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationSheet.swift; sourceTree = "<group>"; };
284281
D0BA59A81F9546510069DA58 /* NotificationsService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationsService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
285282
D0BA59AA1F9546510069DA58 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
@@ -300,9 +297,12 @@
300297
D0E950042C03A7B700E26304 /* InboxVote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxVote.swift; sourceTree = "<group>"; };
301298
D0EB04DF2C1759C500AE38F2 /* InboxRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxRouter.swift; sourceTree = "<group>"; };
302299
D0EE101B2ACBD69300412128 /* IssueDone.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueDone.swift; sourceTree = "<group>"; };
303-
F57BD8B91E438E7600BD554C /* AppearanceProxies.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppearanceProxies.swift; sourceTree = "<group>"; };
304300
/* End PBXFileReference section */
305301

302+
/* Begin PBXFileSystemSynchronizedRootGroup section */
303+
AD4D35F12EA67635008D9E85 /* Extensions */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Extensions; sourceTree = "<group>"; };
304+
/* End PBXFileSystemSynchronizedRootGroup section */
305+
306306
/* Begin PBXFrameworksBuildPhase section */
307307
B50280581E478BC200749ED7 /* Frameworks */ = {
308308
isa = PBXFrameworksBuildPhase;
@@ -398,7 +398,6 @@
398398
isa = PBXGroup;
399399
children = (
400400
4F07B23D2B45F25E00C575DF /* Package.resolved */,
401-
D0480B222A538E1000502818 /* Packages */,
402401
B52805131E3FA94D00EE832A /* FiveCalls */,
403402
B502805C1E478BC200749ED7 /* FiveCallsTests */,
404403
B5A70A591E4C01A00031DF58 /* FiveCallsUITests */,
@@ -423,27 +422,26 @@
423422
B52805131E3FA94D00EE832A /* FiveCalls */ = {
424423
isa = PBXGroup;
425424
children = (
426-
D0BA59B71F9547270069DA58 /* FiveCalls.entitlements */,
427-
B502806D1E497C1400749ED7 /* Resources */,
428-
B5E7626F1E40D74900D63D62 /* Operations */,
429-
D05A17D02B05A1260048D5A6 /* Extensions */,
430-
B5E7626D1E40D72D00D63D62 /* View Models */,
431-
B5E7626C1E40D72400D63D62 /* Models */,
432-
B52805141E3FA94D00EE832A /* AppDelegate.swift */,
425+
D0DD456F229F11FF00AA94C1 /* AnalyticsManager.swift */,
433426
D0480AE22A4D45A700502818 /* App.swift */,
434-
D0480AE62A4D462F00502818 /* SwiftUI */,
435-
ADB097691F8B212800B81661 /* RatingPromptCounter.swift */,
436-
B5E98E341E529E66005221B7 /* functions.swift */,
427+
B52805141E3FA94D00EE832A /* AppDelegate.swift */,
437428
B5FFBB981E5EA60E00647121 /* Appearance.swift */,
438-
F57BD8B91E438E7600BD554C /* AppearanceProxies.swift */,
439-
B5E762641E40480300D63D62 /* UserDefaultsKey.swift */,
440-
2732D7C61E4300F300F149EF /* NotificationNames.swift */,
441-
D0DD456F229F11FF00AA94C1 /* AnalyticsManager.swift */,
442-
D05EDAF32B3280D700FD94BD /* ProtocolMock.swift */,
443429
B528051B1E3FA94D00EE832A /* Assets.xcassets */,
444-
B528051D1E3FA94D00EE832A /* LaunchScreen.storyboard */,
445-
B52805201E3FA94D00EE832A /* Info.plist */,
446430
ADAA03E424B48B38006695DD /* Colors.xcassets */,
431+
AD4D35F12EA67635008D9E85 /* Extensions */,
432+
D0BA59B71F9547270069DA58 /* FiveCalls.entitlements */,
433+
B5E98E341E529E66005221B7 /* functions.swift */,
434+
B52805201E3FA94D00EE832A /* Info.plist */,
435+
B528051D1E3FA94D00EE832A /* LaunchScreen.storyboard */,
436+
B5E7626C1E40D72400D63D62 /* Models */,
437+
2732D7C61E4300F300F149EF /* NotificationNames.swift */,
438+
B5E7626F1E40D74900D63D62 /* Operations */,
439+
D05EDAF32B3280D700FD94BD /* ProtocolMock.swift */,
440+
ADB097691F8B212800B81661 /* RatingPromptCounter.swift */,
441+
B502806D1E497C1400749ED7 /* Resources */,
442+
D0480AE62A4D462F00502818 /* SwiftUI */,
443+
B5E762641E40480300D63D62 /* UserDefaultsKey.swift */,
444+
B5E7626D1E40D72D00D63D62 /* View Models */,
447445
);
448446
path = FiveCalls;
449447
sourceTree = "<group>";
@@ -609,21 +607,6 @@
609607
name = PreviewContent;
610608
sourceTree = "<group>";
611609
};
612-
D0480B222A538E1000502818 /* Packages */ = {
613-
isa = PBXGroup;
614-
children = (
615-
);
616-
name = Packages;
617-
sourceTree = "<group>";
618-
};
619-
D05A17D02B05A1260048D5A6 /* Extensions */ = {
620-
isa = PBXGroup;
621-
children = (
622-
D09AA8052B0497C70012FF45 /* UNNotification+ScheduleReminders.swift */,
623-
);
624-
name = Extensions;
625-
sourceTree = "<group>";
626-
};
627610
D0BA59A91F9546510069DA58 /* NotificationsService */ = {
628611
isa = PBXGroup;
629612
children = (
@@ -669,6 +652,9 @@
669652
dependencies = (
670653
D0BA59AE1F9546510069DA58 /* PBXTargetDependency */,
671654
);
655+
fileSystemSynchronizedGroups = (
656+
AD4D35F12EA67635008D9E85 /* Extensions */,
657+
);
672658
name = FiveCalls;
673659
packageProductDependencies = (
674660
D0CFF332284A835F0082693E /* OneSignal */,
@@ -871,7 +857,6 @@
871857
buildActionMask = 2147483647;
872858
files = (
873859
D00E8B6A2CF056AF0028F935 /* NewsletterSignup.swift in Sources */,
874-
D09AA8062B0497C70012FF45 /* UNNotification+ScheduleReminders.swift in Sources */,
875860
D01235BD2B8C5A7D00FEE7A0 /* InboxView.swift in Sources */,
876861
D0983DD92A8209DA00DC90A6 /* LocationCoordinator.swift in Sources */,
877862
D09AA8032B04974C0012FF45 /* StatsViewModel.swift in Sources */,
@@ -934,7 +919,6 @@
934919
D0E950052C03A7B700E26304 /* InboxVote.swift in Sources */,
935920
D0002E192A9DB5FB0098973F /* PrimaryButton.swift in Sources */,
936921
4F4D2EB62AB8C59500882759 /* AboutSheet.swift in Sources */,
937-
F57BD8BA1E438E7600BD554C /* AppearanceProxies.swift in Sources */,
938922
D0A76F252A814786006EC2F5 /* LocationSheet.swift in Sources */,
939923
D0480AE52A4D462500502818 /* Dashboard.swift in Sources */,
940924
4FF4ABB42AB23FC8001A064A /* MultipleDayPicker.swift in Sources */,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>FILEHEADER</key>
6+
<string> Copyright 5calls. All rights reserved. See LICENSE for details.</string>
7+
</dict>
8+
</plist>

FiveCalls/FiveCalls/AboutListItem.swift

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
//
2-
// AboutListItem.swift
3-
// FiveCalls
4-
//
5-
// Created by Christopher Selin on 9/26/23.
6-
// Copyright © 2023 5calls. All rights reserved.
7-
//
1+
// Copyright 5calls. All rights reserved. See LICENSE for details.
82

93
import AcknowList
104
import SwiftUI
@@ -83,14 +77,13 @@ struct AboutListItem: View {
8377
.accessibilityHidden(true)
8478
}
8579
.accessibilityAddTraits(.isButton)
86-
8780
}
8881
}
8982
}
9083

9184
#Preview {
9285
VStack {
93-
AboutListItem(title: "test item action", type: .action({ let _ = true }))
86+
AboutListItem(title: "test item action", type: .action { _ = true })
9487
AboutListItem(title: "test url", type: .url(URL(string: "https://google.com")!))
9588
AboutListItem(title: "test acknowledgements", type: .acknowledgements)
9689
}

0 commit comments

Comments
 (0)