10000 Support report terminal output in Markdown Table format #1418 by stepeos · Pull Request #1479 · nedbat/coveragepy · GitHub
[go: up one dir, main page]

Skip to content

Support report terminal output in Markdown Table format #1418 #1479

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

Merged
merged 21 commits into from
Nov 5, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
minor changes
  • Loading branch information
stepeos committed Oct 22, 2022
commit b2224765db03ceb40435df7585ed33620a18c861
6 changes: 3 additions & 3 deletions coverage/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ def _report_markdown(self, header, lines_values, sort_option, reverse,
total_line):
"internal method to print report data in markdown format"
# Prepare the formatting strings, header, and column sorting.
max_name = max([len(fr.relative_filename().replace("_",r"\_")) for (fr, analysis) in \
self.fr_analysis] + [5]) + 1
max_name = max([len(fr.relative_filename().replace("_",r"\_")) for\
(fr, analysis) in self.fr_analysis] + [5]) + 1
h_form = dict(
Name="| {:{name_len}}|", Stmts="{:>7} |", Miss="{:>7} |",
Branch="{:>7} |", BrPart="{:>7} |", Cover="{:>7} |",
Missing="{:>9} |")
header_items = [
h_form[item].format(item, name_len=max_name) for item in header]
header_str = "".join(header_items)
rule_str = "|" + " ".join(["- |".rjust(len(header_items[0])-1, '-')] +
rule_str = "|" + " ".join(["- |".rjust(len(header_items[0])-1, '-')] +
["-: |".rjust(len(item)-1, '-') for item in header_items[1:]])

# Write the header
Expand Down
0