summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2015-09-04 14:56:57 +0000
committerAlexander Kornienko <alexfh@google.com>2015-09-04 14:56:57 +0000
commitc0ebfbe5e1b7fdca43d5b27bf7240214f02b5d5a (patch)
tree476590dd8e77e823e52c841b40798069c8565c92 /clang-tools-extra/clang-tidy
parent5a1954780f27686c5a4ff602fb62599d9b57282d (diff)
downloadbcm5719-llvm-c0ebfbe5e1b7fdca43d5b27bf7240214f02b5d5a.tar.gz
bcm5719-llvm-c0ebfbe5e1b7fdca43d5b27bf7240214f02b5d5a.zip
[clang-tidy] Fix add_new_check.py.
This fixes the case where the check should be added at the end of the list of checks in CMakeLists.txt of the corresponding module. Before it was added after LINK_LIBS line. http://reviews.llvm.org/D12629 Patch by Marek Kurdej! llvm-svn: 246854
Diffstat (limited to 'clang-tools-extra/clang-tidy')
-rwxr-xr-xclang-tools-extra/clang-tidy/add_new_check.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py
index 6682598739b..38c72b7b686 100755
--- a/clang-tools-extra/clang-tidy/add_new_check.py
+++ b/clang-tools-extra/clang-tidy/add_new_check.py
@@ -34,9 +34,10 @@ def adapt_cmake(module_path, check_name_camel):
cpp_found = False
file_added = False
for line in lines:
- if not file_added and (line.endswith('.cpp') or cpp_found):
+ cpp_line = line.endswith('.cpp')
+ if (not file_added) and (cpp_line or cpp_found):
cpp_found = True
- if line.strip() > cpp_file:
+ if (line.strip() > cpp_file) or (not cpp_line):
f.write(' ' + cpp_file + '\n')
file_added = True
f.write(line + '\n')
OpenPOWER on IntegriCloud