Author: alexfh Date: Fri Sep 4 09:56:57 2015 New Revision: 246854 URL: http://llvm.org/viewvc/llvm-project?rev=246854&view=rev Log: [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! Modified: clang-tools-extra/trunk/clang-tidy/add_new_check.py Modified: clang-tools-extra/trunk/clang-tidy/add_new_check.py URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/add_new_check.py?rev=246854&r1=246853&r2=246854&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/add_new_check.py (original) +++ clang-tools-extra/trunk/clang-tidy/add_new_check.py Fri Sep 4 09:56:57 2015 @@ -34,9 +34,10 @@ def adapt_cmake(module_path, check_name_ 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') _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits