bpo-36876: Minor cleanup to c-analyzer "ignored" data.' (gh-31239)

https://bugs.python.org/issue36876
This commit is contained in:
Eric Snow 2022-02-09 17:10:53 -07:00 committed by GitHub
parent 78ae4cc6dc
commit cb68788dca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 261 additions and 513 deletions

File diff suppressed because it is too large Load diff

View file

@ -1460,6 +1460,7 @@ Objects/obmalloc.c - _PyMem_Debug -
Objects/obmalloc.c - _PyMem_Raw -
Objects/obmalloc.c - _PyObject -
Objects/obmalloc.c - usedpools -
Objects/typeobject.c - name_op -
Objects/unicodeobject.c - stripfuncnames -
Objects/unicodeobject.c - utf7_category -
Objects/unicodeobject.c unicode_decode_call_errorhandler_wchar argparse -

Can't render this file because it has a wrong number of fields in line 4.

View file

@ -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
@ -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})'