Skip to content

Conversation

@dicej
Copy link
Collaborator

@dicej dicej commented Dec 8, 2025

No description provided.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej requested a review from alexcrichton December 8, 2025 16:59
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind making this a configurable option as well? Effectively aligning with Rust's --format option for wit-bindgen rust

@dicej
Copy link
Collaborator Author

dicej commented Dec 8, 2025

Mind making this a configurable option as well? Effectively aligning with Rust's --format option for wit-bindgen rust

Sure. It looks like formatting is disabled by default for Rust. Any particular reason for that vs. enabling it by default and providing a --no-format option instead?

@alexcrichton
Copy link
Member

alexcrichton commented Dec 8, 2025

I personally prefer "positive" options along the lines of --format and --format=no vs --no-format since I find negatives/double-negatives hard to understand.

Clap supports --foo[=true|false] which means this flag can be --format, on-by-default, and disabled with --format=false, which I think is fine.

@dicej
Copy link
Collaborator Author

dicej commented Dec 8, 2025

I personally prefer "positive" options along the lines of --format and --format=no vs --no-format since I find negatives/double-negatives hard to understand.

Clap supports --foo[=true|false] which means this flag can be --format, on-by-default, and disabled with --format=false, which I think is fine.

Makes sense, but am I correct that it's off-by-default for Rust? Should we turn it on by default there to match what I'll be doing for Go?

@alexcrichton
Copy link
Member

You're right yeah it's off-by-default, but for now I think it's ok for different generators to differ on defaults. I think it's fine to leave it disabled-by-default in Rust since generated code is handled differently than the Go side of things.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej added this pull request to the merge queue Dec 8, 2025
Merged via the queue into bytecodealliance:main with commit c416d23 Dec 8, 2025
25 checks passed
@dicej dicej deleted the gofmt branch December 8, 2025 19:25
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

Successfully merging this pull request may close these issues.

2 participants