Skip to content

Commit

Permalink
Run `swiftlint —fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisho committed Jan 3, 2025
1 parent 1c1e9e0 commit 0758641
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions Tests/SpeziFHIRTests/FHIRResourceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ModelsR4
import XCTest

final class FHIRResourceTests: XCTestCase {

Check warning on line 14 in Tests/SpeziFHIRTests/FHIRResourceTests.swift

View workflow job for this annotation

GitHub Actions / Build and Test UI Tests / Test using xcodebuild or run fastlane

File Types Order Violation: A 'main_type' should not be placed amongst the file type(s) 'supporting_type' (file_types_order)

Check failure on line 14 in Tests/SpeziFHIRTests/FHIRResourceTests.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

File Types Order Violation: A 'main_type' should not be placed amongst the file type(s) 'supporting_type' (file_types_order)

let testDate = Date(timeIntervalSince1970: 1735123266)
let calendar = Calendar.current

Expand Down Expand Up @@ -410,22 +409,22 @@ private struct ModelsR4Mocks {
}

static func createCondition(date: Date) throws -> ModelsR4.Condition {
return ModelsR4.Condition(
ModelsR4.Condition(
id: "condition-id".asFHIRStringPrimitive(),
onset: .dateTime(FHIRPrimitive(try DateTime(date: date))),
subject: Reference(id: "patient-id".asFHIRStringPrimitive())
)
}

static func createDevice(date: Date) throws -> ModelsR4.Device {
return ModelsR4.Device(
ModelsR4.Device(
id: "device-id".asFHIRStringPrimitive(),
manufactureDate: FHIRPrimitive(try DateTime(date: date))
)
}

static func createDiagnosticReport(date: Date) throws -> ModelsR4.DiagnosticReport {
return ModelsR4.DiagnosticReport(
ModelsR4.DiagnosticReport(
code: CodeableConcept(coding: [Coding(code: "code".asFHIRStringPrimitive())]),
effective: .dateTime(FHIRPrimitive(try DateTime(date: date))),
id: "diagnostic-report-id".asFHIRStringPrimitive(),
Expand Down Expand Up @@ -492,7 +491,7 @@ private struct ModelsR4Mocks {
}

static func createImmunization(date: Date) throws -> ModelsR4.Immunization {
return ModelsR4.Immunization(
ModelsR4.Immunization(
id: "immunization-id".asFHIRStringPrimitive(),
occurrence: .dateTime(FHIRPrimitive(try DateTime(date: date))),
patient: Reference(id: "patient-id".asFHIRStringPrimitive()),
Expand All @@ -506,7 +505,7 @@ private struct ModelsR4Mocks {
}

static func createMedicationRequest(date: Date) throws -> ModelsR4.MedicationRequest {
return ModelsR4.MedicationRequest(
ModelsR4.MedicationRequest(
authoredOn: FHIRPrimitive(try DateTime(date: date)),
id: "medication-request-id".asFHIRStringPrimitive(),
intent: FHIRPrimitive(.order),
Expand All @@ -521,7 +520,7 @@ private struct ModelsR4Mocks {
}

static func createMedicationAdministration(date: Date) throws -> ModelsR4.MedicationAdministration {
return ModelsR4.MedicationAdministration(
ModelsR4.MedicationAdministration(
effective: .dateTime(FHIRPrimitive(try DateTime(date: date))),
id: "medication-administration-id".asFHIRStringPrimitive(),
medication: .codeableConcept(
Expand All @@ -535,7 +534,7 @@ private struct ModelsR4Mocks {
}

static func createObservation(date: Date) throws -> ModelsR4.Observation {
return ModelsR4.Observation(
ModelsR4.Observation(
code: CodeableConcept(coding: [Coding(code: "code".asFHIRStringPrimitive())]),
id: "observation-id".asFHIRStringPrimitive(),
issued: FHIRPrimitive(try Instant(date: date)),
Expand All @@ -544,7 +543,7 @@ private struct ModelsR4Mocks {
}

static func createProcedure(date: Date) throws -> ModelsR4.Procedure {
return ModelsR4.Procedure(
ModelsR4.Procedure(
id: "procedure-id".asFHIRStringPrimitive(),
performed: .dateTime(FHIRPrimitive(try DateTime(date: date))),
status: FHIRPrimitive(.completed),
Expand All @@ -553,14 +552,14 @@ private struct ModelsR4Mocks {
}

static func createPatient(date: Date) throws -> ModelsR4.Patient {
return ModelsR4.Patient(
ModelsR4.Patient(
birthDate: FHIRPrimitive(try FHIRDate(date: date)),
id: "patient-id".asFHIRStringPrimitive()
)
}

static func createProvenance(date: Date) throws -> ModelsR4.Provenance {
return ModelsR4.Provenance(
ModelsR4.Provenance(
agent: [
ProvenanceAgent(
type: CodeableConcept(
Expand All @@ -578,7 +577,7 @@ private struct ModelsR4Mocks {
}

static func createSupplyDelivery(date: Date) throws -> ModelsR4.SupplyDelivery {
return ModelsR4.SupplyDelivery(
ModelsR4.SupplyDelivery(
id: "supply-delivery-id".asFHIRStringPrimitive(),
occurrence: .dateTime(FHIRPrimitive(try DateTime(date: date))),
status: FHIRPrimitive(.completed)
Expand All @@ -589,7 +588,7 @@ private struct ModelsR4Mocks {

private struct ModelsDSTU2Mocks {

Check failure on line 589 in Tests/SpeziFHIRTests/FHIRResourceTests.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

Convenience Type Violation: Types used for hosting only static members should be implemented as a caseless enum to avoid instantiation (convenience_type)
static func createObservation(date: Date) throws -> ModelsDSTU2.Observation {
return ModelsDSTU2.Observation(
ModelsDSTU2.Observation(
code: CodeableConcept(
coding: [
Coding(code: "code".asFHIRStringPrimitive())
Expand All @@ -602,7 +601,7 @@ private struct ModelsDSTU2Mocks {
}

static func createMedicationOrder(date: Date) throws -> ModelsDSTU2.MedicationOrder {
return ModelsDSTU2.MedicationOrder(
ModelsDSTU2.MedicationOrder(
dateWritten: FHIRPrimitive(try DateTime(date: date)),
id: "medication-order-id".asFHIRStringPrimitive(),
medication: .codeableConcept(
Expand All @@ -615,7 +614,7 @@ private struct ModelsDSTU2Mocks {
}

static func createMedicationStatement(date: Date) throws -> ModelsDSTU2.MedicationStatement {
return ModelsDSTU2.MedicationStatement(
ModelsDSTU2.MedicationStatement(
effective: .dateTime(FHIRPrimitive(try DateTime(date: date))),
id: "medication-statement-id".asFHIRStringPrimitive(),
medication: .codeableConcept(
Expand All @@ -629,7 +628,7 @@ private struct ModelsDSTU2Mocks {
}

static func createCondition(date: Date) throws -> ModelsDSTU2.Condition {
return ModelsDSTU2.Condition(
ModelsDSTU2.Condition(
code: CodeableConcept(
coding: [
Coding(code: "condition-code".asFHIRStringPrimitive())
Expand Down Expand Up @@ -663,4 +662,3 @@ private struct ModelsDSTU2Mocks {
)
}
}

Check failure on line 664 in Tests/SpeziFHIRTests/FHIRResourceTests.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

File Length Violation: File should contain 500 lines or less: currently contains 664 (file_length)

0 comments on commit 0758641

Please sign in to comment.