From c2968244e4f597fd1c00a2303448609e8c521993 Mon Sep 17 00:00:00 2001 From: llyyr Date: Sun, 26 May 2024 15:10:43 +0530 Subject: [PATCH] TOOLS/gen-interface-changes: wrap long lines to 80 col --- TOOLS/gen-interface-changes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TOOLS/gen-interface-changes.py b/TOOLS/gen-interface-changes.py index 7f5435e216..1ed20994f3 100755 --- a/TOOLS/gen-interface-changes.py +++ b/TOOLS/gen-interface-changes.py @@ -22,6 +22,7 @@ import pathlib import sys +import textwrap from shutil import which from subprocess import check_output @@ -41,8 +42,10 @@ def add_new_entries(docs_dir, out, git): for file in files: with open(file[0].resolve(), "r") as f: for line in f: - line = " - " + line.rstrip() - out.write(line + "\n") + line = textwrap.fill(line.rstrip(), width=80, + initial_indent=" - ", + subsequent_indent=" ") + out.write(line + "\n") if __name__ == "__main__": if len(sys.argv) < 2: