mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Update some pre-commit hooks + some minor tweaks
This commit is contained in:
parent
86c99c6b87
commit
596e31fdee
33 changed files with 65 additions and 36 deletions
|
|
@ -1,17 +1,23 @@
|
|||
- repo: git@github.com:pre-commit/pre-commit-hooks
|
||||
sha: 6343700aa063fe30acc319d2dc84353a35a3d6d0
|
||||
sha: b03733bc86d9e8b2564a5798ade40d64baae3055
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: autopep8-wrapper
|
||||
args: ['-i', '--ignore=E265,E309,E501']
|
||||
- id: check-docstring-first
|
||||
- id: check-json
|
||||
- id: check-yaml
|
||||
- id: debug-statements
|
||||
- id: name-tests-test
|
||||
- id: requirements-txt-fixer
|
||||
- id: flake8
|
||||
- repo: git@github.com:pre-commit/pre-commit
|
||||
sha: bcb1283267c0a041c77150a80a58f1bc2a3252d6
|
||||
sha: 86c99c6b870a261d2aff0b4cdb36995764edce1b
|
||||
hooks:
|
||||
- id: validate_config
|
||||
- id: validate_manifest
|
||||
- repo: git@github.com:asottile/reorder_python_imports
|
||||
sha: ea9fa14a757bb210d849de5af8f8ba2c9744027a
|
||||
hooks:
|
||||
- id: reorder-python-imports
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@ from __future__ import print_function
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import argparse
|
||||
import jsonschema
|
||||
import jsonschema.exceptions
|
||||
import os.path
|
||||
import re
|
||||
import sys
|
||||
|
||||
import jsonschema
|
||||
import jsonschema.exceptions
|
||||
import yaml
|
||||
|
||||
from pre_commit.jsonschema_extensions import apply_defaults
|
||||
|
|
@ -78,10 +79,6 @@ def get_run_function(filenames_help, validate_strategy, exception_cls):
|
|||
validate_strategy(filename)
|
||||
except exception_cls as e:
|
||||
print(e.args[0])
|
||||
# If there was an inner exception, print the stringified
|
||||
# version of that.
|
||||
if len(e.args) > 1:
|
||||
print(str(e.args[1]))
|
||||
retval = 1
|
||||
return retval
|
||||
return run
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ from pre_commit.clientlib.validate_config import load_config
|
|||
from pre_commit.jsonschema_extensions import remove_defaults
|
||||
from pre_commit.ordereddict import OrderedDict
|
||||
from pre_commit.repository import Repository
|
||||
from pre_commit.util import cwd
|
||||
from pre_commit.util import cmd_output
|
||||
from pre_commit.util import cwd
|
||||
|
||||
|
||||
class RepositoryCannotBeUpdatedError(RuntimeError):
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import logging
|
|||
import os
|
||||
import sys
|
||||
|
||||
from pre_commit import git
|
||||
from pre_commit import color
|
||||
from pre_commit import git
|
||||
from pre_commit.logging_handler import LoggingHandler
|
||||
from pre_commit.output import get_hook_message
|
||||
from pre_commit.output import sys_stdout_write_wrapper
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import copy
|
||||
|
||||
import jsonschema
|
||||
import jsonschema.validators
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import argparse
|
||||
import pkg_resources
|
||||
import sys
|
||||
|
||||
import pkg_resources
|
||||
|
||||
from pre_commit import color
|
||||
from pre_commit.commands.autoupdate import autoupdate
|
||||
from pre_commit.commands.clean import clean
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os.path
|
||||
|
||||
from cached_property import cached_property
|
||||
|
||||
import pre_commit.constants as C
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
|||
|
||||
import os
|
||||
import os.path
|
||||
|
||||
from cached_property import cached_property
|
||||
|
||||
import pre_commit.constants as C
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import logging
|
|||
import os
|
||||
import os.path
|
||||
import tempfile
|
||||
|
||||
from cached_property import cached_property
|
||||
|
||||
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@ import functools
|
|||
import hashlib
|
||||
import os
|
||||
import os.path
|
||||
import pkg_resources
|
||||
import shutil
|
||||
import subprocess
|
||||
import tarfile
|
||||
import tempfile
|
||||
|
||||
import pkg_resources
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def cwd(path):
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
coverage
|
||||
flake8
|
||||
mock
|
||||
pylint
|
||||
pylint<1.4
|
||||
pytest
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ from __future__ import unicode_literals
|
|||
|
||||
import io
|
||||
import os.path
|
||||
|
||||
from aspy.yaml import ordered_dump
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit.clientlib.validate_manifest import load_manifest
|
||||
from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA
|
||||
from pre_commit.clientlib.validate_config import validate_config_extra
|
||||
from pre_commit.clientlib.validate_manifest import load_manifest
|
||||
from pre_commit.jsonschema_extensions import apply_defaults
|
||||
from pre_commit.ordereddict import OrderedDict
|
||||
from pre_commit.util import cmd_output
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import jsonschema
|
||||
import os
|
||||
import os.path
|
||||
import pytest
|
||||
import shutil
|
||||
|
||||
import jsonschema
|
||||
import pytest
|
||||
|
||||
from pre_commit.util import cmd_output
|
||||
from pre_commit.util import cwd
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ from pre_commit.clientlib.validate_config import InvalidConfigError
|
|||
from pre_commit.clientlib.validate_config import run
|
||||
from pre_commit.clientlib.validate_config import validate_config_extra
|
||||
from pre_commit.jsonschema_extensions import apply_defaults
|
||||
from testing.util import is_valid_according_to_schema
|
||||
from testing.util import get_resource_path
|
||||
from testing.util import is_valid_according_to_schema
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ from pre_commit.clientlib.validate_manifest import additional_manifest_check
|
|||
from pre_commit.clientlib.validate_manifest import InvalidManifestError
|
||||
from pre_commit.clientlib.validate_manifest import MANIFEST_JSON_SCHEMA
|
||||
from pre_commit.clientlib.validate_manifest import run
|
||||
from testing.util import is_valid_according_to_schema
|
||||
from testing.util import get_resource_path
|
||||
from testing.util import is_valid_according_to_schema
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import sys
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
from pre_commit.color import format_color
|
||||
from pre_commit.color import GREEN
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import pytest
|
||||
import shutil
|
||||
|
||||
import pytest
|
||||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit.commands.autoupdate import _update_repository
|
||||
from pre_commit.commands.autoupdate import autoupdate
|
||||
|
|
|
|||
|
|
@ -2,20 +2,21 @@ from __future__ import absolute_import
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import io
|
||||
import mock
|
||||
import os
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import mock
|
||||
|
||||
from pre_commit.commands.install_uninstall import IDENTIFYING_HASH
|
||||
from pre_commit.commands.install_uninstall import PREVIOUS_IDENTIFYING_HASHES
|
||||
from pre_commit.commands.install_uninstall import install
|
||||
from pre_commit.commands.install_uninstall import is_our_pre_commit
|
||||
from pre_commit.commands.install_uninstall import is_previous_pre_commit
|
||||
from pre_commit.commands.install_uninstall import make_executable
|
||||
from pre_commit.commands.install_uninstall import PREVIOUS_IDENTIFYING_HASHES
|
||||
from pre_commit.commands.install_uninstall import uninstall
|
||||
from pre_commit.runner import Runner
|
||||
from pre_commit.util import cmd_output
|
||||
|
|
|
|||
|
|
@ -2,12 +2,13 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import io
|
||||
import mock
|
||||
import os
|
||||
import os.path
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from pre_commit.commands.install_uninstall import install
|
||||
from pre_commit.commands.run import _get_skips
|
||||
from pre_commit.commands.run import _has_unmerged_paths
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ from __future__ import absolute_import
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import io
|
||||
import mock
|
||||
import os
|
||||
import os.path
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
import pre_commit.constants as C
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@ from __future__ import unicode_literals
|
|||
|
||||
import io
|
||||
import os.path
|
||||
import re
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
import re
|
||||
|
||||
from pre_commit import error_handler
|
||||
from pre_commit.errors import FatalError
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os.path
|
||||
|
||||
import pytest
|
||||
|
||||
from pre_commit import git
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import inspect
|
||||
|
||||
import pytest
|
||||
|
||||
from pre_commit.languages.all import all_languages
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import argparse
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import mock
|
||||
import os.path
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from pre_commit import make_archives
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
from pre_commit.prefixed_command_runner import _replace_cmd
|
||||
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@ from __future__ import absolute_import
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import io
|
||||
import mock
|
||||
import os.path
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@ from __future__ import unicode_literals
|
|||
|
||||
import io
|
||||
import logging
|
||||
import mock
|
||||
import os.path
|
||||
import pytest
|
||||
import shutil
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from pre_commit.staged_files_only import staged_files_only
|
||||
from pre_commit.util import cmd_output
|
||||
from pre_commit.util import cwd
|
||||
|
|
|
|||
|
|
@ -2,12 +2,13 @@ from __future__ import absolute_import
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import io
|
||||
import mock
|
||||
import os
|
||||
import os.path
|
||||
import pytest
|
||||
import shutil
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from pre_commit import five
|
||||
from pre_commit.store import _get_default_directory
|
||||
from pre_commit.store import logger
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import pytest
|
||||
import os
|
||||
import os.path
|
||||
import random
|
||||
|
||||
import pytest
|
||||
|
||||
from pre_commit.util import clean_path_on_failure
|
||||
from pre_commit.util import cwd
|
||||
from pre_commit.util import memoize_by_cwd
|
||||
|
|
|
|||
3
tox.ini
3
tox.ini
|
|
@ -9,7 +9,8 @@ deps = -rrequirements-dev.txt
|
|||
commands =
|
||||
coverage erase
|
||||
coverage run -m pytest {posargs:tests}
|
||||
coverage report --show-missing --fail-under 93
|
||||
# TODO: when dropping py26, change to 100
|
||||
coverage report --show-missing --fail-under 99
|
||||
flake8 {[tox]project} testing tests setup.py
|
||||
# pylint {[tox]project} testing tests setup.py
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue