cheshirekow / cmake_format

Source code formatter for cmake listfiles.
GNU General Public License v3.0
949 stars 104 forks source link

Recommending using default cmake-format config #247

Closed Maverobot closed 3 years ago

Maverobot commented 3 years ago

I am considering if it is a good idea to use the default configuration of cmake-format without providing own .cmake-format.

Just out of curiosity, is there a backwards compatibility in terms of the default configurations, so that no new changes will be done by a newer cmake-formatted if the CMakeLists.txt has been formatted previously?

cheshirekow commented 3 years ago

I wont guarantee backward compatibility between releases until I get to a 1.0 release (which, unfortunately, has been quite delayed by the pandemic), but I do generally try to prevent a change in formatting with the default config. New features are usually enabled by a configuration option rather than by default. There are some cases where it is unavoidable and (until 1.0 at least) there are some cases where I may decided that the default format should, in fact, change. There have been many requests related to un-wrapping the first argument which is a pretty good style choice. When I release this I may make it the default. If I do enable this by default, I will include in the release notes what configuration option will preserve the "old-behavior".

My recommendation is to keep as empty a .cmake-format config file as possible (e.g. use the defaults where you can). I will try hard to not surprise you with future releases :).

Maverobot commented 3 years ago

I appreciate your quick reply and thank your for giving us the awesome library! It has helped my work flow a lot. Keep up the great work :=)