[clang-tools-extra] [clang-tidy][NFC] fix add_new_check python3.8 incompatibility (PR #107871)
Congcong Cai via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 9 08:04:51 PDT 2024
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/107871
Fixes: #107846
>From ffc8fb76d35d4cc7d90efeb0346259060fcaa218 Mon Sep 17 00:00:00 2001
From: Congcong Cai <congcongcai0907 at 163.com>
Date: Mon, 9 Sep 2024 23:04:10 +0800
Subject: [PATCH] [clang-tidy][NFC] fix add_new_check python3.8 incompatibility
Fixes: #107846
---
clang-tools-extra/clang-tidy/add_new_check.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py
index d384dbae28abbc..e366f100535357 100755
--- a/clang-tools-extra/clang-tidy/add_new_check.py
+++ b/clang-tools-extra/clang-tidy/add_new_check.py
@@ -17,7 +17,7 @@
import textwrap
# FIXME Python 3.9: Replace typing.Tuple with builtins.tuple.
-from typing import Optional, Tuple
+from typing import Optional, Tuple, Match
# Adapts the module's CMakelist file. Returns 'True' if it could add a new
@@ -511,7 +511,7 @@ def has_auto_fix(check_name: str) -> str:
return ""
- def process_doc(doc_file: Tuple[str, str]) -> Tuple[str, Optional[re.Match[str]]]:
+ def process_doc(doc_file: Tuple[str, str]) -> Tuple[str, Optional[Match[str]]]:
check_name = doc_file[0] + "-" + doc_file[1].replace(".rst", "")
with io.open(os.path.join(docs_dir, *doc_file), "r", encoding="utf8") as doc:
More information about the cfe-commits
mailing list