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

Commit 17e9b45

Browse files
author
Martin Larralde
committed
Allow running codacy from python using the -m flag
1 parent 13148e0 commit 17e9b45

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/codacy/__main__.py

Lines changed: 8 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
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)