Skip to content

Commit

Permalink
formatting: run code cleanup on entire project (#1993)
Browse files Browse the repository at this point in the history
* formatting: run code cleanup on entire project

* revert: deletion of SdkSettings.defaultsConfigPath
  • Loading branch information
Velfi authored Nov 16, 2022
1 parent 445b7fe commit 927fe30
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ internal class AwsSdkReadmeGenerator {
private fun Element.normalizeLists() {
(getElementsByTag("ul") + getElementsByTag("ol"))
// Only operate on lists that are top-level (are not nested within other lists)
.filter { list -> list.parents().none() { it.isList() } }
.filter { list -> list.parents().none { it.isList() } }
.forEach { list -> list.normalizeList() }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ class SdkSettings private constructor(private val awsSdk: ObjectNode?) {
}

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

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

/** Path to AWS SDK integration tests */
val integrationTestPath: String get() =
awsSdk?.getStringMember("integrationTestPath")?.orNull()?.value ?: "aws/sdk/integration-tests"
val integrationTestPath: String
get() =
awsSdk?.getStringMember("integrationTestPath")?.orNull()?.value ?: "aws/sdk/integration-tests"

/** Version number of the `aws-config` crate */
val awsConfigVersion: String? get() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.customize.OperationCustom
import software.amazon.smithy.rust.codegen.core.smithy.customize.OperationSection
import software.amazon.smithy.rust.codegen.core.util.inputShape

class AccountIdAutofill() : OperationCustomization() {
class AccountIdAutofill : OperationCustomization() {
override fun mutSelf(): Boolean = true
override fun consumesSelf(): Boolean = false
override fun section(section: OperationSection): Writable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ class ProtocolTestGenerator(
testModuleWriter: RustWriter,
block: Writable,
) {
testModuleWriter.setNewlinePrefix("/// ")
testModuleWriter.newlinePrefix = "/// "
testCase.documentation.map {
testModuleWriter.writeWithNoFormatting(it)
}
testModuleWriter.write("Test ID: ${testCase.id}")
testModuleWriter.setNewlinePrefix("")
testModuleWriter.newlinePrefix = ""
TokioTest.render(testModuleWriter)
val action = when (testCase) {
is HttpResponseTestCase -> Action.Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ val SimpleShapes: Map<KClass<out Shape>, RustType> = mapOf(
data class SymbolVisitorConfig(
val runtimeConfig: RuntimeConfig,
val renameExceptions: Boolean,
val nullabilityCheckMode: NullableIndex.CheckMode,
val nullabilityCheckMode: CheckMode,
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class HttpBoundProtocolPayloadGenerator(
symbolProvider,
unionShape,
serializerGenerator,
contentType ?: throw CodegenException("event streams must set a content type"),
contentType,
).render()

// TODO(EventStream): [RPC] RPC protocols need to send an initial message with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PythonServerModuleGenerator(
""",
*codegenScope,
)
serviceShapes.forEach() { shape ->
serviceShapes.forEach { shape ->
val moduleType = moduleType(shape)
if (moduleType != null) {
rustTemplate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import software.amazon.smithy.rust.codegen.core.util.hasTrait
*
* See the [ShapesReachableFromOperationInputTagger] model transform for how it's used.
*/
class ShapeReachableFromOperationInputTagTrait() : AnnotationTrait(ID, Node.objectNode()) {
class ShapeReachableFromOperationInputTagTrait : AnnotationTrait(ID, Node.objectNode()) {
companion object {
val ID = ShapeId.from("smithy.api.internal#syntheticStructureReachableFromOperationInputTag")
}
Expand Down

0 comments on commit 927fe30

Please sign in to comment.