[clang-tools-extra] [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (PR #106801)

Nicolas van Kempen via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 20:20:44 PDT 2024


================
@@ -324,9 +329,14 @@ def add_release_notes(module_path, module, check_name, description):
 
 
 # Adds a test for the check.
-def write_test(module_path, module, check_name, test_extension, test_standard):
-    if test_standard:
-        test_standard = f"-std={test_standard}-or-later "
+def write_test(
+    module_path: str,
+    module: str,
+    check_name: str,
+    test_extension: str,
+    test_standard: Optional[str],
+) -> None:
+    test_standard = f"-std={test_standard}-or-later " if test_standard else ""
----------------
nicovank wrote:

This is the minor bug fix. If `test_standard` is `None`, it is wrongly formatted into the string a few lines down.

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


More information about the cfe-commits mailing list