scripts: Reduced table name widths to 8 chars minimum

I still think the 24 (23+1) char minimum is a good default for 2 column
output such as help text, especially if you don't have automatic width
detection. But our result scripts need to be a bit more flexible.

Consider:

  $ make summary
                              code     data    stack  structs
  TOTAL                      68864        0     3744     1520

Vs:

  $ make summary
              code     data    stack  structs
  TOTAL      68864        0     3744     1520

Up until now we were just kind of working around this with cut -c 25- in
our Makefile, but now that our result scripts automatically scale the
table widths, they should really just default to whatever is the most
useful.
This commit is contained in:
Christopher Haster
2024-11-12 01:34:54 -06:00
parent 434479f101
commit 0ac326d9cb
9 changed files with 10 additions and 12 deletions

View File

@@ -897,7 +897,7 @@ def table(Result, results, diff_results=None, *,
# find the best widths, note that column 0 contains the names and is
# handled a bit differently
widths = co.defaultdict(lambda: 7, {0: 23})
widths = co.defaultdict(lambda: 7, {0: 7})
notes = co.defaultdict(lambda: 0)
for line in lines:
for i, x in enumerate(line):