You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a C++ source file.
Create a .clang-format-ignore file and add the source file path in it.
Edit the C++ source file.
Save the source file. The file is formatted on save.
Other than using the comment // clang-format off in code, is there a way for me to exclude certain files from being formatted on save?
The text was updated successfully, but these errors were encountered:
I had a similar problem myself and I abused that clang-format supports multiple languages. If you can deduce the behavior from the filename, you can mark the file as cuda-cpp instead of regular c++. Once you have this distinction, you can use a language specific setting to enable the formatter for regular C++ and disable it for cuda-cpp.
In my case, this 5 minute change in the config solved the issue I had.
vscode settings used:
Create a C++ source file.
Create a .clang-format-ignore file and add the source file path in it.
Edit the C++ source file.
Save the source file. The file is formatted on save.
Other than using the comment
// clang-format off
in code, is there a way for me to exclude certain files from being formatted on save?The text was updated successfully, but these errors were encountered: