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

Commit b3588ea

Browse files
authored
Merge pull request #29 from anentropic/issue/28
fix for user-specified paths issue #28
2 parents 350d0a0 + 5accb93 commit b3588ea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/codacy/reporter.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def upload_report(report, token, commit):
165165
def run():
166166
parser = argparse.ArgumentParser(description='Codacy coverage reporter for Python.')
167167
parser.add_argument("-r", "--report", help="coverage report file",
168-
default=[DEFAULT_REPORT_FILE], type=str,
168+
default=[], type=str,
169169
action='append')
170170
parser.add_argument("-c", "--commit", type=str, help="git commit hash")
171171
parser.add_argument("-d", "--directory", type=str, help="git top level directory")
@@ -183,10 +183,13 @@ def run():
183183
if not args.commit:
184184
args.commit = get_git_revision_hash()
185185

186+
if not args.report:
187+
args.report.append(DEFAULT_REPORT_FILE)
188+
186189
# Explictly check ALL files before parsing any
187190
for rfile in args.report:
188191
if not os.path.isfile(rfile):
189-
logging.error("Coverage report " + args.report + " not found.")
192+
logging.error("Coverage report " + rfile + " not found.")
190193
exit(1)
191194

192195
reports = []

0 commit comments

Comments
 (0)