From 592e3d2f96850365ee6d17989c1bca55049cfd23 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 14 Feb 2017 09:58:42 -0500 Subject: clang-format.bash: Format CUDA source files too Add `.clang-format` configuration files for Cuda test directories that use `Standard: Cpp11`. Otherwise clang-format splits the triple angle brackets used for CUDA kernels. --- Tests/Cuda/.clang-format | 9 +++++++++ Tests/CudaOnly/.clang-format | 9 +++++++++ Utilities/Scripts/clang-format.bash | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 Tests/Cuda/.clang-format create mode 100644 Tests/CudaOnly/.clang-format diff --git a/Tests/Cuda/.clang-format b/Tests/Cuda/.clang-format new file mode 100644 index 0000000..a77589a --- /dev/null +++ b/Tests/Cuda/.clang-format @@ -0,0 +1,9 @@ +--- +# This configuration requires clang-format 3.8 or higher. +BasedOnStyle: Mozilla +AlignOperands: false +AlwaysBreakAfterReturnType: None +AlwaysBreakAfterDefinitionReturnType: None +ColumnLimit: 79 +Standard: Cpp11 +... diff --git a/Tests/CudaOnly/.clang-format b/Tests/CudaOnly/.clang-format new file mode 100644 index 0000000..a77589a --- /dev/null +++ b/Tests/CudaOnly/.clang-format @@ -0,0 +1,9 @@ +--- +# This configuration requires clang-format 3.8 or higher. +BasedOnStyle: Mozilla +AlignOperands: false +AlwaysBreakAfterReturnType: None +AlwaysBreakAfterDefinitionReturnType: None +ColumnLimit: 79 +Standard: Cpp11 +... diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash index 8e07c99..2b36ac5 100755 --- a/Utilities/Scripts/clang-format.bash +++ b/Utilities/Scripts/clang-format.bash @@ -107,7 +107,7 @@ case "$mode" in esac # Filter sources to which our style should apply. -$git_ls -z -- '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | +$git_ls -z -- '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' '*.cu' '*.notcu' | # Exclude lexer/parser generator input and output. egrep -z -v '^Source/cmCommandArgumentLexer\.' | -- cgit v0.12