Skip to content

Commit

Permalink
Bump swift-format to 5.9 (#340)
Browse files Browse the repository at this point in the history
Bump swift-format to 5.9

### Motivation

As per #175.

### Modifications

Updated to swift-format 5.9, updated code to pass soundness.

### Result

Using swift-format 5.9.

### Test Plan

Soundness passed.


Reviewed by: dnadoba

Builds:
     ✔︎ pull request validation (5.10) - Build finished. 
     ✔︎ pull request validation (5.8) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (compatibility test) - Build finished. 
     ✔︎ pull request validation (docc test) - Build finished. 
     ✔︎ pull request validation (integration test) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

#340
  • Loading branch information
czechboy0 authored Oct 23, 2023
1 parent 4ebe476 commit 110de34
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Sources/_OpenAPIGeneratorCore/PlatformChecks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
// Emit a compiler error if this library is linked with a target in an adopter
// project.
#if !(os(macOS) || os(Linux))
#error("_OpenAPIGeneratorCore is only to be used by swift-openapi-generator itself—your target should not link this library or the command line tool directly.")
#error(
"_OpenAPIGeneratorCore is only to be used by swift-openapi-generator itself—your target should not link this library or the command line tool directly."
)
#endif

#if SWIFT_OPENAPI_STRICT_CONCURRENCY
Expand Down
2 changes: 2 additions & 0 deletions Tests/OpenAPIGeneratorCoreTests/TestUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import OpenAPIKit
@testable import _OpenAPIGeneratorCore

class Test_Core: XCTestCase {

/// Setup method called before the invocation of each test method in the class.
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import OpenAPIKit

final class Test_TypeMatcher: Test_Core {

/// Setup method called before the invocation of each test method in the class.
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ final class CompatibilityTest: XCTestCase {
let compatibilityTestParallelCodegen = getBoolEnv("SWIFT_OPENAPI_COMPATIBILITY_TEST_PARALLEL_CODEGEN") ?? false
let compatibilityTestNumBuildJobs = getIntEnv("SWIFT_OPENAPI_COMPATIBILITY_TEST_NUM_BUILD_JOBS")

/// Setup method called before the invocation of each test method in the class.
override func setUp() async throws {
continueAfterFailure = false
try XCTSkipUnless(compatibilityTestEnabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ extension TestConfig {

/// Tests that the generator produces Swift files that match a reference.
class FileBasedReferenceTests: XCTestCase {

/// Setup method called before the invocation of each test method in the class.
override func setUp() {
super.setUp()
continueAfterFailure = false
Expand All @@ -56,6 +58,7 @@ class FileBasedReferenceTests: XCTestCase {

var referenceTestResourcesDirectory: URL! = nil

/// Setup method called before the invocation of each test method in the class.
override func setUpWithError() throws {
self.referenceTestResourcesDirectory = try XCTUnwrap(
Bundle.module.url(forResource: "Resources", withExtension: nil),
Expand Down
1 change: 1 addition & 0 deletions Tests/PetstoreConsumerTests/Test_Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ final class Test_Client: XCTestCase {
}
}

/// Setup method called before the invocation of each test method in the class.
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
Expand Down
2 changes: 2 additions & 0 deletions Tests/PetstoreConsumerTests/Test_Playground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import OpenAPIRuntime
import PetstoreConsumerTestCore

final class Test_Playground: XCTestCase {

/// Setup method called before the invocation of each test method in the class.
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
Expand Down
1 change: 1 addition & 0 deletions Tests/PetstoreConsumerTests/Test_Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ final class Test_Server: XCTestCase {
}
}

/// Setup method called before the invocation of each test method in the class.
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
Expand Down
1 change: 1 addition & 0 deletions Tests/PetstoreConsumerTests/Test_Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import PetstoreConsumerTestCore

final class Test_Types: XCTestCase {

/// Setup method called before the invocation of each test method in the class.
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN mkdir -p $HOME/.tools
RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile

# swift-format
ARG swiftformat_version=508.0.0
ARG swiftformat_version=509.0.0
RUN git clone --branch $swiftformat_version --depth 1 https://github.com/apple/swift-format $HOME/.tools/swift-format-source
RUN cd $HOME/.tools/swift-format-source && swift build -c release
RUN ln -s $HOME/.tools/swift-format-source/.build/release/swift-format $HOME/.tools/swift-format
Expand Down

0 comments on commit 110de34

Please sign in to comment.