From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 554F1C43467 for ; Tue, 13 Oct 2020 23:13:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16E3621582 for ; Tue, 13 Oct 2020 23:13:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="GEGtJpq2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387919AbgJMXNX (ORCPT ); Tue, 13 Oct 2020 19:13:23 -0400 Received: from mail-02.mail-europe.com ([51.89.119.103]:43556 "EHLO mail-02.mail-europe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729752AbgJMXNX (ORCPT ); Tue, 13 Oct 2020 19:13:23 -0400 Date: Tue, 13 Oct 2020 23:13:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1602630800; bh=316PuDETxATxjxWhDADgUuY40wkYN3jWT5Cw8aCXx+I=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=GEGtJpq2Se3J1C7OF8Ia7e4gPEBBr13hO70dBfF7/sLMcNbNlX1j8hSNIEgtBjukd fcql2T5Wf5on0zapGwUiutBsaK/Qm8KyQLBuAGiaM7oSNwqmXlCWQNgbddrGO+f8QO nwChsZf/ZP2dYObJJ3y62VR66cNR6PrS3kSXw6gk= To: Jonathan Corbet , Mauro Carvalho Chehab From: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Reply-To: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Subject: [PATCH v2 2/5] docs: automarkup.py: Fix regexes to solve sphinx 3 warnings Message-ID: <20201013231218.2750109-3-nfraprado@protonmail.com> In-Reply-To: <20201013231218.2750109-1-nfraprado@protonmail.com> References: <20201013231218.2750109-1-nfraprado@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org With the transition to Sphinx 3, new warnings were generated by automarkup, exposing bugs in the regexes. The warnings were caused by the expressions matching words in the translated versions of the documentation, since any unicode character was matched. Fix the regular expression by making the C regexes use ASCII and ensuring the expressions only match the beginning of words. Signed-off-by: N=C3=ADcolas F. R. A. Prado --- Documentation/sphinx/automarkup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/auto= markup.py index db13fb15cedc..43dd9025fc77 100644 --- a/Documentation/sphinx/automarkup.py +++ b/Documentation/sphinx/automarkup.py @@ -22,12 +22,13 @@ from itertools import chain # :c:func: block (i.e. ":c:func:`mmap()`s" flakes out), so the last # bit tries to restrict matches to things that won't create trouble. # -RE_function =3D re.compile(r'(([\w_][\w\d_]+)\(\))') +RE_function =3D re.compile(r'\b(([a-zA-Z_]\w+)\(\))', flags=3Dre.ASCII) =20 # # Sphinx 2 uses the same :c:type role for struct, union, enum and typedef # -RE_generic_type =3D re.compile(r'(struct|union|enum|typedef)\s+([\w_][\w\d= _]+)') +RE_generic_type =3D re.compile(r'\b(struct|union|enum|typedef)\s+([a-zA-Z_= ]\w+)', + flags=3Dre.ASCII) =20 # # Sphinx 3 uses a different C role for each one of struct, union, enum and @@ -42,7 +43,7 @@ RE_typedef =3D re.compile(r'\b(typedef)\s+([a-zA-Z_]\w+)'= , flags=3Dre.ASCII) # Detects a reference to a documentation page of the form Documentation/..= . with # an optional extension # -RE_doc =3D re.compile(r'Documentation(/[\w\-_/]+)(\.\w+)*') +RE_doc =3D re.compile(r'\bDocumentation(/[\w\-_/]+)(\.\w+)*') =20 # # Many places in the docs refer to common system calls. It is --=20 2.28.0