sundials icon indicating copy to clipboard operation
sundials copied to clipboard

CMake: Formatting with cmake-format

Open gardner48 opened this issue 1 year ago • 4 comments

Add CMake formatter

gardner48 avatar Jun 21 '24 06:06 gardner48

Also see alternative formatter in #521

gardner48 avatar Jun 21 '24 13:06 gardner48

I have a slight preference to the formatting in this PR over #521. Also, cmake-format seems to be much more popular so I think its probably the better choice for that reason too.

balos1 avatar Jun 22 '24 00:06 balos1

I have a slight preference to the formatting in this PR over #521. Also, cmake-format seems to be much more popular so I think its probably the better choice for that reason too.

My main concern with cmake-format was that it doesn't seem to have any activity in the past three years. Which is why I looked at gersemi as well. One thing I like about gersemi over cmake-format is it can format custom functions/macros without having to supply additional information so it does a better job with things like with sundials_add_library.

gardner48 avatar Jun 22 '24 00:06 gardner48

I updated the cmake-format.py file so it knows about our custom macros so those are formatted better now

gardner48 avatar Jun 29 '24 17:06 gardner48

I have a slight preference to the formatting in this PR over #521. Also, cmake-format seems to be much more popular so I think its probably the better choice for that reason too.

My main concern with cmake-format was that it doesn't seem to have any activity in the past three years. Which is why I looked at gersemi as well. One thing I like about gersemi over cmake-format is it can format custom functions/macros without having to supply additional information so it does a better job with things like with sundials_add_library.

Hmm, I did not realize cmake-format was not maintained anymore. If it starts causing problems for us later on, I suppose worst case scenario we disable it in the formatting check.

balos1 avatar Jul 01 '24 15:07 balos1