[clang-tools-extra] [NFC][run-clang-tidy] Add minor type hints (PR #151873)

via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 3 08:59:09 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tools-extra

Author: Nicolas van Kempen (nicovank)

<details>
<summary>Changes</summary>


This script passes
```
python3 -m mypy --strict clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
```

`args` and `kwargs` can be typed with what we expect for a single argument. In this case, since we forward to `print`, `Any` seems best.


---
Full diff: https://github.com/llvm/llvm-project/pull/151873.diff


1 Files Affected:

- (modified) clang-tools-extra/clang-tidy/tool/run-clang-tidy.py (+1-1) 


``````````diff
diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
index d307b26ea0d34..80f1766b0bf10 100755
--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -236,7 +236,7 @@ def print_profile_data(aggregated_data: Dict[str, float]) -> None:
         checkers.items(), key=lambda x: x[1]["user"] + x[1]["sys"], reverse=True
     )
 
-    def print_stderr(*args, **kwargs) -> None:
+    def print_stderr(*args: Any, **kwargs: Any) -> None:
         print(*args, file=sys.stderr, **kwargs)
 
     print_stderr(

``````````

</details>


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


More information about the cfe-commits mailing list