Unverified Commit 9f1ef3d4 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

More work on cleaning up TODOs (#997)

* wip

* wip

* Refactor lint tool

* Add a lint to validate that TODOs have context

* cleanup lint some more

* fix codegen failure & remove unused arguments
parent e38c5314
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ class EndpointResolverGenerator(codegenContext: CodegenContext, private val endp

        private fun signatureVersion(): String {
            val signatureVersions = endpoint.expectArrayMember("signatureVersions").map { it.expectStringNode().value }
            // TODO: we can use this to change the signing options instead of customizing S3 specifically
            // TODO(https://github.com/awslabs/smithy-rs/issues/977): we can use this to change the signing options instead of customizing S3 specifically
            if (!(signatureVersions.contains("v4") || signatureVersions.contains("s3v4"))) {
                throw CodegenException("endpoint does not support sigv4, unsupported: $signatureVersions")
            }
+0 −3
Original line number Diff line number Diff line
@@ -16,9 +16,6 @@ import software.amazon.smithy.rust.codegen.util.inputShape

class AccountIdAutofill() : OperationCustomization() {
    override fun mutSelf(): Boolean = true

    // this is a bit of a hack, but there currently isn't a good way to pass the information up the chain into the
    // fluent builder. I think we what we actually want is to write this information into the symbol metadata, but TODO.
    override fun consumesSelf(): Boolean = true
    override fun section(section: OperationSection): Writable {
        return when (section) {
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ import software.amazon.smithy.model.shapes.ShapeId
import software.amazon.smithy.model.traits.AnnotationTrait

/** Synthetic trait that indicates an operation is presignable. */
// TODO: This can be replaced once https://github.com/awslabs/smithy/pull/897 is merged.
// TODO(https://github.com/awslabs/smithy/pull/897) this can be replaced when the trait is added to Smithy.
class PresignableTrait(val syntheticOperationId: ShapeId) : AnnotationTrait(ID, Node.objectNode()) {
    companion object {
        val ID = ShapeId.from("smithy.api.aws.internal#presignable")
+0 −23
Original line number Diff line number Diff line
@@ -314,29 +314,6 @@ tasks.register<Exec>("cargoClippy") {
    dependsOn("assemble")
}

tasks.register<RunExampleTask>("runExample") {
    dependsOn("assemble")
    outputDir = outputDir
}

// TODO: validate that the example exists. Otherwise this fails with a hidden error.
open class RunExampleTask @javax.inject.Inject constructor() : Exec() {
    @Option(option = "example", description = "Example to run")
    var example: String? = null
        set(value) {
            workingDir = workingDir.resolve(value!!)
            field = value
        }

    @org.gradle.api.tasks.InputDirectory
    var outputDir: File? = null
        set(value) {
            workingDir = value!!.resolve("examples")
            commandLine = listOf("cargo", "run")
            field = value
        }
}

tasks["test"].finalizedBy("cargoClippy", "cargoTest", "cargoDocs")

tasks["clean"].doFirst {
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ use std::time::{Duration, UNIX_EPOCH};

type Client<C> = CoreClient<C, DefaultMiddleware>;

// TODO: having the full HTTP requests right in the code is a bit gross, consider something
// TODO(DVR): having the full HTTP requests right in the code is a bit gross, consider something
// like https://github.com/davidbarsky/sigv4/blob/master/aws-sigv4/src/lib.rs#L283-L315 to store
// the requests/responses externally

Loading