X Tutup
Skip to content

Commit 596e31f

Browse files
committed
Update some pre-commit hooks + some minor tweaks
1 parent 86c99c6 commit 596e31f

33 files changed

+65
-36
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
- repo: git@github.com:pre-commit/pre-commit-hooks
2-
sha: 6343700aa063fe30acc319d2dc84353a35a3d6d0
2+
sha: b03733bc86d9e8b2564a5798ade40d64baae3055
33
hooks:
44
- id: trailing-whitespace
55
- id: end-of-file-fixer
66
- id: autopep8-wrapper
77
args: ['-i', '--ignore=E265,E309,E501']
8+
- id: check-docstring-first
89
- id: check-json
910
- id: check-yaml
1011
- id: debug-statements
1112
- id: name-tests-test
13+
- id: requirements-txt-fixer
1214
- id: flake8
1315
- repo: git@github.com:pre-commit/pre-commit
14-
sha: bcb1283267c0a041c77150a80a58f1bc2a3252d6
16+
sha: 86c99c6b870a261d2aff0b4cdb36995764edce1b
1517
hooks:
1618
- id: validate_config
1719
- id: validate_manifest
20+
- repo: git@github.com:asottile/reorder_python_imports
21+
sha: ea9fa14a757bb210d849de5af8f8ba2c9744027a
22+
hooks:
23+
- id: reorder-python-imports

pre_commit/clientlib/validate_base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
from __future__ import unicode_literals
33

44
import argparse
5-
import jsonschema
6-
import jsonschema.exceptions
75
import os.path
86
import re
97
import sys
8+
9+
import jsonschema
10+
import jsonschema.exceptions
1011
import yaml
1112

1213
from pre_commit.jsonschema_extensions import apply_defaults
@@ -78,10 +79,6 @@ def run(argv=None):
7879
validate_strategy(filename)
7980
except exception_cls as e:
8081
print(e.args[0])
81-
# If there was an inner exception, print the stringified
82-
# version of that.
83-
if len(e.args) > 1:
84-
print(str(e.args[1]))
8582
retval = 1
8683
return retval
8784
return run

pre_commit/commands/autoupdate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from pre_commit.jsonschema_extensions import remove_defaults
1313
from pre_commit.ordereddict import OrderedDict
1414
from pre_commit.repository import Repository
15-
from pre_commit.util import cwd
1615
from pre_commit.util import cmd_output
16+
from pre_commit.util import cwd
1717

1818

1919
class RepositoryCannotBeUpdatedError(RuntimeError):

pre_commit/commands/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import os
66
import sys
77

8-
from pre_commit import git
98
from pre_commit import color
9+
from pre_commit import git
1010
from pre_commit.logging_handler import LoggingHandler
1111
from pre_commit.output import get_hook_message
1212
from pre_commit.output import sys_stdout_write_wrapper

pre_commit/jsonschema_extensions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import unicode_literals
22

33
import copy
4+
45
import jsonschema
56
import jsonschema.validators
67

pre_commit/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from __future__ import unicode_literals
22

33
import argparse
4-
import pkg_resources
54
import sys
65

6+
import pkg_resources
7+
78
from pre_commit import color
89
from pre_commit.commands.autoupdate import autoupdate
910
from pre_commit.commands.clean import clean

pre_commit/manifest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import unicode_literals
22

33
import os.path
4+
45
from cached_property import cached_property
56

67
import pre_commit.constants as C

pre_commit/runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import os.path
5+
56
from cached_property import cached_property
67

78
import pre_commit.constants as C

pre_commit/store.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import os.path
77
import tempfile
8+
89
from cached_property import cached_property
910

1011
from pre_commit.prefixed_command_runner import PrefixedCommandRunner

pre_commit/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
import hashlib
66
import os
77
import os.path
8-
import pkg_resources
98
import shutil
109
import subprocess
1110
import tarfile
1211
import tempfile
1312

13+
import pkg_resources
14+
1415

1516
@contextlib.contextmanager
1617
def cwd(path):

0 commit comments

Comments
 (0)
X Tutup