r189765 - Added WebKit style to the BasedOnStyle handling and to the relevant help messages.
Alexander Kornienko
alexfh at google.com
Mon Sep 2 09:39:23 PDT 2013
Author: alexfh
Date: Mon Sep 2 11:39:23 2013
New Revision: 189765
URL: http://llvm.org/viewvc/llvm-project?rev=189765&view=rev
Log:
Added WebKit style to the BasedOnStyle handling and to the relevant help messages.
Modified:
cfe/trunk/docs/ClangFormat.rst
cfe/trunk/lib/Format/Format.cpp
cfe/trunk/tools/clang-format/ClangFormat.cpp
cfe/trunk/tools/clang-format/clang-format-diff.py
Modified: cfe/trunk/docs/ClangFormat.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormat.rst?rev=189765&r1=189764&r2=189765&view=diff
==============================================================================
--- cfe/trunk/docs/ClangFormat.rst (original)
+++ cfe/trunk/docs/ClangFormat.rst Mon Sep 2 11:39:23 2013
@@ -54,7 +54,7 @@ to format C/C++/Obj-C code.
Can only be used with one input file.
-output-replacements-xml - Output replacements as XML.
-style=<string> - Coding style, currently supports:
- LLVM, Google, Chromium, Mozilla.
+ LLVM, Google, Chromium, Mozilla, WebKit.
Use -style=file to load style configuration from
.clang-format file located in one of the parent
directories of the source file (or current
@@ -139,12 +139,13 @@ a unified diff and reformats all contain
usage: clang-format-diff.py [-h] [-p P] [-style STYLE]
- Reformat changed lines in diff
+ Reformat changed lines in diff.
optional arguments:
-h, --help show this help message and exit
-p P strip the smallest prefix containing P slashes
- -style STYLE formatting style to apply (LLVM, Google, Chromium)
+ -style STYLE formatting style to apply (LLVM, Google, Chromium, Mozilla,
+ WebKit)
So to reformat all the lines in the latest :program:`git` commit, just do:
Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=189765&r1=189764&r2=189765&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Mon Sep 2 11:39:23 2013
@@ -68,7 +68,8 @@ struct ScalarEnumerationTraits<
template <> struct MappingTraits<clang::format::FormatStyle> {
static void mapping(llvm::yaml::IO &IO, clang::format::FormatStyle &Style) {
if (IO.outputting()) {
- StringRef StylesArray[] = { "LLVM", "Google", "Chromium", "Mozilla" };
+ StringRef StylesArray[] = { "LLVM", "Google", "Chromium",
+ "Mozilla", "WebKit" };
ArrayRef<StringRef> Styles(StylesArray);
for (size_t i = 0, e = Styles.size(); i < e; ++i) {
StringRef StyleName(Styles[i]);
Modified: cfe/trunk/tools/clang-format/ClangFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ClangFormat.cpp?rev=189765&r1=189764&r2=189765&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/ClangFormat.cpp (original)
+++ cfe/trunk/tools/clang-format/ClangFormat.cpp Mon Sep 2 11:39:23 2013
@@ -64,7 +64,7 @@ LineRanges("lines", cl::desc("<start lin
static cl::opt<std::string>
Style("style",
cl::desc("Coding style, currently supports:\n"
- " LLVM, Google, Chromium, Mozilla.\n"
+ " LLVM, Google, Chromium, Mozilla, WebKit.\n"
"Use -style=file to load style configuration from\n"
".clang-format file located in one of the parent\n"
"directories of the source file (or current\n"
Modified: cfe/trunk/tools/clang-format/clang-format-diff.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py?rev=189765&r1=189764&r2=189765&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/clang-format-diff.py (original)
+++ cfe/trunk/tools/clang-format/clang-format-diff.py Mon Sep 2 11:39:23 2013
@@ -82,11 +82,13 @@ def formatRange(r, style):
def main():
parser = argparse.ArgumentParser(description=
- 'Reformat changed lines in diff')
+ 'Reformat changed lines in diff.')
parser.add_argument('-p', default=0,
help='strip the smallest prefix containing P slashes')
- parser.add_argument('-style',
- help='formatting style to apply (LLVM, Google, Chromium)')
+ parser.add_argument(
+ '-style',
+ help=
+ 'formatting style to apply (LLVM, Google, Chromium, Mozilla, WebKit)')
args = parser.parse_args()
filename = None
More information about the cfe-commits
mailing list