[igt-dev] [PATCH] scripts/igt_doc.py: ignore normal documentation tags
Kamil Konieczny
kamil.konieczny at linux.intel.com
Tue Apr 4 15:41:09 UTC 2023
On 2023-03-28 at 13:10:35 +0200, Mauro Carvalho Chehab wrote:
> 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>
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
> 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