mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 10:16:52 +00:00
Report full version in check-ast
This commit is contained in:
parent
a574f8cb2b
commit
8ad9e7c94c
3 changed files with 8 additions and 6 deletions
|
|
@ -10,6 +10,8 @@ omit =
|
|||
get-git-lfs.py
|
||||
|
||||
[report]
|
||||
show_missing = True
|
||||
skip_covered = True
|
||||
exclude_lines =
|
||||
# Have to re-enable the standard pragma
|
||||
\#\s*pragma: no cover
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
|||
|
||||
import argparse
|
||||
import ast
|
||||
import os.path
|
||||
import platform
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
|
|
@ -14,16 +14,16 @@ def check_ast(argv=None):
|
|||
parser.add_argument('filenames', nargs='*')
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
_, interpreter = os.path.split(sys.executable)
|
||||
|
||||
retval = 0
|
||||
for filename in args.filenames:
|
||||
|
||||
try:
|
||||
ast.parse(open(filename, 'rb').read(), filename=filename)
|
||||
except SyntaxError:
|
||||
print('{}: failed parsing with {}:'.format(
|
||||
filename, interpreter,
|
||||
print('{}: failed parsing with {} {}:'.format(
|
||||
filename,
|
||||
platform.python_implementation(),
|
||||
sys.version.partition(' ')[0],
|
||||
))
|
||||
print('\n{}'.format(
|
||||
' ' + traceback.format_exc().replace('\n', '\n ')
|
||||
|
|
|
|||
2
tox.ini
2
tox.ini
|
|
@ -14,7 +14,7 @@ setenv =
|
|||
commands =
|
||||
coverage erase
|
||||
coverage run -m pytest {posargs:tests}
|
||||
coverage report --show-missing --fail-under 100
|
||||
coverage report --fail-under 100
|
||||
pre-commit install -f --install-hooks
|
||||
pre-commit run --all-files
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue