[PATCH i-g-t 05/10] scripts/xls_to_doc.py: improve the addition logic

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Thu Mar 14 10:29:14 UTC 2024


From: Mauro Carvalho Chehab <mchehab at kernel.org>

If the last line before inserting a new value is a blank comment,
add the new fiels before that.

Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---
 scripts/xls_to_doc.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/xls_to_doc.py b/scripts/xls_to_doc.py
index a090dcffe98e..0aa774e811a3 100755
--- a/scripts/xls_to_doc.py
+++ b/scripts/xls_to_doc.py
@@ -205,6 +205,9 @@ class FillTests(TestList):
                     content[i] = ""
 
         if value != "":
+            if i > 2 and re.match(r'\s*\*\s*$', content[i - 1]):
+                i -= 1
+
             content.insert(i, f' * {field}: {value}\n')
 
     def parse_spreadsheet(self, fname, sheets=None):
-- 
2.43.2



More information about the igt-dev mailing list