cheshirekow / cmake_format

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

Add option to provide original file path for cases when IDE uses temporary file #324

Open andrewsmolko opened 11 months ago

andrewsmolko commented 11 months ago

QtCreator IDE uses temporary file for cmake-format processing, here is a sample command line from QtCreator logs:

/usr/local/bin/cmake-format --in-place /private/var/folders/bg/w1rssn8d4kn5bl2gfx845nvr0000gp/T/QtCreator-ukiZXr/qtc_beautifier_kGQmmUda.cmake

It seems that temporary file path breaks searching of .cmake-format config.

Would be great if a new option could be introduced in cmake-format to provide original file path. This original file path should be used for searching .cmake-format config.

clang-format has similar --assume-filename option.