Skip to content

Added --relative option #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 12 additions & 1 deletion doxy-coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,16 @@ def file_cmp (a,b):
total_yes += doc_yes
total_no += doc_no

print ('%3d%% - %s - (%d of %d)'%(doc_per, f, doc_yes, (doc_yes + doc_no)))
if ns.relative:
if os.path.exists(ns.relative):
relative_path = ns.relative
else:
relative_path = os.path.curdir
file_path = os.path.join(os.path.relpath(os.path.dirname(f), os.path.realpath(relative_path)), os.path.basename(f))
else:
file_path = f

print ('%3d%% - %s - (%d of %d)'%(doc_per, file_path, doc_yes, (doc_yes + doc_no)))

defs_sorted = defs.keys()
defs_sorted.sort()
Expand All @@ -170,6 +179,8 @@ def main():
parser.add_argument ("dir", action="store", help="Path to Doxygen's XML doc directory")
parser.add_argument ("--noerror", action="store_true", help="Do not return error code after execution")
parser.add_argument ("--threshold", action="store", help="Min acceptable coverage percentage (Default: %s)"%(ACCEPTABLE_COVERAGE), default=ACCEPTABLE_COVERAGE, type=int)
parser.add_argument ("--relative", nargs="?", action="store", help="Use relative path for output (Default: %s)"%(os.path.curdir), const=os.path.curdir)


global ns
ns = parser.parse_args()
Expand Down