Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp373011pxu; Wed, 14 Oct 2020 03:44:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1EywmG+KExjAyi2gLW4km+QdVLzTMRfo30k1yJa+36sZN+VOjWJuxTQIA7JcFlDrYDB9j X-Received: by 2002:a50:b261:: with SMTP id o88mr4670153edd.150.1602672248574; Wed, 14 Oct 2020 03:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602672248; cv=none; d=google.com; s=arc-20160816; b=NrrPRET1W9De3dfRI7jmAdknSxQM5PyOTwVPLe4+UR7rf5ycm1A21W5SF6Hz7OGwCE uASCH/DPX26YO6+szIX+UorWjXJ/iEwjwlk8f/D0damX28sD18svALGxBkzZatK29GWt xH9oVIo8yKZ1+VfTyKjUWd4o20AxZLvNyIH0geQvcMibxbWS+DT+Kr3u/StE9yfSUDWH UyV3dlp0NfGgXNCzEqNOKGCplZH6eor0mWOshdIetnxUTmpDDdUacteA64DjgZF7bUhq jcucv1F/ibLAg7yJkhncDgDQZ4MeR3ZmfSwknHxETgJ+QOX6zk7TA0nFEuVCfTlND0Dy Cv0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=316PuDETxATxjxWhDADgUuY40wkYN3jWT5Cw8aCXx+I=; b=BwMF6g+A/zXy2mNjISpWjnB3S+BhMYHv2ule8yXM6H7o+uuyC1qUrEMgKtUIA3bfa3 871JNvb8WEzzX+6iWaNL6YHwr4DlbvAb2pPMjI/1zxgwle408WAbhs5qOb18Oe2NGKbR 69gssHKvv5KJCMNWtj4hPKw3oGbBIXhvmlcn+biGyaq7Dsn562GOCEX8J/DUPhllvwDk IlMn4sofmSbmO3D3Pdel+gYmJVy8QhOAND4TVyqkZtsD96Ni+jg1r69bB8LyiwePduIA n2V65ZGIHJMQgsHZ42ftjhrqDVt17bEUiQ/Od0PI6vyin52/LrLcacdwYvKCFTmkhLrD W8gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=GEGtJpq2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si1893338edq.569.2020.10.14.03.43.46; Wed, 14 Oct 2020 03:44:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=GEGtJpq2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388020AbgJMXNY (ORCPT + 99 others); Tue, 13 Oct 2020 19:13:24 -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 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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