When contributing to this repository, please first discuss the change you wish to make via an issue with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
- Branch off a freshly pulled
masterand keep one issue per pull request. - Write the tests first: every payload round-trips through
encoded()andmake(from:), and new behavior gets a test through the public API (import HealthKitReporter, no@testable). - Update
README.mdwith a usage snippet for new public API, and add a demo row for it to the Example app. - Use a Conventional Commit title (
feat:,fix:,docs:, …;!for breaking changes). release-please derives the version and theCHANGELOG.mdentry from it, so don't bump versions or edit released changelog entries by hand. - You may merge the Pull Request once you have the sign-off of another developer, or if you do not have permission to do that, you may request the second reviewer to merge it for you.
We follow the Swift API Design Guidelines.
SwiftLint enforces the style (.swiftlint.yml, lines ≤ 110 characters; Tests/.swiftlint.yml allows longer
test bodies). Every violation fails CI.
CI runs these on every pull request; run them locally before pushing:
# Lint
swiftlint lint --strict
# Test on a simulator, with coverage (must stay ≥ COVERAGE_THRESHOLD in .github/workflows/ci.yml)
xcodebuild test -scheme HealthKitReporter \
-destination "platform=iOS Simulator,name=iPhone 17,OS=latest" \
-enableCodeCoverage YES -resultBundlePath TestResults.xcresult CODE_SIGNING_REQUIRED=NO
xcrun xccov view --report --only-targets TestResults.xcresult
# Build for watchOS
xcodebuild build -scheme HealthKitReporter \
-destination "generic/platform=watchOS Simulator" CODE_SIGNING_REQUIRED=NO
# Build the Example app and its watch companion
xcodebuild build -project Example/HealthKitReporter.xcodeproj -scheme HealthKitReporter_Example \
-destination "platform=iOS Simulator,name=iPhone 17,OS=latest" CODE_SIGNING_ALLOWED=NO
xcodebuild build -project Example/HealthKitReporter.xcodeproj -scheme HealthKitReporterWatch \
-destination "generic/platform=watchOS Simulator" CODE_SIGNING_ALLOWED=NO