Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatting: run code cleanup on entire project #1993

Merged
merged 3 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -19,10 +19,6 @@ class SdkSettings private constructor(private val awsSdk: ObjectNode?) {
SdkSettings(coreRustSettings.customizationConfig?.getObjectMember("awsSdk")?.orNull())
}

/** Path to the `sdk-default-configuration.json` config file */
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) }
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