Closed Hsilgos closed 4 years ago
cmake-format
doesn't write out over the file it is formatting. It writes to a temp file next to the output file, and then renames over the original file (for --in-place
). This way if formatting fails you don't have a corrupt file.
It doesn't currently copy file attributes but that would be easy to add. I'll include it in the next push.
Added in v0.6.2
.
Some of our *.cmake files have +x mod (i.e. they are executable) and after applying of cmake-format they are not executable anymore.
Steps:
Result: test.cmake is not executable
Expected: test.cmake is executable