astro-informatics / purify

Next-generation radio interferometric imaging.
https://astro-informatics.github.io/purify
GNU General Public License v2.0
16 stars 11 forks source link

Linting .in.h files #325

Open SJaffa opened 1 year ago

SJaffa commented 1 year ago

We currently exclude *in.h files but it looks like some of the suggested changes from clang-format are valid. We could check those files in more detail and apply relevant changes.

krishnakumarg1984 commented 1 year ago

I did some further investigation and found that we can selectively disable the formatting of #cmakeconfig lines in *.in.h files by modifying the source files like so:

// clang-format disable
#cmakeconfig whatever // CMake pragmas/directives
int someFcn(); // more C++ stuff (normal C++ lines of code) that we DON'T want to be autoformatted
// clang-format enable 

double otherImportantFcn(); // more C++ stuff (normal C++ lines of code) that we want to autoformat as usual

Hence, we can simply delete the .clang-format-ignore file that was added today during the pair-programming session.