The code is fine. I'm slightly concerned about the code duplication in the
tests, but I see no better way of doing this. If we come up with something more
elegant, we can always change this. Please address the comments and I'll commit
the patch for you.
================
Comment at: clang-tidy/misc/BracesAroundStatementsCheck.cpp:117
@@ +116,3 @@
+ // Always add braces by default.
+ ShortStatementLines(Options.get("ShortStatementLines", 0)) {}
+
----------------
I'd change the default to 0U in order to use get<unsigned>.
================
Comment at: test/clang-tidy/misc-braces-around-statements-always.cpp:5
@@ +4,3 @@
+// RUN: echo '{ Checks: "-*,misc-braces-around-statements", CheckOptions:
[{key: misc-braces-around-statements.ShortStatementLines, value: 0}]}' >
%t/.clang-tidy
+// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-braces-around-statements
%t/t.cpp
+
----------------
You should be able to use the "-config" command line option added in r218511 to
avoid creating a separate .clang-tidy file.
================
Comment at: test/clang-tidy/misc-braces-around-statements-always.cpp:14
@@ +13,3 @@
+void test() {
+ // CHECK-NOT: warning
+
----------------
You can omit this, it's added implicitly by the script.
http://reviews.llvm.org/D5642
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits