Skip to content

Commit 73e5cfb

Browse files
committed
a single pattern
1 parent 364e2a1 commit 73e5cfb

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tools/check_deprecations.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
from github.MainClass import Github
1919

2020
# Regex pattern to find deprecation instances
21-
DEPRECATION_PATTERN = re.compile(r'deprecation\((\d+),')
22-
DEPRECATED_PATTERN = re.compile(r'deprecated_function_alias\((\d+),')
21+
DEPRECATION_PATTERN = re.compile(r'(deprecation|deprecated_function_alias)\((\d+),')
2322

2423

2524
def get_pr_closed_date(github_token: str, pr_number: int) -> datetime:
@@ -38,9 +37,6 @@ def search_deprecations(path: str) -> set[tuple[str, int]]:
3837
matches = DEPRECATION_PATTERN.findall(content)
3938
for match in matches:
4039
deprecations.add((str(filepath), int(match)))
41-
matches = DEPRECATED_PATTERN.findall(content)
42-
for match in matches:
43-
deprecations.add((str(filepath), int(match)))
4440
except (PermissionError, UnicodeDecodeError):
4541
pass
4642
print(f"Found {len(deprecations)} deprecations.")

0 commit comments

Comments
 (0)