Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit e0d7094

Browse files
committed
some minor improvements
1 parent 658c96d commit e0d7094

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
all: build test install
2+
3+
build:
4+
python setup.py build
5+
6+
install: build
7+
python setup.py develop
8+
9+
test: pep8 pyflakes
10+
11+
# requires "pip install pep8"
12+
pep8:
13+
@git ls-files | grep \\.py$ | xargs pep8
14+
15+
# requires "pip install pyflakes"
16+
pyflakes:
17+
@export PYFLAKES_NODOCTEST=1 && \
18+
git ls-files | grep \\.py$ | xargs pyflakes
19+
20+
upload:
21+
python setup.py sdist bdist_wheel upload

setup.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
# This flag says that the code is written to work on both Python 2 and Python
33
# 3. If at all possible, it is good practice to do this. If you cannot, you
44
# will need to generate wheels for each Python version that you support.
5-
universal=1
5+
universal=1
6+
7+
[pep8]
8+
max_line_length = 120

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
setup(
1414
name='codacy-coverage',
1515

16-
version='1.0.0',
16+
version='1.0.1',
1717

1818
description='Codacy coverage reporter for Python',
1919
long_description=long_description,

src/codacy/reporter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def parse_report_file(report_file):
2727
"""Parse XML file and POST it to the Codacy API"""
2828

2929
# Convert decimal string to floored int percent value
30-
percent = lambda s: int(float(s) * 100)
30+
def percent(s):
31+
float(s) * 100
3132

3233
# Parse the XML into the format expected by the API
3334
report_xml = minidom.parse(report_file)
@@ -94,6 +95,10 @@ def run():
9495
if not args.commit:
9596
args.commit = get_git_revision_hash()
9697

98+
if not os.path.isfile(args.report):
99+
logging.error("Coverage report " + args.report + " not found.")
100+
exit(1)
101+
97102
logging.info("Parsing report file...")
98103
report = parse_report_file(args.report)
99104

0 commit comments

Comments
 (0)