diff --git a/.coveragerc b/.coveragerc index 714aaa1..732613b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -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 diff --git a/pre_commit_hooks/check_ast.py b/pre_commit_hooks/check_ast.py index 169e077..9809a3f 100644 --- a/pre_commit_hooks/check_ast.py +++ b/pre_commit_hooks/check_ast.py @@ -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 ') diff --git a/tox.ini b/tox.ini index 9dd4c2f..d0863eb 100644 --- a/tox.ini +++ b/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