8000 bpo-36876: Minor cleanup to c-analyzer "ignored" data.' by ericsnowcurrently · Pull Request #31239 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-36876: Minor cleanup to c-analyzer "ignored" data.' #31239

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 4 commits into from
Feb 10, 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
Add a divider between each top-level section.
  • Loading branch information
ericsnowcurrently committed Feb 9, 2022
commit 448cd3d7bca7cd735370c36d4de6c9b46f3592cd
4 changes: 4 additions & 0 deletions Tools/c-analyzer/table-file.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def collate_sections(lines):
# the commands

def cmd_count_by_section(lines):
div = ' ' + '-' * 50
total = 0
def render_tree(root, depth=0):
nonlocal total
Expand All @@ -100,11 +101,14 @@ def render_tree(root, depth=0):
subroot, rows, totalrows = data
sectotal = f'({len(totalrows)})' if totalrows != rows else ''
count = len(rows) if rows else ''
if depth == 0:
yield div
yield f'{sectotal:>7} {count:>4} {indent}{name}'
yield from render_tree(subroot, depth+1)
total += len(rows)
sections = collate_sections(lines)
yield from render_tree(sections)
yield div
yield f'(total: {total})'


Expand Down
0