WolfireGames / overgrowth

Open Source codebase of the game Overgrowth by Wolfire Games LLC
Apache License 2.0
2.51k stars 260 forks source link

Clang format #66

Closed feliwir closed 2 years ago

feliwir commented 2 years ago
Conan-Kudo commented 2 years ago

You might want to consider using the same clang format style we used for Lugaru: https://gitlab.com/osslugaru/lugaru/-/blob/master/.clang-format

feliwir commented 2 years ago

You might want to consider using the same clang format style we used for Lugaru: https://gitlab.com/osslugaru/lugaru/-/blob/master/.clang-format

Good idea. I was using a Google-based style since @autious told me in Discord they tried following their guidelines. I'll try applying your clang-format and see how large the delta is - if it completly changes the current style i'd vote against it.

Conan-Kudo commented 2 years ago

The Lugaru one was based on regularizing the code style that the codebase already used, and I imagine that this one probably is more similar in style to Lugaru's code.

feliwir commented 2 years ago

Well, i don't really mind which one we use. However i noticed that the .clang-format you linked does sort the includes. I've applied the style and end up with a compilation failure. Of course this shouldn't be the case, but the code as it currently is can't handle that.

autious commented 2 years ago

There was a style change some time back at wolfire, where we stopped doing newlines before opening curly on if-statements, functions classes, etc.

So

void f() {
}

instead of

void f()
{
}
feliwir commented 2 years ago

Yes, that's what i thought aswell - this matches more the google style i had at first. Will change back to that and reapply the style