osara icon indicating copy to clipboard operation
osara copied to clipboard

Provide .ClangFormat for auto formatting

Open LeonarddeR opened this issue 2 years ago • 2 comments

When writing OSARA code, all of us format code manually as far as I can see. I think adding a basic .ClangFormat file can be beneficial for us using an IDE that supports auto formatting with Clang, such as VS Code.

LeonarddeR avatar Aug 17 '23 16:08 LeonarddeR

Yeah, I think we should probably just re-format the whole code base and then fail the build if clang-format fails. Spending contributor or reviewer time on code formatting is silly. I just haven't had the time to come up with a clang-format settings file that minimises churn, since OSARA doesn't currently use one of the common styles, so we'll need to customise it a bit to avoid changing literally the entire code base. It'll also break any open pull requests, so we should try to get the ones we care about closed and kill the rest before we do it.

jcsteh avatar Aug 17 '23 23:08 jcsteh

I'd also ideally like to normalise some stuff with clang-tidy like braces for all condition blocks, nullptr instead of NULL, etc.

jcsteh avatar Aug 17 '23 23:08 jcsteh