[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 26 05:47:51 PDT 2026


================
@@ -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}"))
----------------
zeyi2 wrote:

In python documentation: https://docs.python.org/3/library/glob.html

> If recursive is true, the pattern “**” will match any files and zero or more directories, subdirectories and symbolic links to directories.

The old `*/*.rst` pattern did not use it, so IMO it was redundant. The new code just simplified it and didn't change behavior.

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


More information about the cfe-commits mailing list