Skip to content

Commit 21608b2

Browse files
Merge pull request #115 from NeedleInAJayStack/chore/swiftformat
Chore: new swiftformat application
2 parents c275f65 + ed3121c commit 21608b2

23 files changed

+190
-86
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
- uses: actions/checkout@v3
1818
- uses: sinoru/actions-setup-swift@v2
1919
with:
20-
swift-version: '5.6.1'
20+
swift-version: '5.7.1'
2121
- name: GitHub Action for SwiftFormat
2222
uses: CassiusPacheco/[email protected]
2323
with:
24-
swiftformat-version: '0.49.11'
24+
swiftformat-version: '0.50.6'
2525

2626
macos:
2727
name: Build and test on macos-latest

Sources/GraphQL/GraphQL.swift

Lines changed: 104 additions & 46 deletions
Large diffs are not rendered by default.

Sources/GraphQL/GraphQLRequest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public struct GraphQLRequest: Equatable, Codable {
2424
/// This operation performs an entire AST parse on the GraphQL request, so consider
2525
/// performance when calling multiple times.
2626
///
27-
/// - Returns: True if request is a subscription, false if it is an atomic operation (like `query` or `mutation`)
27+
/// - Returns: True if request is a subscription, false if it is an atomic operation (like
28+
/// `query` or `mutation`)
2829
public func isSubscription() throws -> Bool {
2930
let documentAST = try GraphQL.parse(
3031
instrumentation: NoOpInstrumentation,

Sources/GraphQL/Instrumentation/DispatchQueueInstrumentationWrapper.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import NIO
44
/// Proxies calls through to another `Instrumentation` instance via a DispatchQueue
55
///
66
/// Has two primary use cases:
7-
/// 1. Allows a non thread safe Instrumentation implementation to be used along side a multithreaded execution strategy
8-
/// 2. Allows slow or heavy instrumentation processing to happen outside of the current query execution
7+
/// 1. Allows a non thread safe Instrumentation implementation to be used along side a multithreaded
8+
/// execution strategy
9+
/// 2. Allows slow or heavy instrumentation processing to happen outside of the current query
10+
/// execution
911
public class DispatchQueueInstrumentationWrapper: Instrumentation {
1012
let instrumentation: Instrumentation
1113
let dispatchQueue: DispatchQueue

Sources/GraphQL/Language/Parser.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,11 @@ func parseExtensionDefinition(lexer: Lexer) throws -> TypeSystemDefinition {
10081008
case "type": return try parseTypeExtensionDefinition(lexer: lexer)
10091009
case "schema": return try parseSchemaExtensionDefinition(lexer: lexer)
10101010
default:
1011-
throw syntaxError(source: lexer.source, position: token.start, description: "expected schema or type after extend")
1011+
throw syntaxError(
1012+
source: lexer.source,
1013+
position: token.start,
1014+
description: "expected schema or type after extend"
1015+
)
10121016
}
10131017
}
10141018

@@ -1041,7 +1045,8 @@ func parseSchemaExtensionDefinition(lexer: Lexer) throws -> SchemaExtensionDefin
10411045
description: description,
10421046
directives: directives,
10431047
operationTypes: []
1044-
))
1048+
)
1049+
)
10451050
}
10461051

10471052
/**

Sources/GraphQL/Language/Visitor.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ public enum VisitResult {
337337
/// A visitor is provided to visit, it contains the collection of
338338
/// relevant functions to be called during the visitor's traversal.
339339
public struct Visitor {
340-
/// A visitor is comprised of visit functions, which are called on each node during the visitor's traversal.
340+
/// A visitor is comprised of visit functions, which are called on each node during the
341+
/// visitor's traversal.
341342
public typealias Visit = (
342343
Node,
343344
IndexPathElement?,

Sources/GraphQL/Map/AnyCoder.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// swiftformat:disable all
12
import CoreFoundation
23
import Foundation
34

Sources/GraphQL/Map/GraphQLJSONEncoder.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// swiftformat:disable all
12
import Foundation
23
import OrderedCollections
34

Sources/GraphQL/Map/Map.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ extension Map: Codable {
634634
self = .array(array)
635635
} else if let _ = try? container.decode([String: Map].self) {
636636
// Override OrderedDictionary default (unkeyed alternating key-value)
637-
// Instead decode as a keyed container (like normal Dictionary) but use the order of the input
637+
// Instead decode as a keyed container (like normal Dictionary) but use the order of the
638+
// input
638639
let container = try decoder.container(keyedBy: _DictionaryCodingKey.self)
639640
var orderedDictionary: OrderedDictionary<String, Map> = [:]
640641
for key in container.allKeys {
@@ -676,8 +677,10 @@ extension Map: Codable {
676677
try container.encode(array)
677678
case let .dictionary(dictionary):
678679
// Override OrderedDictionary default (unkeyed alternating key-value)
679-
// Instead decode as a keyed container (like normal Dictionary) in the order of our OrderedDictionary
680-
// Note that `JSONEncoder` will ignore this because it uses `Dictionary` underneath. Instead, use `GraphQLJSONEncoder`.
680+
// Instead decode as a keyed container (like normal Dictionary) in the order of our
681+
// OrderedDictionary
682+
// Note that `JSONEncoder` will ignore this because it uses `Dictionary` underneath.
683+
// Instead, use `GraphQLJSONEncoder`.
681684
var container = encoder.container(keyedBy: _DictionaryCodingKey.self)
682685
for (key, value) in dictionary {
683686
if !value.isUndefined {

Sources/GraphQL/Map/MapCoder.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// swiftformat:disable all
12
import CoreFoundation
23
import Foundation
34
import OrderedCollections

0 commit comments

Comments
 (0)