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

Commit 6e008cb

Browse files
authored
Merge pull request #40 from althonos/master
Allow running codacy from python using the `-m` flag
2 parents 13148e0 + 5e9993b commit 6e008cb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/codacy/__main__.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env python
2+
from __future__ import absolute_import
3+
4+
import sys
5+
from . import __name__
6+
from .reporter import run
7+
8+
sys.exit(run(__name__))

src/codacy/reporter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ def upload_report(report, token, commit):
164164
logging.error(response['error'])
165165

166166

167-
def run():
168-
parser = argparse.ArgumentParser(description='Codacy coverage reporter for Python.')
167+
def run(prog=None):
168+
parser = argparse.ArgumentParser(prog=prog, description='Codacy coverage reporter for Python.')
169169
parser.add_argument("-r", "--report", help="coverage report file",
170170
default=[], type=str,
171171
action='append')

0 commit comments

Comments
 (0)