Skip to content

Commit

Permalink
Enable CodeQL Reporting (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer authored Aug 7, 2023
1 parent 2b96d73 commit 0400734
Show file tree
Hide file tree
Showing 13 changed files with 174 additions and 97 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/beta-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ jobs:
buildandtest:
name: Build and Test
uses: ./.github/workflows/build-and-test.yml
secrets: inherit
iosapptestflightdeployment:
name: iOS App TestFlight Deployment
needs: buildandtest
uses: CS342/.github/.github/workflows/xcodebuild-or-fastlane.yml@v1
uses: CS342/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
secrets: inherit
with:
artifactname: PAWS.xcresult
runsonlabels: '["macos-latest"]'
fastlanelane: beta
setupsigning: true
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
uses: StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2
buildandtest:
name: Build and Test
uses: CS342/.github/.github/workflows/xcodebuild-or-fastlane.yml@v1
uses: CS342/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
with:
codeql: true
artifactname: PAWS.xcresult
runsonlabels: '["macos-latest"]'
setupfirebaseemulator: true
customcommand: "firebase emulators:exec 'fastlane test'"
uploadcoveragereport:
Expand Down
8 changes: 4 additions & 4 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ only_rules:
- implicitly_unwrapped_optional
# Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status
- inclusive_language
# If defer is at the end of its parent scope, it will be executed right where it is anyway.
- inert_defer
# Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty.
- is_disjoint
# Discouraged explicit usage of the default separator.
Expand Down Expand Up @@ -331,8 +329,6 @@ only_rules:
- unowned_variable_capture
# Catch statements should not declare error variables without type casting.
- untyped_error_in_catch
# Unused reference in a capture list should be removed.
- unused_capture_list
# Unused parameter in a closure should be replaced with _.
- unused_closure_parameter
# Unused control flow label should be removed.
Expand Down Expand Up @@ -373,13 +369,17 @@ only_rules:
# The variable should be placed on the left, the constant on the right of a comparison operator.
- yoda_condition

attributes:
attributes_with_arguments_always_on_line_above: false

deployment_target: # Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.
iOSApplicationExtension_deployment_target: 16.0
iOS_deployment_target: 16.0

excluded: # paths to ignore during linting. Takes precedence over `included`.
- .build
- .swiftpm
- .derivedData

closure_body_length: # Closure bodies should not span too many lines.
- 35 # warning - default: 20
Expand Down
24 changes: 10 additions & 14 deletions PAWS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
2F4E23812989C5930013F3D9 /* XCTHealthKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2F4E23802989C5930013F3D9 /* XCTHealthKit */; };
2F4E23832989D51F0013F3D9 /* PAWSAppTestingSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E23822989D51F0013F3D9 /* PAWSAppTestingSetup.swift */; };
2F4E23872989DB360013F3D9 /* ContactsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E23862989DB360013F3D9 /* ContactsTests.swift */; };
2F4E23892989DB400013F3D9 /* HealthKitUploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E23882989DB400013F3D9 /* HealthKitUploadTests.swift */; };
2F59B93D298C628800C5107F /* PAWSContacts in Frameworks */ = {isa = PBXBuildFile; productRef = 2F59B93C298C628800C5107F /* PAWSContacts */; };
2F59B93F298C628800C5107F /* PAWSMockDataStorageProvider in Frameworks */ = {isa = PBXBuildFile; productRef = 2F59B93E298C628800C5107F /* PAWSMockDataStorageProvider */; };
2F59B941298C628800C5107F /* PAWSOnboardingFlow in Frameworks */ = {isa = PBXBuildFile; productRef = 2F59B940298C628800C5107F /* PAWSOnboardingFlow */; };
Expand Down Expand Up @@ -64,7 +63,6 @@
2F4E237D2989A2FE0013F3D9 /* OnboardingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingTests.swift; sourceTree = "<group>"; };
2F4E23822989D51F0013F3D9 /* PAWSAppTestingSetup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PAWSAppTestingSetup.swift; sourceTree = "<group>"; };
2F4E23862989DB360013F3D9 /* ContactsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsTests.swift; sourceTree = "<group>"; };
2F4E23882989DB400013F3D9 /* HealthKitUploadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HealthKitUploadTests.swift; sourceTree = "<group>"; };
2F5E32BC297E05EA003432F8 /* PAWSAppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PAWSAppDelegate.swift; sourceTree = "<group>"; };
2F9056D9299E1C97003D3802 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
2FAEC07F297F583900C11C42 /* PAWS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PAWS.entitlements; sourceTree = "<group>"; };
Expand Down Expand Up @@ -185,7 +183,6 @@
2F4E237D2989A2FE0013F3D9 /* OnboardingTests.swift */,
2F4E23862989DB360013F3D9 /* ContactsTests.swift */,
2F36AD23299D93E200B1077C /* NotificationsTests.swift */,
2F4E23882989DB400013F3D9 /* HealthKitUploadTests.swift */,
);
path = PAWSUITests;
sourceTree = "<group>";
Expand Down Expand Up @@ -402,7 +399,6 @@
files = (
2F4E23872989DB360013F3D9 /* ContactsTests.swift in Sources */,
2F36AD24299D93E200B1077C /* NotificationsTests.swift in Sources */,
2F4E23892989DB400013F3D9 /* HealthKitUploadTests.swift in Sources */,
2F4E237E2989A2FE0013F3D9 /* OnboardingTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -423,7 +419,7 @@
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
2FE8D00A2A42722400A00A22 /* Test */ = {
2F82DB262A80C04F0029346E /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
Expand Down Expand Up @@ -483,7 +479,7 @@
};
name = Test;
};
2FE8D00B2A42722400A00A22 /* Test */ = {
2F82DB272A80C04F0029346E /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down Expand Up @@ -529,7 +525,7 @@
};
name = Test;
};
2FE8D00C2A42722400A00A22 /* Test */ = {
2F82DB282A80C04F0029346E /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
Expand All @@ -549,7 +545,7 @@
};
name = Test;
};
2FE8D00D2A42722400A00A22 /* Test */ = {
2F82DB292A80C04F0029346E /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
Expand Down Expand Up @@ -861,7 +857,7 @@
isa = XCConfigurationList;
buildConfigurations = (
653A256F28338800005D4D48 /* Debug */,
2FE8D00A2A42722400A00A22 /* Test */,
2F82DB262A80C04F0029346E /* Test */,
653A257028338800005D4D48 /* Release */,
);
defaultConfigurationIsVisible = 0;
Expand All @@ -871,7 +867,7 @@
isa = XCConfigurationList;
buildConfigurations = (
653A257228338800005D4D48 /* Debug */,
2FE8D00B2A42722400A00A22 /* Test */,
2F82DB272A80C04F0029346E /* Test */,
653A257328338800005D4D48 /* Release */,
);
defaultConfigurationIsVisible = 0;
Expand All @@ -881,7 +877,7 @@
isa = XCConfigurationList;
buildConfigurations = (
653A257528338800005D4D48 /* Debug */,
2FE8D00C2A42722400A00A22 /* Test */,
2F82DB282A80C04F0029346E /* Test */,
653A257628338800005D4D48 /* Release */,
);
defaultConfigurationIsVisible = 0;
Expand All @@ -891,7 +887,7 @@
isa = XCConfigurationList;
buildConfigurations = (
653A257828338800005D4D48 /* Debug */,
2FE8D00D2A42722400A00A22 /* Test */,
2F82DB292A80C04F0029346E /* Test */,
653A257928338800005D4D48 /* Release */,
);
defaultConfigurationIsVisible = 0;
Expand All @@ -905,7 +901,7 @@
repositoryURL = "https://github.com/StanfordBDHG/XCTestExtensions";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.4.3;
minimumVersion = 0.4.6;
};
};
2F49B7742980407B00BCB272 /* XCRemoteSwiftPackageReference "CardinalKit" */ = {
Expand All @@ -921,7 +917,7 @@
repositoryURL = "https://github.com/StanfordBDHG/XCTHealthKit";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.3.3;
minimumVersion = 0.3.5;
};
};
2F9F4D8129B7FFAE00ABE259 /* XCRemoteSwiftPackageReference "CardinalKitHealthKitToFHIRAdapter" */ = {
Expand Down
84 changes: 84 additions & 0 deletions PAWS.xcodeproj/xcshareddata/xcschemes/PAWS.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,90 @@
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PAWSLandingScreen"
BuildableName = "PAWSLandingScreen"
BlueprintName = "PAWSLandingScreen"
ReferencedContainer = "container:PAWSModules">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PAWSMockDataStorageProvider"
BuildableName = "PAWSMockDataStorageProvider"
BlueprintName = "PAWSMockDataStorageProvider"
ReferencedContainer = "container:PAWSModules">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PAWSSharedContext"
BuildableName = "PAWSSharedContext"
BlueprintName = "PAWSSharedContext"
ReferencedContainer = "container:PAWSModules">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PAWSNotificationScreen"
BuildableName = "PAWSNotificationScreen"
BlueprintName = "PAWSNotificationScreen"
ReferencedContainer = "container:PAWSModules">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PAWSContacts"
BuildableName = "PAWSContacts"
BlueprintName = "PAWSContacts"
ReferencedContainer = "container:PAWSModules">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PAWSOnboardingFlow"
BuildableName = "PAWSOnboardingFlow"
BlueprintName = "PAWSOnboardingFlow"
ReferencedContainer = "container:PAWSModules">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
Expand Down
39 changes: 39 additions & 0 deletions PAWS.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,45 @@
}
],
"defaultOptions" : {
"codeCoverage" : {
"targets" : [
{
"containerPath" : "container:PAWS.xcodeproj",
"identifier" : "653A254C283387FE005D4D48",
"name" : "PAWS"
},
{
"containerPath" : "container:PAWSModules",
"identifier" : "PAWSContacts",
"name" : "PAWSContacts"
},
{
"containerPath" : "container:PAWSModules",
"identifier" : "PAWSLandingScreen",
"name" : "PAWSLandingScreen"
},
{
"containerPath" : "container:PAWSModules",
"identifier" : "PAWSMockDataStorageProvider",
"name" : "PAWSMockDataStorageProvider"
},
{
"containerPath" : "container:PAWSModules",
"identifier" : "PAWSNotificationScreen",
"name" : "PAWSNotificationScreen"
},
{
"containerPath" : "container:PAWSModules",
"identifier" : "PAWSOnboardingFlow",
"name" : "PAWSOnboardingFlow"
},
{
"containerPath" : "container:PAWSModules",
"identifier" : "PAWSSharedContext",
"name" : "PAWSSharedContext"
}
]
},
"targetForVariableExpansion" : {
"containerPath" : "container:PAWS.xcodeproj",
"identifier" : "653A254C283387FE005D4D48",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public actor MockDataStorageProvider: DataStorageProvider, ObservableObjectProvi
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
return encoder
}()
@MainActor @Published
private (set) var mockUploads: [MockUpload] = []
@MainActor @Published private (set) var mockUploads: [MockUpload] = []


public init() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ struct AccountSetup: View {
}
}

