Skip to content

Commit c0ebfbe

Browse files
committed
[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
1 parent 5a19547 commit c0ebfbe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang-tools-extra/clang-tidy/add_new_check.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ def adapt_cmake(module_path, check_name_camel):
3434
cpp_found = False
3535
file_added = False
3636
for line in lines:
37-
if not file_added and (line.endswith('.cpp') or cpp_found):
37+
cpp_line = line.endswith('.cpp')
38+
if (not file_added) and (cpp_line or cpp_found):
3839
cpp_found = True
39-
if line.strip() > cpp_file:
40+
if (line.strip() > cpp_file) or (not cpp_line):
4041
f.write(' ' + cpp_file + '\n')
4142
file_added = True
4243
f.write(line + '\n')

0 commit comments

Comments
 (0)