I cannot understand the following text from the clang-format manual:
.clang-format file located in one of the parent
directories of the source file (or current
directory for stdin).
What does "current directory for stdin" mean? Is it the current directory or the stdin?
Is it possible to specify the .clang-format location by a full path?
clang-format supports two ways to provide custom style options: directly specify style configuration in the -style= command line option or use -style=file and put style configuration in the . clang-format or _clang-format file in the project directory.
Getting Started with Clang-Format The shortcut Ctrl+Shift+I is for Linux. If you want to use it on Windows, you need to use Alter+Shift+F. If you do not have Clang-Format installed on your system, you will see the prompt: The 'clang-format' command is not available.
Disabling Formatting on a Piece of Code The code between a comment // clang-format off or /* clang-format off */ up to a comment // clang-format on or /* clang-format on */ will not be formatted. The comments themselves will be formatted (aligned) normally.
It is the current directory.
And there is no way to set .clang-format
path. clang-format
only scans from the directories and up until it encounters the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With