@ViewBuilder
private var accountImage: some View {
@ViewBuilder private var accountImage: some View {
Group {
if account.signedIn {
backgroundGradient
Expand All @@ -93,8 +92,7 @@ struct AccountSetup: View {
.foregroundColor(.accentColor)
}

@ViewBuilder
private var accountDescription: some View {
@ViewBuilder private var accountDescription: some View {
VStack {
Group {
if account.signedIn {
Expand All @@ -112,8 +110,7 @@ struct AccountSetup: View {
}
}

@ViewBuilder
private var actionView: some View {
@ViewBuilder private var actionView: some View {
if account.signedIn {
OnboardingActionsView(
"ACCOUNT_NEXT".moduleLocalized,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ struct UserView: View {
}


@ViewBuilder
private var userInformation: some View {
@ViewBuilder private var userInformation: some View {
HStack(spacing: 16) {
if account.signedIn,
let user = firebaseAccountConfiguration.user,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ reported symptoms, and any detected abnormalities. ";
"HEALTHKIT_PERMISSIONS_BUTTON" = "Grant Access";

// MARK: NOTIFICATIONS VIEW
"ALLOW_NOTIFICATIONS_BUTTON" = "Allow notifications";
"ALLOW_NOTIFICATIONS_BUTTON" = "Allow Notifications";
"NOTIFICATION_SETUP_TITLE" = "Notifications";
"NOTIFICATION_SETUP_SUBTITLE" = "Want to receive friendly reminders for the first week of the PAWS study? Choose your preferred time of day to receive notifications below and click allow.";

Loading

0 comments on commit 0400734

Please sign in to comment.