This patch replaces the 78 "-" prints with 75 "-". And replace the 80
columns summary line with 77 columns. ("%s" is considered as two chars
and should be filled with whitespace " ", so 77 = 75 + 2)

Consider this scenario: a patch contains the output of "bloat-o-meter" to
clarify about the size impact/diff, and when we validate this patch with
"~/linux/scripts/checkpatch.pl" (from linux kernel source tree), which
checks for style violations, it might complain about line wrapped like:[1]
WARNING: \
Possible unwrapped commit description (prefer a maximum 75 chars per line)

The 1st complaint is seperation line with 78 '-' prints, and the 2nd
complaint is summary line "(add/remove ... Total: n bytes)". Although
these two warnings are not harmful at all, it is helpful and makes life
easier if this kind of patch (with "bloat-o-meter" output) could be passed
by 'checkpatch.pl' in the first place without manually inspection.

[1] line wrapped at 75 columns:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Signed-off-by: Jones Syue <joness...@qnap.com>
---
v2:
  - fix nit/typo with correct word 'scenario'
v1: http://lists.busybox.net/pipermail/busybox/2024-March/090656.html
---
 scripts/bloat-o-meter | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index b4a1d28113b0..7fe4a06ae19e 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -130,10 +130,10 @@ for d, n in delta:
         old_sz = old.get(n, {}).get("size", "-")
         new_sz = new.get(n, {}).get("size", "-")
         print("%-48s %7s %7s %+7d" % (n, old_sz, new_sz, d))
-print("-"*78)
+print("-"*75)
 total="(add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s)%%sTotal: %s 
bytes"\
     % (add, remove, grow, shrink, up, -down, up-down)
-print(total % (" "*(80-len(total))))
+print(total % (" "*(77-len(total))))
 if flag_timing:
     print("\n%d/%d; %d Parse origin/new; processing nsecs" %
         (end_t1-start_t1, end_t2-start_t2, end_t3-start_t3))
-- 
2.1.4
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to