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 | c64b09acc30e3b153088bb4e634102f64e23fd88 (patch) | |
| tree | b3d2394e7b524f44433c08736c84325bc84fa1c6 /clang/tools/clang-format | |
| parent | e31d5b6a2cfd0ea1f42d3638fd3a31880de9b352 (diff) | |
| download | bcm5719-llvm-c64b09acc30e3b153088bb4e634102f64e23fd88.tar.gz bcm5719-llvm-c64b09acc30e3b153088bb4e634102f64e23fd88.zip | |
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!
llvm-svn: 209446
Diffstat (limited to 'clang/tools/clang-format')
| -rw-r--r-- | clang/tools/clang-format/ClangFormat.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp index d26659d1277..189a611d007 100644 --- a/clang/tools/clang-format/ClangFormat.cpp +++ b/clang/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> |

