Re: [PATCH v2 2/2] docs: python: abi_regex: convert adjacent index placeholders

Jonathan Corbet <[email protected]>
Newsgroups org.kernel.vger.linux-cxl,org.kernel.vger.linux-doc
Message-ID <[email protected]>
Alison Schofield <[email protected]> writes:

> While validating recent CXL ABI documentation updates with
> get_abi.py, every decoderX.Y entry was reported as undocumented.
>
> The placeholder conversion mishandles adjacent index placeholders,
> producing patterns that cannot match the corresponding sysfs paths.
> As a result, valid ABI entries are reported as undocumented.
>
> Handle adjacent placeholders independently so generated patterns match
> the documented paths. This fixes decoderX.Y entries in the CXL ABI and
> other ABI documentation that uses the same naming convention.
>
> Signed-off-by: Alison Schofield <[email protected]>
> ---
>
> Changes in v2:
> - No changes
>
>
>  tools/lib/python/abi/abi_regex.py | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/lib/python/abi/abi_regex.py b/tools/lib/python/abi/abi_regex.py
> index 69d8507b7382..198ecbf49c51 100644
> --- a/tools/lib/python/abi/abi_regex.py
> +++ b/tools/lib/python/abi/abi_regex.py
> @@ -65,8 +65,7 @@ class AbiRegex(AbiParser):
>          (re.compile(r"\[[^\]]+\]"), "\\\\w\xf7"),
>  
>          (re.compile(r"XX+"), "\\\\w\xf7"),
> -        (re.compile(r"([^A-Z])[XYZ]([^A-Z])"), "\\1\\\\w\xf7\\2"),
> -        (re.compile(r"([^A-Z])[XYZ]$"), "\\1\\\\w\xf7"),
> +        (re.compile(r"(?<![A-Z])[XYZ](?![A-Z])"), "\\\\w\xf7"),
>          (re.compile(r"_[AB]_"), "_\\\\w\xf7_"),

Sigh ... these regexes are absolutely unreadable.  Not your fault, of
course, and I've applied the patch, but it sure would be nice to get
some documentation in there at some point.

Thanks,

jon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.