diff options
author | Daniel Jasper <djasper@google.com> | 2014-05-22 15:12:22 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-05-22 15:12:22 +0000 |
commit | a065461c16984d11995b2fc4f5101bc3dea8a44f (patch) | |
tree | 7e1431ee724919230cd9ee9fb50c738b5e468fe2 /tools | |
parent | b362f6258eabe56443956024c2df7d0f785f3e4d (diff) | |
download | clang-a065461c16984d11995b2fc4f5101bc3dea8a44f.tar.gz clang-a065461c16984d11995b2fc4f5101bc3dea8a44f.tar.bz2 clang-a065461c16984d11995b2fc4f5101bc3dea8a44f.tar.xz |
clang-format: Introduce DisableFormat that prevents formatting.
And "none" pseudo-style indicating that formatting should be not
applied.
(1) Using .clang-format with "DisableFormat: true" effectively prevents
formatting for all files within the folder containing such .clang-format
file.
(2) Using -fallback-style=none together with -style=file prevents
formatting when .clang-format is not found, which can be used in on-save
callback.
Patch by Adam Strzelecki. Thank you!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/clang-format/ClangFormat.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/clang-format/ClangFormat.cpp b/tools/clang-format/ClangFormat.cpp index d26659d127..189a611d00 100644 --- a/tools/clang-format/ClangFormat.cpp +++ b/tools/clang-format/ClangFormat.cpp @@ -68,7 +68,8 @@ FallbackStyle("fallback-style", cl::desc("The name of the predefined style used as a\n" "fallback in case clang-format is invoked with\n" "-style=file, but can not find the .clang-format\n" - "file to use."), + "file to use.\n" + "Use -fallback-style=none to skip formatting."), cl::init("LLVM"), cl::cat(ClangFormatCategory)); static cl::opt<std::string> |