Skip to content

Commit b0e01ad

Browse files
committed
Resolve linting issues
1 parent 1c8a663 commit b0e01ad

15 files changed

+394
-74
lines changed

.github/workflows/build_rust_binaries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ jobs:
5252

5353
- name: "🛠 Prepare Tools"
5454
run: |
55-
sh Support/prepare_build_tools
55+
sh Support/Scripts/prepare_build_tools
5656
5757
- name: "🎁 Build FFI binaries (skipping if cached)"
5858
if: steps.check_files.outputs.files_exists == 'false'
5959
run: |
60-
sh Support/build_rust_dependencies
60+
sh Support/Scripts/build_rust_dependencies

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let package = Package(
88
platforms: [
99
.macOS(.v13),
1010
.iOS(.v16),
11-
.tvOS(.v16)
11+
.tvOS(.v16),
1212
],
1313

1414
products: [
@@ -19,8 +19,8 @@ let package = Package(
1919

2020
.library(
2121
name: "PactSwiftMockServerLinux",
22-
targets: ["PactSwiftMockServerLinux"]
23-
)
22+
targets: ["PactSwiftMockServerLinux"],
23+
),
2424
],
2525

2626
dependencies: [

PactSwiftMockServer.xcodeproj/project.pbxproj

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
AD957F3A28A23B8400860AD1 /* SocketBinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD957F3928A23B8400860AD1 /* SocketBinder.swift */; };
5858
AD957F3B28A23B8400860AD1 /* SocketBinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD957F3928A23B8400860AD1 /* SocketBinder.swift */; };
5959
AD957F3C28A23B8400860AD1 /* SocketBinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD957F3928A23B8400860AD1 /* SocketBinder.swift */; };
60+
ADB659BE2D069CDC0049A39C /* TestStatusCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB659BD2D069CD60049A39C /* TestStatusCode.swift */; };
61+
ADB659BF2D069CDC0049A39C /* TestStatusCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB659BD2D069CD60049A39C /* TestStatusCode.swift */; };
6062
ADB97FDA26493D5900C54CA9 /* MockServerErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB97FD926493D5900C54CA9 /* MockServerErrorTests.swift */; };
6163
ADB97FDB26493D5900C54CA9 /* MockServerErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB97FD926493D5900C54CA9 /* MockServerErrorTests.swift */; };
6264
ADBEF3012648FCF200486C4A /* PactVerificationFailure.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADBEF2FC2648FCF200486C4A /* PactVerificationFailure.swift */; };
@@ -136,6 +138,7 @@
136138
AD93364C269C2EC30004EBD8 /* pact_ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pact_ffi.h; sourceTree = "<group>"; };
137139
AD9336A5269C33EB0004EBD8 /* libpact_ffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpact_ffi.a; sourceTree = "<group>"; };
138140
AD957F3928A23B8400860AD1 /* SocketBinder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketBinder.swift; sourceTree = "<group>"; };
141+
ADB659BD2D069CD60049A39C /* TestStatusCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestStatusCode.swift; sourceTree = "<group>"; };
139142
ADB97FD926493D5900C54CA9 /* MockServerErrorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockServerErrorTests.swift; sourceTree = "<group>"; };
140143
ADBEF2EA2648FB0600486C4A /* Target-macOS-Tests-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Target-macOS-Tests-Shared.xcconfig"; sourceTree = "<group>"; };
141144
ADBEF2EB2648FB0600486C4A /* Target-iOS-Tests-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Target-iOS-Tests-Debug.xcconfig"; sourceTree = "<group>"; };
@@ -314,6 +317,7 @@
314317
AD1598342648E522007CFAA5 /* Tests */ = {
315318
isa = PBXGroup;
316319
children = (
320+
ADB659BC2D069CD10049A39C /* Utils */,
317321
ADB97FD926493D5900C54CA9 /* MockServerErrorTests.swift */,
318322
AD1598512648F2E1007CFAA5 /* MockServerTests.swift */,
319323
ADC6C61226D0AFBD00844000 /* VerifierTests.swift */,
@@ -373,6 +377,14 @@
373377
path = Toolbox;
374378
sourceTree = "<group>";
375379
};
380+
ADB659BC2D069CD10049A39C /* Utils */ = {
381+
isa = PBXGroup;
382+
children = (
383+
ADB659BD2D069CD60049A39C /* TestStatusCode.swift */,
384+
);
385+
path = Utils;
386+
sourceTree = "<group>";
387+
};
376388
/* End PBXGroup section */
377389

378390
/* Begin PBXHeadersBuildPhase section */
@@ -412,7 +424,7 @@
412424
buildPhases = (
413425
AD1597EE2648DE0E007CFAA5 /* Headers */,
414426
AD1597EF2648DE0E007CFAA5 /* Sources */,
415-
ADE254FC26CDE3A100FA21A9 /* SwiftLint */,
427+
ADE254FC26CDE3A100FA21A9 /* Lint Project */,
416428
AD1597F02648DE0E007CFAA5 /* Frameworks */,
417429
AD1597F12648DE0E007CFAA5 /* Resources */,
418430
);
@@ -451,7 +463,7 @@
451463
buildPhases = (
452464
AD1598132648DF73007CFAA5 /* Headers */,
453465
AD1598142648DF73007CFAA5 /* Sources */,
454-
ADE254FD26CDE3C700FA21A9 /* SwiftLint */,
466+
ADE254FD26CDE3C700FA21A9 /* Lint Project */,
455467
AD1598152648DF73007CFAA5 /* Frameworks */,
456468
AD1598162648DF73007CFAA5 /* Resources */,
457469
);
@@ -490,6 +502,7 @@
490502
buildPhases = (
491503
AD38D2F2264A33E800124396 /* Headers */,
492504
AD38D2F3264A33E800124396 /* Sources */,
505+
ADB659BB2D069BA60049A39C /* Lint Project */,
493506
AD38D2F4264A33E800124396 /* Frameworks */,
494507
AD38D2F5264A33E800124396 /* Resources */,
495508
);
@@ -627,7 +640,26 @@
627640
/* End PBXResourcesBuildPhase section */
628641

629642
/* Begin PBXShellScriptBuildPhase section */
630-
ADE254FC26CDE3A100FA21A9 /* SwiftLint */ = {
643+
ADB659BB2D069BA60049A39C /* Lint Project */ = {
644+
isa = PBXShellScriptBuildPhase;
645+
alwaysOutOfDate = 1;
646+
buildActionMask = 2147483647;
647+
files = (
648+
);
649+
inputFileListPaths = (
650+
);
651+
inputPaths = (
652+
);
653+
name = "Lint Project";
654+
outputFileListPaths = (
655+
);
656+
outputPaths = (
657+
);
658+
runOnlyForDeploymentPostprocessing = 0;
659+
shellPath = /bin/sh;
660+
shellScript = "\"${SRCROOT}\"/Support/Scripts/BuildPhase/lint_project\n";
661+
};
662+
ADE254FC26CDE3A100FA21A9 /* Lint Project */ = {
631663
isa = PBXShellScriptBuildPhase;
632664
alwaysOutOfDate = 1;
633665
buildActionMask = 2147483647;
@@ -637,16 +669,16 @@
637669
);
638670
inputPaths = (
639671
);
640-
name = SwiftLint;
672+
name = "Lint Project";
641673
outputFileListPaths = (
642674
);
643675
outputPaths = (
644676
);
645677
runOnlyForDeploymentPostprocessing = 0;
646678
shellPath = /bin/sh;
647-
shellScript = "PATH={$PATH}:/opt/local/bin:/opt/homebrew/bin/:/usr/local/bin\n\"${SRCROOT}\"/Support/build_file_list_and_swiftlint PactSwiftMockServer ./.swiftlint.yml\n";
679+
shellScript = "\"${SRCROOT}\"/Support/Scripts/BuildPhase/lint_project\n";
648680
};
649-
ADE254FD26CDE3C700FA21A9 /* SwiftLint */ = {
681+
ADE254FD26CDE3C700FA21A9 /* Lint Project */ = {
650682
isa = PBXShellScriptBuildPhase;
651683
alwaysOutOfDate = 1;
652684
buildActionMask = 2147483647;
@@ -656,14 +688,14 @@
656688
);
657689
inputPaths = (
658690
);
659-
name = SwiftLint;
691+
name = "Lint Project";
660692
outputFileListPaths = (
661693
);
662694
outputPaths = (
663695
);
664696
runOnlyForDeploymentPostprocessing = 0;
665697
shellPath = /bin/sh;
666-
shellScript = "PATH={$PATH}:/opt/local/bin:/opt/homebrew/bin/:/usr/local/bin\n\"${SRCROOT}\"/Support/build_file_list_and_swiftlint PactSwiftMockServer ./.swiftlint.yml\n";
698+
shellScript = "\"${SRCROOT}\"/Support/Scripts/BuildPhase/lint_project\n";
667699
};
668700
/* End PBXShellScriptBuildPhase section */
669701

@@ -698,6 +730,7 @@
698730
A7840F83294C2ECA00CF22EF /* InteractionTests.swift in Sources */,
699731
A7840F86294C2ED800CF22EF /* PactTests.swift in Sources */,
700732
AD1598522648F2E1007CFAA5 /* MockServerTests.swift in Sources */,
733+
ADB659BF2D069CDC0049A39C /* TestStatusCode.swift in Sources */,
701734
A7840F78294AF20500CF22EF /* GenerateTests.swift in Sources */,
702735
);
703736
runOnlyForDeploymentPostprocessing = 0;
@@ -732,6 +765,7 @@
732765
A7840F84294C2ECA00CF22EF /* InteractionTests.swift in Sources */,
733766
A7840F87294C2ED800CF22EF /* PactTests.swift in Sources */,
734767
AD1598532648F2E1007CFAA5 /* MockServerTests.swift in Sources */,
768+
ADB659BE2D069CDC0049A39C /* TestStatusCode.swift in Sources */,
735769
A7840F79294AF20500CF22EF /* GenerateTests.swift in Sources */,
736770
);
737771
runOnlyForDeploymentPostprocessing = 0;

