clang-format

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
ceckak
Posts: 26
Joined: Tue Jul 20, 2021 4:28 am

clang-format

Post 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.
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: clang-format

Post 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.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
ceckak
Posts: 26
Joined: Tue Jul 20, 2021 4:28 am

Re: clang-format

Post 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.
Locked