[clang-tools-extra] [clang-tidy] Support Markdown documentation in rename_check.py (PR #210577)

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 19 00:29:20 PDT 2026


https://github.com/zeyi2 created https://github.com/llvm/llvm-project/pull/210577

None

>From d44536d2365f626e2646c16ae7e0e1cea6ff77e5 Mon Sep 17 00:00:00 2001
From: Zeyi Xu <mitchell.xu2 at gmail.com>
Date: Sun, 19 Jul 2026 15:29:04 +0800
Subject: [PATCH] [clang-tidy] Support Markdown documentation in
 rename_check.py

---
 clang-tools-extra/clang-tidy/rename_check.py | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py
index 51759dd12addf..6bb274f873dad 100755
--- a/clang-tools-extra/clang-tidy/rename_check.py
+++ b/clang-tools-extra/clang-tidy/rename_check.py
@@ -86,15 +86,12 @@ def getListOfFiles(clang_tidy_path: str) -> List[str]:
         os.path.join(clang_tidy_path, "..", "test", "clang-tidy", "checkers", "**"),
         recursive=True,
     )
-    files += glob.glob(
-        os.path.join(clang_tidy_path, "..", "docs", "clang-tidy", "checks", "*.rst")
-    )
-    files += glob.glob(
-        os.path.join(
-            clang_tidy_path, "..", "docs", "clang-tidy", "checks", "*", "*.rst"
-        ),
-        recursive=True,
-    )
+    docs_path = os.path.join(clang_tidy_path, "..", "docs", "clang-tidy", "checks")
+    # TODO: Stop discovering reST files once all clang-tidy check
+    # documentation has been migrated to MyST.
+    for extension in (".md", ".rst"):
+        files += glob.glob(os.path.join(docs_path, f"*{extension}"))
+        files += glob.glob(os.path.join(docs_path, "*", f"*{extension}"))
     return [filename for filename in files if os.path.isfile(filename)]
 
 
@@ -315,6 +312,8 @@ def main() -> None:
         for header_guard in header_guard_variants:
             replaceInFile(filename, header_guard, header_guard_new)
 
+        # TODO: Remove the reST heading handling once all clang-tidy check
+        # documentation has been migrated to MyST.
         if new_module + "/" + new_name + ".rst" in filename:
             replaceInFile(
                 filename,



More information about the cfe-commits mailing list