Skip to content

Commit 927fe30

Browse files
author
Zelda Hessler
authored
formatting: run code cleanup on entire project (#1993)
* formatting: run code cleanup on entire project * revert: deletion of SdkSettings.defaultsConfigPath
1 parent 445b7fe commit 927fe30

File tree

8 files changed

+17
-14
lines changed

8 files changed

+17
-14
lines changed

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsReadmeDecorator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ internal class AwsSdkReadmeGenerator {
218218
private fun Element.normalizeLists() {
219219
(getElementsByTag("ul") + getElementsByTag("ol"))
220220
// Only operate on lists that are top-level (are not nested within other lists)
221-
.filter { list -> list.parents().none() { it.isList() } }
221+
.filter { list -> list.parents().none { it.isList() } }
222222
.forEach { list -> list.normalizeList() }
223223
}
224224

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SdkSettings.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@ class SdkSettings private constructor(private val awsSdk: ObjectNode?) {
2020
}
2121

2222
/** Path to the `sdk-default-configuration.json` config file */
23-
val defaultsConfigPath: Path? get() =
24-
awsSdk?.getStringMember("defaultConfigPath")?.orNull()?.value.let { Paths.get(it) }
23+
val defaultsConfigPath: Path?
24+
get() =
25+
awsSdk?.getStringMember("defaultConfigPath")?.orNull()?.value.let { Paths.get(it) }
2526

2627
/** Path to the `sdk-endpoints.json` configuration */
27-
val endpointsConfigPath: Path? get() =
28-
awsSdk?.getStringMember("endpointsConfigPath")?.orNull()?.value?.let { Paths.get(it) }
28+
val endpointsConfigPath: Path?
29+
get() =
30+
awsSdk?.getStringMember("endpointsConfigPath")?.orNull()?.value?.let { Paths.get(it) }
2931

3032
/** Path to AWS SDK integration tests */
31-
val integrationTestPath: String get() =
32-
awsSdk?.getStringMember("integrationTestPath")?.orNull()?.value ?: "aws/sdk/integration-tests"
33+
val integrationTestPath: String
34+
get() =
35+
awsSdk?.getStringMember("integrationTestPath")?.orNull()?.value ?: "aws/sdk/integration-tests"
3336

3437
/** Version number of the `aws-config` crate */
3538
val awsConfigVersion: String? get() =

aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/glacier/AccountIdAutofill.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.customize.OperationCustom
1414
import software.amazon.smithy.rust.codegen.core.smithy.customize.OperationSection
1515
import software.amazon.smithy.rust.codegen.core.util.inputShape
1616

17-
class AccountIdAutofill() : OperationCustomization() {
17+
class AccountIdAutofill : OperationCustomization() {
1818
override fun mutSelf(): Boolean = true
1919
override fun consumesSelf(): Boolean = false
2020
override fun section(section: OperationSection): Writable {

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/protocol/ProtocolTestGenerator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ class ProtocolTestGenerator(
138138
testModuleWriter: RustWriter,
139139
block: Writable,
140140
) {
141-
testModuleWriter.setNewlinePrefix("/// ")
141+
testModuleWriter.newlinePrefix = "/// "
142142
testCase.documentation.map {
143143
testModuleWriter.writeWithNoFormatting(it)
144144
}
145145
testModuleWriter.write("Test ID: ${testCase.id}")
146-
testModuleWriter.setNewlinePrefix("")
146+
testModuleWriter.newlinePrefix = ""
147147
TokioTest.render(testModuleWriter)
148148
val action = when (testCase) {
149149
is HttpResponseTestCase -> Action.Response

codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ val SimpleShapes: Map<KClass<out Shape>, RustType> = mapOf(
6666
data class SymbolVisitorConfig(
6767
val runtimeConfig: RuntimeConfig,
6868
val renameExceptions: Boolean,
69-
val nullabilityCheckMode: NullableIndex.CheckMode,
69+
val nullabilityCheckMode: CheckMode,
7070
)
7171

7272
/**

codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/HttpBoundProtocolPayloadGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class HttpBoundProtocolPayloadGenerator(
193193
symbolProvider,
194194
unionShape,
195195
serializerGenerator,
196-
contentType ?: throw CodegenException("event streams must set a content type"),
196+
contentType,
197197
).render()
198198

199199
// TODO(EventStream): [RPC] RPC protocols need to send an initial message with the

codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/generators/PythonServerModuleGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PythonServerModuleGenerator(
6565
""",
6666
*codegenScope,
6767
)
68-
serviceShapes.forEach() { shape ->
68+
serviceShapes.forEach { shape ->
6969
val moduleType = moduleType(shape)
7070
if (moduleType != null) {
7171
rustTemplate(

codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/traits/ShapeReachableFromOperationInputTagTrait.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import software.amazon.smithy.rust.codegen.core.util.hasTrait
2323
*
2424
* See the [ShapesReachableFromOperationInputTagger] model transform for how it's used.
2525
*/
26-
class ShapeReachableFromOperationInputTagTrait() : AnnotationTrait(ID, Node.objectNode()) {
26+
class ShapeReachableFromOperationInputTagTrait : AnnotationTrait(ID, Node.objectNode()) {
2727
companion object {
2828
val ID = ShapeId.from("smithy.api.internal#syntheticStructureReachableFromOperationInputTag")
2929
}

0 commit comments

Comments
 (0)