Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/codacy/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
from xml.dom import minidom
import requests
from math import floor

logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s')
Expand Down Expand Up @@ -61,7 +62,7 @@ def parse_report_file(report_file):

# Convert decimal string to floored int percent value
def percent(s):
return float(s) * 100
return int(floor(float(s) * 100))

# Parse the XML into the format expected by the API
report_xml = minidom.parse(report_file)
Expand Down
6 changes: 3 additions & 3 deletions tests/coverage4/coverage.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"total": 50.0,
"total": 50,
"fileReports": [
{
"total": 66.67,
"total": 66,
"coverage": {
"1": 1,
"4": 1
},
"filename": "src/codacy/__init__.py"
},
{
"total": 49.15,
"total": 49,
"coverage": {
"50": 1,
"60": 1,
Expand Down
6 changes: 3 additions & 3 deletions tests/filepath/coverage.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"total": 50.0,
"total": 50,
"fileReports": [
{
"total": 66.67,
"total": 66,
"coverage": {
"1": 1,
"4": 1
},
"filename": "src/codacy/__init__.py"
},
{
"total": 49.15,
"total": 49,
"coverage": {
"50": 1,
"60": 1,
Expand Down