Page MenuHomeWildfire Games

Add .clang-format configuration for auto-formatting C++ code
Needs ReviewPublic

Authored by echotangoecho on Dec 6 2019, 10:18 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is still WIP, I'm mostly publishing this because I want your opinion. To read more about clang-format, see https://clang.llvm.org/docs/ClangFormat.html
Is this something we want?
While testing this, I noticed that the source code is very inconsistent in style. This could help (in addition to potentially making reviews a little bit less about style issues). Perhaps we could even use clang-format as a linter for patches:

https://github.com/vhbit/clang-format-linter

Test Plan

-

Event Timeline

echotangoecho created this revision.Dec 6 2019, 10:18 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/697/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1213/display/redirect

Stan added a subscriber: Stan.Dec 6 2019, 10:59 PM

Does it work on windows? Or is it Unix only?

This works on all platforms where you can use clang-format, which I assume is Windows as well (Visual Studio might even have integrated support).

I think you might add the exception to source/third_party as well.