Skip to content

Commit 286962e

Browse files
authored
Merge pull request #213 from pre-commit/report_version
Report full version in check-ast
2 parents a574f8c + 8ad9e7c commit 286962e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ omit =
1010
get-git-lfs.py
1111

1212
[report]
13+
show_missing = True
14+
skip_covered = True
1315
exclude_lines =
1416
# Have to re-enable the standard pragma
1517
\#\s*pragma: no cover

pre_commit_hooks/check_ast.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import argparse
66
import ast
7-
import os.path
7+
import platform
88
import sys
99
import traceback
1010

@@ -14,16 +14,16 @@ def check_ast(argv=None):
1414
parser.add_argument('filenames', nargs='*')
1515
args = parser.parse_args(argv)
1616

17-
_, interpreter = os.path.split(sys.executable)
18-
1917
retval = 0
2018
for filename in args.filenames:
2119

2220
try:
2321
ast.parse(open(filename, 'rb').read(), filename=filename)
2422
except SyntaxError:
25-
print('{}: failed parsing with {}:'.format(
26-
filename, interpreter,
23+
print('{}: failed parsing with {} {}:'.format(
24+
filename,
25+
platform.python_implementation(),
26+
sys.version.partition(' ')[0],
2727
))
2828
print('\n{}'.format(
2929
' ' + traceback.format_exc().replace('\n', '\n ')

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ setenv =
1414
commands =
1515
coverage erase
1616
coverage run -m pytest {posargs:tests}
17-
coverage report --show-missing --fail-under 100
17+
coverage report --fail-under 100
1818
pre-commit install -f --install-hooks
1919
pre-commit run --all-files
2020

0 commit comments

Comments
 (0)