Skip to content

Commit 4f961f7

Browse files
committed
Fix lint
1 parent 7ce66d4 commit 4f961f7

File tree

5 files changed

+38
-11
lines changed

5 files changed

+38
-11
lines changed

Sources/SmithyCodegenCore/ModelTransformer/Model+Deprecated.swift

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ extension Model {
5959
let operationIDs = serviceShape.operationIDs.filter { trimmedShapes[$0] != nil }
6060
let resourceIDs = serviceShape.resourceIDs.filter { trimmedShapes[$0] != nil }
6161
let errorIDs = serviceShape.errorIDs.filter { trimmedShapes[$0] != nil }
62-
return ServiceShape(id: serviceShape.id, traits: serviceShape.traits, operationIDs: operationIDs, resourceIDs: resourceIDs, errorIDs: errorIDs)
62+
return ServiceShape(
63+
id: serviceShape.id,
64+
traits: serviceShape.traits,
65+
operationIDs: operationIDs,
66+
resourceIDs: resourceIDs,
67+
errorIDs: errorIDs
68+
)
6369
case let resourceShape as ResourceShape:
6470
let operationIDs = resourceShape.operationIDs.filter { trimmedShapes[$0] != nil }
6571
let createID = resourceShape.createID.map { trimmedShapes[$0] != nil ? $0 : nil } ?? nil
@@ -68,10 +74,26 @@ extension Model {
6874
let updateID = resourceShape.updateID.map { trimmedShapes[$0] != nil ? $0 : nil } ?? nil
6975
let deleteID = resourceShape.deleteID.map { trimmedShapes[$0] != nil ? $0 : nil } ?? nil
7076
let listID = resourceShape.listID.map { trimmedShapes[$0] != nil ? $0 : nil } ?? nil
71-
return ResourceShape(id: resourceShape.id, traits: resourceShape.traits, operationIDs: operationIDs, createID: createID, putID: putID, readID: readID, updateID: updateID, deleteID: deleteID, listID: listID)
77+
return ResourceShape(
78+
id: resourceShape.id,
79+
traits: resourceShape.traits,
80+
operationIDs: operationIDs,
81+
createID: createID,
82+
putID: putID,
83+
readID: readID,
84+
updateID: updateID,
85+
deleteID: deleteID,
86+
listID: listID
87+
)
7288
case let operationShape as OperationShape:
7389
let errorIDs = operationShape.errorIDs.filter { trimmedShapes[$0] != nil }
74-
return OperationShape(id: operationShape.id, traits: operationShape.traits, inputID: operationShape.inputID, outputID: operationShape.outputID, errorIDs: errorIDs)
90+
return OperationShape(
91+
id: operationShape.id,
92+
traits: operationShape.traits,
93+
inputID: operationShape.inputID,
94+
outputID: operationShape.outputID,
95+
errorIDs: errorIDs
96+
)
7597
case let structureShape as StructureShape:
7698
let memberIDs = structureShape.memberIDs.filter { trimmedShapes[$0] != nil }
7799
return StructureShape(id: structureShape.id, traits: structureShape.traits, memberIDs: memberIDs)

Sources/SmithyCodegenCore/ModelTransformer/Model+InputOutput.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ extension Model {
4545
// Add UsedAsInput and UsedAsOutput traits to the input/output structures
4646
// These traits allow us to identify inputs/outputs by trait, but allow us to
4747
// leave the Smithy input & output traits as set on the original model.
48-
let newInputShape = newStruct(newID: newInputShapeID, newTraits: [UsedAsInputTrait()], original: inputShape)
48+
let newInput = newStruct(newID: newInputShapeID, newTraits: [UsedAsInputTrait()], original: inputShape)
4949
let newInputShapeMembers = try renamedMembers(newID: newInputShapeID, original: inputShape)
50-
let newOutputShape = newStruct(newID: newOutputShapeID, newTraits: [UsedAsOutputTrait()], original: outputShape)
50+
let newOutput = newStruct(newID: newOutputShapeID, newTraits: [UsedAsOutputTrait()], original: outputShape)
5151
let newOutputShapeMembers = try renamedMembers(newID: newOutputShapeID, original: outputShape)
5252

5353
// Add the new input & output and their members to the new shape dictionary.
5454
// The originals will remain and will be pruned later if they are unreferenced.
55-
newShapes[newInputShape.id] = newInputShape
55+
newShapes[newInput.id] = newInput
5656
newInputShapeMembers.forEach { newShapes[$0.id] = $0 }
57-
newShapes[newOutputShape.id] = newOutputShape
57+
newShapes[newOutput.id] = newOutput
5858
newOutputShapeMembers.forEach { newShapes[$0.id] = $0 }
5959

6060
// Make a new operation with the new input & output IDs

Sources/SmithyCodegenCore/SwiftRendering/SwiftWriter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class SwiftWriter {
4343
lines.append(String(repeating: " ", count: indentLevel) + line)
4444
}
4545
}
46-
46+
4747
/// Removes previously written text.
4848
///
4949
/// If the unwritten text matches the end of the last written line, then that text will be removed from that line.

Sources/SmithySerialization/Deserialization/ShapeDeserializer.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ public protocol ShapeDeserializer {
3131
func readTimestamp(_ schema: Schema) throws -> Date
3232
func readNull<T>(_ schema: Schema) throws -> T?
3333
func readDataStream(_ schema: Schema) throws -> ByteStream
34-
func readEventStream<E: DeserializableStruct>(_ schema: Schema, _ value: inout E) throws -> AsyncThrowingStream<E, any Error>
34+
func readEventStream<E: DeserializableStruct>(
35+
_ schema: Schema,
36+
_ value: inout E
37+
) throws -> AsyncThrowingStream<E, any Error>
3538
func isNull() throws -> Bool
3639
var containerSize: Int { get }
3740
}
@@ -71,7 +74,10 @@ public extension ShapeDeserializer {
7174
return ByteStream.data(nil)
7275
}
7376

74-
func readEventStream<E: DeserializableStruct>(_ schema: Schema, _ value: inout E) throws -> AsyncThrowingStream<E, any Error> {
77+
func readEventStream<E: DeserializableStruct>(
78+
_ schema: Schema,
79+
_ value: inout E
80+
) throws -> AsyncThrowingStream<E, any Error> {
7581
// by default, do nothing
7682
return AsyncThrowingStream { continuation in
7783
continuation.finish()

smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/SmithyModelFileInfoGenerator.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package software.amazon.smithy.swift.codegen
22

33
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
4-
import software.amazon.smithy.swift.codegen.integration.serde.SerdeUtils
54

65
class SmithyModelFileInfoGenerator(
76
val ctx: ProtocolGenerator.GenerationContext,

0 commit comments

Comments
 (0)