From 34cdaeafdb2ed5ee25cfcdb25bb13db1bde28c78 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 8 Dec 2025 17:08:36 -0700 Subject: [PATCH] codman: Move file line counts to kLOC column File metrics do not align with directory columns, making it hard to compare them visually. Align file output with directory columns by: - Skipping the Files, Used, and %Used columns (leave empty) - Showing percentage active in the %Code column - Showing total lines (in kLOC) in the kLOC column - Showing active lines (in kLOC) in the Used column Co-developed-by: Claude Signed-off-by: Simon Glass --- tools/codman/output.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/codman/output.py b/tools/codman/output.py index c611a942583..0fbdcfe9b2a 100644 --- a/tools/codman/output.py +++ b/tools/codman/output.py @@ -394,8 +394,11 @@ def print_dir_stats(dir_stats, file_results, by_subdirs, show_files, if file_results: # Show line-level details pct_active = percent(info['active'], info['total']) - print(f" {filename:<38} {info['total']:>7} " - f"{info['active']:>7} {pct_active:>6.1f}") + # Align with directory format: skip Files/Used columns, + # show %code, then lines in kLOC column, active in Used column + print(f" {filename:<38} {'':>7} {'':>7} {'':>6} " + f"{pct_active:>6.1f} {klocs(info['total']):>8} " + f"{klocs(info['active']):>7}") else: # Show file-level only print(f" {filename:<38} {info['total']:>7} lines")