mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 04:54:16 +00:00
Merge pull request #1098 from pre-commit/all-repos_autofix_all-repos-manual
py39+
This commit is contained in:
commit
51c43c4b29
36 changed files with 47 additions and 47 deletions
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
|
|
@ -8,12 +8,12 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
main-windows:
|
main-windows:
|
||||||
uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0
|
uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0
|
||||||
with:
|
with:
|
||||||
env: '["py38"]'
|
env: '["py39"]'
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
main-linux:
|
main-linux:
|
||||||
uses: asottile/workflows/.github/workflows/tox.yml@v1.5.0
|
uses: asottile/workflows/.github/workflows/tox.yml@v1.7.0
|
||||||
with:
|
with:
|
||||||
env: '["py38", "py39", "py310", "py311"]'
|
env: '["py39", "py310", "py311", "py312"]'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ repos:
|
||||||
rev: v3.13.0
|
rev: v3.13.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: reorder-python-imports
|
- id: reorder-python-imports
|
||||||
args: [--py38-plus, --add-import, 'from __future__ import annotations']
|
args: [--py39-plus, --add-import, 'from __future__ import annotations']
|
||||||
- repo: https://github.com/asottile/add-trailing-comma
|
- repo: https://github.com/asottile/add-trailing-comma
|
||||||
rev: v3.1.0
|
rev: v3.1.0
|
||||||
hooks:
|
hooks:
|
||||||
|
|
@ -26,7 +26,7 @@ repos:
|
||||||
rev: v3.17.0
|
rev: v3.17.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py38-plus]
|
args: [--py39-plus]
|
||||||
- repo: https://github.com/hhatto/autopep8
|
- repo: https://github.com/hhatto/autopep8
|
||||||
rev: v2.3.1
|
rev: v2.3.1
|
||||||
hooks:
|
hooks:
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import argparse
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pre_commit_hooks.util import added_files
|
from pre_commit_hooks.util import added_files
|
||||||
from pre_commit_hooks.util import zsplit
|
from pre_commit_hooks.util import zsplit
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import ast
|
||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
def main(argv: Sequence[str] | None = None) -> int:
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import ast
|
import ast
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
|
|
||||||
BUILTIN_TYPES = {
|
BUILTIN_TYPES = {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
def main(argv: Sequence[str] | None = None) -> int:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from typing import Iterable
|
from collections.abc import Iterable
|
||||||
from typing import Iterator
|
from collections.abc import Iterator
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pre_commit_hooks.util import added_files
|
from pre_commit_hooks.util import added_files
|
||||||
from pre_commit_hooks.util import cmd_output
|
from pre_commit_hooks.util import cmd_output
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import io
|
import io
|
||||||
import tokenize
|
import tokenize
|
||||||
|
from collections.abc import Sequence
|
||||||
from tokenize import tokenize as tokenize_tokenize
|
from tokenize import tokenize as tokenize_tokenize
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
NON_CODE_TOKENS = frozenset((
|
NON_CODE_TOKENS = frozenset((
|
||||||
tokenize.COMMENT, tokenize.ENDMARKER, tokenize.NEWLINE, tokenize.NL,
|
tokenize.COMMENT, tokenize.ENDMARKER, tokenize.NEWLINE, tokenize.NL,
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
from typing import Generator
|
from collections.abc import Generator
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
from pre_commit_hooks.util import cmd_output
|
from pre_commit_hooks.util import cmd_output
|
||||||
from pre_commit_hooks.util import zsplit
|
from pre_commit_hooks.util import zsplit
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
|
|
||||||
def raise_duplicate_keys(
|
def raise_duplicate_keys(
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os.path
|
import os.path
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pre_commit_hooks.util import cmd_output
|
from pre_commit_hooks.util import cmd_output
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pre_commit_hooks.check_executables_have_shebangs import EXECUTABLE_VALUES
|
from pre_commit_hooks.check_executables_have_shebangs import EXECUTABLE_VALUES
|
||||||
from pre_commit_hooks.check_executables_have_shebangs import git_ls_files
|
from pre_commit_hooks.check_executables_have_shebangs import git_ls_files
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os.path
|
import os.path
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
def main(argv: Sequence[str] | None = None) -> int:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
if sys.version_info >= (3, 11): # pragma: >=3.11 cover
|
if sys.version_info >= (3, 11): # pragma: >=3.11 cover
|
||||||
import tomllib
|
import tomllib
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from typing import Pattern
|
from collections.abc import Sequence
|
||||||
from typing import Sequence
|
from re import Pattern
|
||||||
|
|
||||||
|
|
||||||
def _get_pattern(domain: str) -> Pattern[bytes]:
|
def _get_pattern(domain: str) -> Pattern[bytes]:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import xml.sax.handler
|
import xml.sax.handler
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
def main(argv: Sequence[str] | None = None) -> int:
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
from collections.abc import Generator
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Generator
|
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
import ruamel.yaml
|
import ruamel.yaml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import ast
|
import ast
|
||||||
import traceback
|
import traceback
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
|
|
||||||
DEBUG_STATEMENTS = {
|
DEBUG_STATEMENTS = {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import shlex
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pre_commit_hooks.util import cmd_output
|
from pre_commit_hooks.util import cmd_output
|
||||||
from pre_commit_hooks.util import zsplit
|
from pre_commit_hooks.util import zsplit
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
|
|
||||||
class BadFile(NamedTuple):
|
class BadFile(NamedTuple):
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
BLACKLIST = [
|
BLACKLIST = [
|
||||||
b'BEGIN RSA PRIVATE KEY',
|
b'BEGIN RSA PRIVATE KEY',
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import IO
|
from typing import IO
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
|
|
||||||
def fix_file(file_obj: IO[bytes]) -> int:
|
def fix_file(file_obj: IO[bytes]) -> int:
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,11 @@ conflicts and keep the file nicely ordered.
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
from collections.abc import Iterable
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
from typing import IO
|
from typing import IO
|
||||||
from typing import Iterable
|
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
PASS = 0
|
PASS = 0
|
||||||
FAIL = 1
|
FAIL = 1
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
def main(argv: Sequence[str] | None = None) -> int:
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import IO
|
from typing import IO
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
DEFAULT_PRAGMA = b'# -*- coding: utf-8 -*-'
|
DEFAULT_PRAGMA = b'# -*- coding: utf-8 -*-'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
from pre_commit_hooks.util import cmd_output
|
from pre_commit_hooks.util import cmd_output
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import collections
|
import collections
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
CRLF = b'\r\n'
|
CRLF = b'\r\n'
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import re
|
import re
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import AbstractSet
|
from typing import AbstractSet
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
from pre_commit_hooks.util import CalledProcessError
|
from pre_commit_hooks.util import CalledProcessError
|
||||||
from pre_commit_hooks.util import cmd_output
|
from pre_commit_hooks.util import cmd_output
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
from collections.abc import Mapping
|
||||||
|
from collections.abc import Sequence
|
||||||
from difflib import unified_diff
|
from difflib import unified_diff
|
||||||
from typing import Mapping
|
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
|
|
||||||
def _get_pretty_format(
|
def _get_pretty_format(
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
def main(argv: Sequence[str] | None = None) -> int:
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import re
|
import re
|
||||||
|
from collections.abc import Sequence
|
||||||
from typing import IO
|
from typing import IO
|
||||||
from typing import Sequence
|
|
||||||
|
|
||||||
|
|
||||||
PASS = 0
|
PASS = 0
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ complicated YAML files.
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
QUOTES = ["'", '"']
|
QUOTES = ["'", '"']
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import io
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import tokenize
|
import tokenize
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
if sys.version_info >= (3, 12): # pragma: >=3.12 cover
|
if sys.version_info >= (3, 12): # pragma: >=3.12 cover
|
||||||
FSTRING_START = tokenize.FSTRING_START
|
FSTRING_START = tokenize.FSTRING_START
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
def main(argv: Sequence[str] | None = None) -> int:
|
def main(argv: Sequence[str] | None = None) -> int:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
from typing import Sequence
|
from collections.abc import Sequence
|
||||||
|
|
||||||
|
|
||||||
def _fix_file(
|
def _fix_file(
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ packages = find:
|
||||||
install_requires =
|
install_requires =
|
||||||
ruamel.yaml>=0.15
|
ruamel.yaml>=0.15
|
||||||
tomli>=1.1.0;python_version<"3.11"
|
tomli>=1.1.0;python_version<"3.11"
|
||||||
python_requires = >=3.8
|
python_requires = >=3.9
|
||||||
|
|
||||||
[options.packages.find]
|
[options.packages.find]
|
||||||
exclude =
|
exclude =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue