summaryrefslogtreecommitdiffstats
path: root/pre_commit/hook.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-04 18:42:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-04 18:42:11 +0000
commit361ff4da262b4891323287049e9e6c5fbe1d01dc (patch)
tree969b376a2c170841758d39ef9516dac65c8b94cd /pre_commit/hook.py
parentAdding upstream version 2.17.0. (diff)
downloadpre-commit-361ff4da262b4891323287049e9e6c5fbe1d01dc.tar.xz
pre-commit-361ff4da262b4891323287049e9e6c5fbe1d01dc.zip
Adding upstream version 2.18.1.upstream/2.18.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/hook.py')
-rw-r--r--pre_commit/hook.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pre_commit/hook.py b/pre_commit/hook.py
index 82e99c5..202abb3 100644
--- a/pre_commit/hook.py
+++ b/pre_commit/hook.py
@@ -1,10 +1,10 @@
+from __future__ import annotations
+
import logging
import shlex
from typing import Any
-from typing import Dict
from typing import NamedTuple
from typing import Sequence
-from typing import Tuple
from pre_commit.prefix import Prefix
@@ -38,11 +38,11 @@ class Hook(NamedTuple):
verbose: bool
@property
- def cmd(self) -> Tuple[str, ...]:
+ def cmd(self) -> tuple[str, ...]:
return (*shlex.split(self.entry), *self.args)
@property
- def install_key(self) -> Tuple[Prefix, str, str, Tuple[str, ...]]:
+ def install_key(self) -> tuple[Prefix, str, str, tuple[str, ...]]:
return (
self.prefix,
self.language,
@@ -51,7 +51,7 @@ class Hook(NamedTuple):
)
@classmethod
- def create(cls, src: str, prefix: Prefix, dct: Dict[str, Any]) -> 'Hook':
+ def create(cls, src: str, prefix: Prefix, dct: dict[str, Any]) -> Hook:
# TODO: have cfgv do this (?)
extra_keys = set(dct) - _KEYS
if extra_keys: