[clang-tools-extra] [clang-tidy][NFC] Run ruff over python scripts (PR #176927)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 20 20:46:04 PST 2026


================
@@ -393,7 +392,7 @@ def update_checks_list(clang_tidy_path: str) -> None:
         lambda s: os.path.isdir(os.path.join(docs_dir, s)), os.listdir(docs_dir)
     ):
         for file in filter(
-            lambda s: s.endswith(".rst"), os.listdir(os.path.join(docs_dir, subdir))
+            methodcaller("endswith", ".rst"), os.listdir(os.path.join(docs_dir, subdir))
----------------
localspook wrote:

In general, I feel the plain loop is easier to read:
```python
for file in os.listdir(os.path.join(docs_dir, subdir):
    if file.endswith(".rst"):
        oc_files.append((subdir, file))
```
than the current
```python
for file in filter(
    methodcaller("endswith", ".rst"), os.listdir(os.path.join(docs_dir, subdir))
):
    doc_files.append((subdir, file))
```

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


More information about the cfe-commits mailing list