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

Commit

Permalink
Merge pull request #29 from anentropic/issue/28
Browse files Browse the repository at this point in the history
fix for user-specified paths issue #28
  • Loading branch information
machadoit authored Sep 28, 2016
2 parents 350d0a0 + 5accb93 commit b3588ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/codacy/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def upload_report(report, token, commit):
def run():
parser = argparse.ArgumentParser(description='Codacy coverage reporter for Python.')
parser.add_argument("-r", "--report", help="coverage report file",
default=[DEFAULT_REPORT_FILE], type=str,
default=[], type=str,
action='append')
parser.add_argument("-c", "--commit", type=str, help="git commit hash")
parser.add_argument("-d", "--directory", type=str, help="git top level directory")
Expand All @@ -183,10 +183,13 @@ def run():
if not args.commit:
args.commit = get_git_revision_hash()

if not args.report:
args.report.append(DEFAULT_REPORT_FILE)

# Explictly check ALL files before parsing any
for rfile in args.report:
if not os.path.isfile(rfile):
logging.error("Coverage report " + args.report + " not found.")
logging.error("Coverage report " + rfile + " not found.")
exit(1)

reports = []
Expand Down

0 comments on commit b3588ea

Please sign in to comment.