Skip to content

Commit

Permalink
Enable strict concurrency checking (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg authored Oct 28, 2024
1 parent 2109f13 commit 4f80218
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ jobs:
uses: StanfordBDHG/.github/.github/workflows/create-and-upload-coverage-report.yml@v2
with:
coveragereports: HealthKitOnOMH.xcresult
secrets:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 0 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 @@ -329,8 +327,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
29 changes: 25 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.8
// swift-tools-version:6.0

//
// This source file is part of the HealthKitOnOMH open source project
Expand All @@ -8,6 +8,7 @@
// SPDX-License-Identifier: MIT
//

import class Foundation.ProcessInfo
import PackageDescription


Expand All @@ -21,19 +22,39 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/StanfordBDHG/OMHModels.git", .upToNextMajor(from: "0.1.0"))
],
] + swiftLintPackage(),
targets: [
.target(
name: "HealthKitOnOMH",
dependencies: [
.product(name: "OMHModels", package: "OMHModels")
]
],
plugins: [] + swiftLintPlugin()
),
.testTarget(
name: "HealthKitOnOMHTests",
dependencies: [
.target(name: "HealthKitOnOMH")
]
],
plugins: [] + swiftLintPlugin()
)
]
)


func swiftLintPlugin() -> [Target.PluginUsage] {
// Fully quit Xcode and open again with `open --env SPEZI_DEVELOPMENT_SWIFTLINT /Applications/Xcode.app`
if ProcessInfo.processInfo.environment["SPEZI_DEVELOPMENT_SWIFTLINT"] != nil {
[.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")]
} else {
[]
}
}

func swiftLintPackage() -> [PackageDescription.Package.Dependency] {
if ProcessInfo.processInfo.environment["SPEZI_DEVELOPMENT_SWIFTLINT"] != nil {
[.package(url: "https://github.com/realm/SwiftLint.git", from: "0.55.1")]
} else {
[]
}
}

0 comments on commit 4f80218

Please sign in to comment.