[igt-dev] [PATCH] scripts/igt_doc.py: ignore normal documentation tags

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Tue Mar 28 11:10:35 UTC 2023


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

Only bail out on comments if a field is not recognized on comments
with TEST or SUBTEST tags.

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

diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
index 67ab7984dd11..92d925c451ed 100755
--- a/scripts/igt_doc.py
+++ b/scripts/igt_doc.py
@@ -828,6 +828,7 @@ class TestList:
         arg_number = 1
         cur_arg = -1
         cur_arg_element = 0
+        has_test_or_subtest = 0
 
         with open(fname, 'r', encoding='utf8') as handle:
             arg_ref = None
@@ -845,6 +846,7 @@ class TestList:
                     current_subtest = None
                     arg_ref = None
                     cur_arg = -1
+                    has_test_or_subtest = 0
 
                     continue
 
@@ -864,6 +866,7 @@ class TestList:
                     # Check if it is a new TEST section
                     match = re.match(r'^TEST:\s*(.*)', file_line)
                     if match:
+                        has_test_or_subtest = 1
                         current_test = self.test_number
                         self.test_number += 1
 
@@ -884,6 +887,7 @@ class TestList:
                 # Check if it is a new SUBTEST section
                 match = re.match(r'^SUBTESTS?:\s*(.*)', file_line)
                 if match:
+                    has_test_or_subtest = 1
                     current_subtest = subtest_number
                     subtest_number += 1
 
@@ -934,6 +938,9 @@ class TestList:
 
                     continue
 
+                if not has_test_or_subtest:
+                    continue
+
                 # Use hashes for arguments to avoid duplication
                 match = re.match(r'arg\[(\d+)\]:\s*(.*)', file_line)
                 if match:
-- 
2.39.2



More information about the igt-dev mailing list