cheshirekow / cmake_format

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

Allow multiple config files #123

Closed fetzerch closed 5 years ago

fetzerch commented 5 years ago

Extend '--config-file' command line option to support multiple config files. The configuration parameters get merged recursively.

This is useful to ship a definition of 'additional_commands' with a library of CMake modules while still allowing the user to provide his own project specific config file.

cheshirekow commented 5 years ago

Hi! Thanks for the contribution. I think I agree that there's a need for multiple config loads so that you can get libraries of command specifications. A quick glance of the code looks good. I will follow up soon.

cheshirekow commented 5 years ago

Just an FYI: I'm going to follow this up with some kind of include config file option. I think that rather than specifying multiple config files on the command line, it would be nicer for one config file to be able to refer to another.

JohelEGP commented 4 years ago

I'm working on #201 and will soon make a WIP PR for it at https://github.com/TheLartians/Format.cmake/. Note that the configuration parameters are not being merged recursively. So only the last config with additional_commands is taken into account and previous ones discarded.

cheshirekow commented 4 years ago

Hi @johelegp, I think the dictionary merge implementation should be merging the additional commands. If not, that sounds like a bug.

JohelEGP commented 4 years ago

Then it seems like there's a bug. Should I open a new issue for that?

cheshirekow commented 4 years ago

Yes please!