mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
parent
99fa9ba5ef
commit
f415f6c4d7
10 changed files with 13 additions and 14 deletions
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
import functools
|
||||
import itertools
|
||||
import textwrap
|
||||
from typing import Callable
|
||||
from collections.abc import Callable
|
||||
|
||||
import cfgv
|
||||
import yaml
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
|||
import contextlib
|
||||
import errno
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Generator
|
||||
from typing import Callable
|
||||
|
||||
|
||||
if sys.platform == 'win32': # pragma: no cover (windows)
|
||||
|
|
|
|||
|
|
@ -90,8 +90,7 @@ def _infer_go_version(version: str) -> str:
|
|||
if version != C.DEFAULT:
|
||||
return version
|
||||
resp = urllib.request.urlopen('https://go.dev/dl/?mode=json')
|
||||
# TODO: 3.9+ .removeprefix('go')
|
||||
return json.load(resp)[0]['version'][2:]
|
||||
return json.load(resp)[0]['version'].removeprefix('go')
|
||||
|
||||
|
||||
def _get_url(version: str) -> str:
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import logging
|
|||
import os.path
|
||||
import sqlite3
|
||||
import tempfile
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Generator
|
||||
from collections.abc import Sequence
|
||||
from typing import Callable
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit import clientlib
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import shutil
|
|||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Generator
|
||||
from types import TracebackType
|
||||
from typing import Any
|
||||
from typing import Callable
|
||||
|
||||
from pre_commit import parse_shebang
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ import multiprocessing
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
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 Callable
|
||||
from typing import TypeVar
|
||||
|
||||
from pre_commit import parse_shebang
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue