summaryrefslogtreecommitdiffstats
path: root/pre_commit_hooks/check_vcs_permalinks.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-19 07:03:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-19 07:03:44 +0000
commit9262e31316a16180044e0e28a2740238f8aef5c4 (patch)
tree49b2bc070018965707ec237623da9932c880fae4 /pre_commit_hooks/check_vcs_permalinks.py
parentAdding debian version 4.1.0-1. (diff)
downloadpre-commit-hooks-9262e31316a16180044e0e28a2740238f8aef5c4.tar.xz
pre-commit-hooks-9262e31316a16180044e0e28a2740238f8aef5c4.zip
Merging upstream version 4.3.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit_hooks/check_vcs_permalinks.py')
-rw-r--r--pre_commit_hooks/check_vcs_permalinks.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pre_commit_hooks/check_vcs_permalinks.py b/pre_commit_hooks/check_vcs_permalinks.py
index 1c77b9a..68639bd 100644
--- a/pre_commit_hooks/check_vcs_permalinks.py
+++ b/pre_commit_hooks/check_vcs_permalinks.py
@@ -1,8 +1,8 @@
+from __future__ import annotations
+
import argparse
import re
import sys
-from typing import List
-from typing import Optional
from typing import Pattern
from typing import Sequence
@@ -15,7 +15,7 @@ def _get_pattern(domain: str) -> Pattern[bytes]:
return re.compile(regex.encode())
-def _check_filename(filename: str, patterns: List[Pattern[bytes]]) -> int:
+def _check_filename(filename: str, patterns: list[Pattern[bytes]]) -> int:
retv = 0
with open(filename, 'rb') as f:
for i, line in enumerate(f, 1):
@@ -28,7 +28,7 @@ def _check_filename(filename: str, patterns: List[Pattern[bytes]]) -> int:
return retv
-def main(argv: Optional[Sequence[str]] = None) -> int:
+def main(argv: Sequence[str] | None = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*')
parser.add_argument(