[clang-tools-extra] r323765 - [clang-tidy] Use a more specific regex

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 06:55:39 PST 2018


Author: alexfh
Date: Tue Jan 30 06:55:39 2018
New Revision: 323765

URL: http://llvm.org/viewvc/llvm-project?rev=323765&view=rev
Log:
[clang-tidy] Use a more specific regex

Modified:
    clang-tools-extra/trunk/clang-tidy/rename_check.py

Modified: clang-tools-extra/trunk/clang-tidy/rename_check.py
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/rename_check.py?rev=323765&r1=323764&r2=323765&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/rename_check.py (original)
+++ clang-tools-extra/trunk/clang-tidy/rename_check.py Tue Jan 30 06:55:39 2018
@@ -213,7 +213,7 @@ def main():
 
   # Remove the check from the old module.
   cmake_lists = os.path.join(old_module_path, 'CMakeLists.txt')
-  check_found = deleteMatchingLines(cmake_lists, check_name_camel)
+  check_found = deleteMatchingLines(cmake_lists, '\\b' + check_name_camel)
   if not check_found:
     print("Check name '%s' not found in %s. Exiting." %
             (check_name_camel, cmake_lists))
@@ -223,7 +223,7 @@ def main():
       lambda p: p.lower() == old_module.lower() + 'tidymodule.cpp',
       os.listdir(old_module_path))[0]
   deleteMatchingLines(os.path.join(old_module_path, modulecpp),
-                      check_name_camel + '|' + args.old_check_name)
+                      '\\b' + check_name_camel + '|\\b' + args.old_check_name)
 
   for filename in getListOfFiles(clang_tidy_path):
     originalName = filename




More information about the cfe-commits mailing list