Sources/MockServer.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class MockServer {
9292
return nil
9393
}
9494
defer { pactffi_string_delete(cert) }
95-
95+
9696
return String(cString: cert)
9797
}
9898

@@ -106,7 +106,7 @@ public class MockServer {
106106
}
107107

108108
// MARK: - Interface
109-
109+
110110
/// - Returns: `true` when all expected requests have successfully matched.
111111
public var requestsMatched: Bool {
112112
guard port > 0 else {
@@ -178,7 +178,7 @@ extension MockServer.Error: RawRepresentable {
178178
self = .unknown(rawValue)
179179
}
180180
}
181-
181+
182182
public var rawValue: Int32 {
183183
switch self {
184184
case .unknown(let value):

Sources/Model/Logging.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public enum Logging {
7777
/// Initialize the logger with no sinks.
7878
///
7979
/// This initialized logger does nothing until ``Logging/apply()`` has been called.
80-
@MainActor
80+
@MainActor
8181
@discardableResult
8282
private static func initialize() -> Bool {
8383
guard isInitialized == false else {
@@ -163,7 +163,7 @@ public enum Logging {
163163

164164
/// Get the last error message from the underlying `pact_ffi` library.
165165
public static var lastInternalErrorMessage: String? {
166-
withUnsafeTemporaryAllocation(of: CChar.self, capacity: 1_024) { buffer in // swiftlint:disable:this numbers_smell
166+
withUnsafeTemporaryAllocation(of: CChar.self, capacity: 1_024) { buffer in
167167
guard let baseAddress = buffer.baseAddress else {
168168
Logging.log(.error, message: "Failed to allocated temporary buffer!")
169169
return nil

Sources/Model/PactVerificationFailure.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extension PactVerificationFailure: Decodable {
7373
case request
7474
case mismatches
7575
}
76-
76+
7777
public init(from decoder: Decoder) throws {
7878
let container = try decoder.container(keyedBy: CodingKeys.self)
7979
type = try container.decode(FailureType.self, forKey: .type)

0 commit comments

Comments
 (0)