Unverified Commit 70de0935 authored by david-perez's avatar david-perez Committed by GitHub
Browse files

Enable "TODOs" lint for server code (#1292)

Stale TODOs have been removed and new tracking issues have been cut to
provide context to the others.
parent c912b69f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ class ServerCodegenVisitor(context: PluginContext, private val codegenDecorator:
            model,
            codegenDecorator.crateManifestCustomizations(codegenContext),
            codegenDecorator.libRsCustomizations(codegenContext, listOf()),
            // TODO: Remove `requireDocs` and always require them once the server codegen is far enough along
            // TODO(https://github.com/awslabs/smithy-rs/issues/1287): Remove once the server codegen is far enough along.
            requireDocs = false
        )
        try {
+1 −1
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ class ServerOperationRegistryGenerator(
        val httpTrait = httpBindingResolver.httpTrait(this)
        val namespace = ServerRuntimeType.RequestSpecModule(runtimeConfig).fullyQualifiedName()

        // TODO: Support the `endpoint` trait: https://awslabs.github.io/smithy/1.0/spec/core/endpoint-traits.html#endpoint-trait
        // TODO(https://github.com/awslabs/smithy-rs/issues/950): Support the `endpoint` trait.
        val pathSegments = httpTrait.uri.segments.map {
            "$namespace::PathSegment::" +
                if (it.isGreedyLabel) "Greedy"
+1 −1
Original line number Diff line number Diff line
@@ -914,7 +914,7 @@ class ServerProtocolTestGenerator(

        // These are tests whose definitions in the `awslabs/smithy` repository are wrong.
        // This is because they have not been written from a server perspective, and as such the expected `params` field is incomplete.
        // TODO Contribute a PR to fix them upstream and remove them from this list once the fixes get published in the next Smithy release.
        // TODO(https://github.com/awslabs/smithy-rs/issues/1288): Contribute a PR to fix them upstream.
        private val BrokenRequestTests = mapOf(
            // https://github.com/awslabs/smithy/pull/1040
            Pair(RestJson, "RestJsonSupportsNaNFloatQueryValues") to ::fixRestJsonSupportsNaNFloatQueryValues,
+1 −1
Original line number Diff line number Diff line
@@ -705,7 +705,7 @@ private class ServerHttpBoundProtocolTraitImplGenerator(
                }
            }
            .joinToString(
                // TODO: tuple() is currently limited to 21 items
                // TODO(https://github.com/awslabs/smithy-rs/issues/1289): Note we're limited to 21 labels because of `tuple`.
                prefix = if (segments.size > 1) "#{Nom}::sequence::tuple::<_, _, #{Nom}::error::Error<&str>, _>((" else "",
                postfix = if (segments.size > 1) "))" else "",
                transform = { parser ->
+0 −2
Original line number Diff line number Diff line
@@ -32,13 +32,11 @@ class ServerProtocolLoader(private val supportedProtocols: ProtocolMap) {
            throw CodegenException("No matching protocol — service offers: ${protocols.keys}. We offer: ${supportedProtocols.keys}")
        }
        val pair = matchingProtocols.first()
        // TODO: is there a better way than an unsafe cast here?
        return Pair(pair.first, pair.second)
    }

    companion object {
        val DefaultProtocols = mapOf(
            // TODO: support other protocols.
            RestJson1Trait.ID to ServerRestJsonFactory(),
            RestXmlTrait.ID to ServerRestXmlFactory(),
        )
Loading