summaryrefslogtreecommitdiffstats
path: root/pre_commit/meta_hooks
diff options
context:
space:
mode:
Diffstat (limited to 'pre_commit/meta_hooks')
-rw-r--r--pre_commit/meta_hooks/check_hooks_apply.py5
-rw-r--r--pre_commit/meta_hooks/check_useless_excludes.py5
-rw-r--r--pre_commit/meta_hooks/identity.py5
3 files changed, 9 insertions, 6 deletions
diff --git a/pre_commit/meta_hooks/check_hooks_apply.py b/pre_commit/meta_hooks/check_hooks_apply.py
index a6eb0e0..b05a705 100644
--- a/pre_commit/meta_hooks/check_hooks_apply.py
+++ b/pre_commit/meta_hooks/check_hooks_apply.py
@@ -1,5 +1,6 @@
+from __future__ import annotations
+
import argparse
-from typing import Optional
from typing import Sequence
import pre_commit.constants as C
@@ -27,7 +28,7 @@ def check_all_hooks_match_files(config_file: str) -> 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='*', default=[C.CONFIG_FILE])
args = parser.parse_args(argv)
diff --git a/pre_commit/meta_hooks/check_useless_excludes.py b/pre_commit/meta_hooks/check_useless_excludes.py
index 60870f8..0a8249b 100644
--- a/pre_commit/meta_hooks/check_useless_excludes.py
+++ b/pre_commit/meta_hooks/check_useless_excludes.py
@@ -1,6 +1,7 @@
+from __future__ import annotations
+
import argparse
import re
-from typing import Optional
from typing import Sequence
from cfgv import apply_defaults
@@ -65,7 +66,7 @@ def check_useless_excludes(config_file: str) -> 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='*', default=[C.CONFIG_FILE])
args = parser.parse_args(argv)
diff --git a/pre_commit/meta_hooks/identity.py b/pre_commit/meta_hooks/identity.py
index 12eb02f..72ee440 100644
--- a/pre_commit/meta_hooks/identity.py
+++ b/pre_commit/meta_hooks/identity.py
@@ -1,11 +1,12 @@
+from __future__ import annotations
+
import sys
-from typing import Optional
from typing import Sequence
from pre_commit import output
-def main(argv: Optional[Sequence[str]] = None) -> int:
+def main(argv: Sequence[str] | None = None) -> int:
argv = argv if argv is not None else sys.argv[1:]
for arg in argv:
output.write_line(arg)