Search code examples
clangclang-format

What is the right ".clang-format" location?


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?


Solution

  • 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.