Page 1 of 1

clang-format

Posted: Thu Jul 22, 2021 5:58 am
by ceckak
I see Exult has a .clang-format file here: https://github.com/exult/exult/blob/mas ... ang-format

But applying it across the codebase results in massive changes. I had been hoping to use clang-format to normalize all my android patches against the codebase, but without a clean baseline, it ends up pulling in formatting changes that have nothing to do with the android patches.

Is there an appetite for doing a one-time blanket reformatting of the codebase using clang-format? If so, I'll introduce it at the head of the android patch series so that I can make all the subsequent patches against it and ensure they maintain consistent formatting.

Re: clang-format

Posted: Fri Jul 23, 2021 8:27 am
by marzo
I do intend to apply it eventually. The major issue is the many #ifs and #ifdefs littered across the codebase that are splitting statements and which could lead to inconsistent formatting depending on the platform in use. I think I cleaned up most of the #ifs and #ifdefs that modified stuff within statements, but it would need to be checked; another thing that needs to be checked is if/else chains that are split by #if/#ifdef, and similar stuff.

Re: clang-format

Posted: Sat Jul 24, 2021 5:11 am
by ceckak
Thanks for the context. I'll hold off on any blanket application of it for now then and try to manually clean up inconsistencies in my formatting for now.