[PATCH] [clang-tidy] Implement the include order checker for LLVM.

Alexander Kornienko alexfh at google.com
Thu Jul 31 09:59:54 PDT 2014


================
Comment at: test/clang-tidy/llvm-include-order.cpp:1
@@ +1,2 @@
+// RUN: sed 's#// *[A-Z-]\+:.*#//#' %s > %t.cpp
+// RUN: clang-tidy %t.cpp -fix --checks="-*,llvm-include-order" -- -I %S/Inputs > %t.msg 2>&1
----------------
Benjamin Kramer wrote:
> Alexander Kornienko wrote:
> > Why can't we use check_clang_tidy_fix.sh here?
> There is currently no way to add additional flags (include path in this case) with the shell script. The other reason is that this test case produces an error (the includes don't exist) which the script would catch.
I see. How about adding the headers to the Inputs/ directory and adding --isystem=%S/Inputs for "system" headers? Relying on the error recovery doesn't seem correct here.
We could also forward all arguments of the script that we don't use to clang_tidy.

http://reviews.llvm.org/D4741






More information about the cfe-commits mailing list