[PATCH] D66505: Make add_new_check.py's insertion of registerCheck<> more closely match the sort order

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 16:23:41 PDT 2019


dsanders created this revision.
dsanders added a reviewer: aaron.ballman.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Following on from review comments in D65919 <https://reviews.llvm.org/D65919> about the ordering
of the registerCheck<> calls. Ignore namespaces when finding the correct
insertion point to make the heuristic more accurate. The actual sort order
is based on the check name in the string but that isn't always on the same
line so the class name is used as a proxy.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66505

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


Index: clang-tools-extra/clang-tidy/add_new_check.py
===================================================================
--- clang-tools-extra/clang-tidy/add_new_check.py
+++ clang-tools-extra/clang-tidy/add_new_check.py
@@ -185,7 +185,7 @@
           check_added = True
           f.write(check_decl)
         else:
-          match = re.search('registerCheck<(.*)>', line)
+          match = re.search('registerCheck<((.*::).*)>', line)
           if match and match.group(1) > check_name_camel:
             check_added = True
             f.write(check_decl)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66505.216284.patch
Type: text/x-patch
Size: 563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190820/800ab812/attachment.bin>


More information about the llvm-commits mailing list