async_comm icon indicating copy to clipboard operation
async_comm copied to clipboard

Clang format

Open superjax opened this issue 6 years ago • 3 comments

superjax avatar Oct 04 '19 03:10 superjax

I have a new interface-based callback mechanism that I'd like to pr, but since I am using VScode, I can't help but have it generate a ton of whitespace changes.

I figured you'd appreciate the cleanup anyways :)

superjax avatar Oct 04 '19 04:10 superjax

Thanks @superjax. This is probably great, but I'm not entirely clear on what's actually new...

Is this one only clang-format stuff? Is there some extension in VScode that's reformatting code for you? I develop this in VScode and it doesn't make changes for me. Doing a clang-format thing would probably be great, but this is also mangling a few things I don't want mangled. For now, would it possible for you to turn off whatever extension is changing stuff, then redo #9?

dpkoch avatar Oct 07 '19 21:10 dpkoch

Sure thing!

All you do is add "editor.formatOnSave": true, to the settings.json and install the Clang-format extension.

Or you can run it against the whole directory with

find . -iname "*.h" -o -iname "*.cpp" | xargs clang-format -i

What is the formatter doing that you don't like? It's pretty easy to fix.

superjax avatar Oct 10 '19 14:10 superjax