summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands
diff options
context:
space:
mode:
Diffstat (limited to 'pre_commit/commands')
-rw-r--r--pre_commit/commands/autoupdate.py2
-rw-r--r--pre_commit/commands/hook_impl.py2
-rw-r--r--pre_commit/commands/run.py10
-rw-r--r--pre_commit/commands/validate_config.py2
-rw-r--r--pre_commit/commands/validate_manifest.py2
5 files changed, 9 insertions, 9 deletions
diff --git a/pre_commit/commands/autoupdate.py b/pre_commit/commands/autoupdate.py
index e7725fd..aa0c5e2 100644
--- a/pre_commit/commands/autoupdate.py
+++ b/pre_commit/commands/autoupdate.py
@@ -4,9 +4,9 @@ import concurrent.futures
import os.path
import re
import tempfile
+from collections.abc import Sequence
from typing import Any
from typing import NamedTuple
-from typing import Sequence
import pre_commit.constants as C
from pre_commit import git
diff --git a/pre_commit/commands/hook_impl.py b/pre_commit/commands/hook_impl.py
index dab2135..49a80b7 100644
--- a/pre_commit/commands/hook_impl.py
+++ b/pre_commit/commands/hook_impl.py
@@ -4,7 +4,7 @@ import argparse
import os.path
import subprocess
import sys
-from typing import Sequence
+from collections.abc import Sequence
from pre_commit.commands.run import run
from pre_commit.envcontext import envcontext
diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py
index 41ba4ec..076f16d 100644
--- a/pre_commit/commands/run.py
+++ b/pre_commit/commands/run.py
@@ -9,11 +9,11 @@ import re
import subprocess
import time
import unicodedata
+from collections.abc import Generator
+from collections.abc import Iterable
+from collections.abc import MutableMapping
+from collections.abc import Sequence
from typing import Any
-from typing import Generator
-from typing import Iterable
-from typing import MutableMapping
-from typing import Sequence
from identify.identify import tags_from_path
@@ -74,7 +74,7 @@ class Classifier:
def __init__(self, filenames: Iterable[str]) -> None:
self.filenames = [f for f in filenames if os.path.lexists(f)]
- @functools.lru_cache(maxsize=None)
+ @functools.cache
def _types_for_file(self, filename: str) -> set[str]:
return tags_from_path(filename)
diff --git a/pre_commit/commands/validate_config.py b/pre_commit/commands/validate_config.py
index 24bd313..b3de635 100644
--- a/pre_commit/commands/validate_config.py
+++ b/pre_commit/commands/validate_config.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import Sequence
+from collections.abc import Sequence
from pre_commit import clientlib
diff --git a/pre_commit/commands/validate_manifest.py b/pre_commit/commands/validate_manifest.py
index 419031a..8493c6e 100644
--- a/pre_commit/commands/validate_manifest.py
+++ b/pre_commit/commands/validate_manifest.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import Sequence
+from collections.abc import Sequence
from pre_commit import clientlib