smithy-lang / smithy

Smithy is a protocol-agnostic interface definition language and set of tools for generating clients, servers, and documentation for any programming language.
https://smithy.io
Apache License 2.0
1.7k stars 201 forks source link

Formatter is not idempotent, keeps adding comments #2261

Closed kubukoz closed 1 month ago

kubukoz commented 2 months ago

Smithy CLI version: 1.48.0

Input:

$version: "2"

namespace test

operation Hello {
    errors: [
        // HelloError
    ]
}

smithy-cli format foo.smithy

Result 1:

$version: "2"

namespace test

operation Hello {
    // HelloError
    errors: [
        // HelloError
    ]
}

Run it again, result 2:

$version: "2"

namespace test

operation Hello {
    // HelloError
    // HelloError
    errors: [
        // HelloError
    ]
}

As far as I can see, this only happens in oprations and not in services.