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

CLI validate command hates long lines #2491

Open
kubukoz opened this issue Dec 19, 2024 · 1 comment
Open

CLI validate command hates long lines #2491

kubukoz opened this issue Dec 19, 2024 · 1 comment

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Dec 19, 2024

When you run validate, build or any other command that validates your model, if the sourceLocation in the validation events points to a compact JSON file (say, one of the AWS specs), the CLI will output basically a bunch of blank lines which will look terrible in the terminal.

Even with a smaller JSON file, like:

{"smithy":"2.0","shapes":{"example.weather#Home":{"type":"operation","input":{"target":"smithy.api#Unit"},"output":{"target":"smithy.api#Unit"},"traits":{"smithy.api#http":{"method":"GET","uri":"/"}}},"example.weather#Weather":{"type":"service","operations":[{"target":"example.weather#Home"}]}}}

Running validate yields:

image

which doesn't seem very useful with the source location.

Note: it's entirely possible that I've already reported this, because I remember writing about it, but I can't find any issue for this.

@kubukoz
Copy link
Contributor Author

kubukoz commented Dec 19, 2024

Apparently, it affects long lines in IDL files too:

$version: "2"

namespace example.weather

enum A {
                                                                                        result = "res"
}

although I can't imagine this happening often for someone using a formatter.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant