Stream: wasmtime

Topic: ✔ clang-format for the c-api


view this post on Zulip Tyler Rockwood (Nov 29 2023 at 14:52):

Hello! I was wonder if folks would be open to adding clang-format to the c-api. I've grown used to it and like not having to manually format things :) If there is interest in adding clang-format, would people want that enforced via CI like rustfmt?

view this post on Zulip Alex Crichton (Nov 29 2023 at 16:16):

I'd be down for that :+1:

view this post on Zulip Notification Bot (Nov 29 2023 at 18:17):

Tyler Rockwood has marked this topic as resolved.

view this post on Zulip Christof Petig (Nov 29 2023 at 20:06):

Tyler Rockwood said:

Hello! I was wonder if folks would be open to adding clang-format to the c-api. I've grown used to it and like not having to manually format things :) If there is interest in adding clang-format, would people want that enforced via CI like rustfmt?

If this helps I already added a clang-format invocation to the c++ code generator at https://github.com/cpetig/wit-bindgen/blob/main/crates/cpp/src/lib.rs#L138 - it should be made more robust though.

view this post on Zulip Tyler Rockwood (Nov 29 2023 at 20:10):

Thanks Christof! This ended up being resolved here: https://github.com/bytecodealliance/wasmtime/pull/7601, it was more about checked in code, not generated code.

Add a .clang-format for the C code in wasmtime. We choose the WebKit style because out of all the style options available in .clang-format, it was the closes to the existing style of the c-api crat...

Last updated: Dec 23 2024 at 14:03 UTC