wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
10.25k stars 692 forks source link

[suggestion] Add .clang-format to help fit the existing coding style #835

Closed Arpafaucon closed 4 months ago

Arpafaucon commented 4 months ago

While working on #825 I found useful to spin up this config file to be able to fit the existing coding style.

It's not perfect, but I already goes a long way; maybe you'd be interested ?

Known caveats:

I committed 2 files so you can quickly look at the diff and get a sense of how files are affected

wolfpld commented 4 months ago

How does this work in practice, when you are editing files? Proper code formatting is always a problem and it's good to automate this, but I don't want to be fighting with a system that is "fixing" deliberate side-steps from the established convention, like in the examples you show.

Arpafaucon commented 4 months ago

I use VSCode; I don't know how much this applies to other users.

Personnally (and in my company), I hate the "format on save" option of VSCode, because it's acting behind your back.

wolfpld commented 4 months ago

I have cherry-picked the commit. Formatting is done only on demand, so it's fine.