Update some pre-commit hooks + some minor tweaks

This commit is contained in:
Anthony Sottile
2015-01-04 15:49:19 -08:00
parent 86c99c6b87
commit 596e31fdee
33 changed files with 65 additions and 36 deletions

View File

@@ -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

View File

@@ -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):

View File

@@ -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

View File

@@ -1,6 +1,7 @@
from __future__ import unicode_literals
import copy
import jsonschema
import jsonschema.validators

View File

@@ -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

View File

@@ -1,6 +1,7 @@
from __future__ import unicode_literals
import os.path
from cached_property import cached_property
import pre_commit.constants as C

View File

@@ -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

View File

@@ -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

View File

@@ -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):