From nobody Thu Dec 18 01:52:35 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B2B34400; Tue, 28 Jan 2025 00:06:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738022796; cv=none; b=riQowU6hXMWRo9WY22p0VxRTQiEzLUMMfwcECAAkEfkERXwmmnHtPXIrV5aeW7Cnc4Rd3ugXO3RdK1IgKwVaXSSeeR7N9ucQ3QZNC20EJEw9alnKSAmAHkGRjfAJwE6ug/Z/Y7K8c0+S+6ZuiKifHJML4igsKIDlosSycpUm4ek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738022796; c=relaxed/simple; bh=us6t/BhA/yQmA2s3pD6tzKRkBi35R7LRCdwJPClSus0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k0XzD2k665D2XCrufzj4TRA4XFuv45c7JEtEu67vs1YH5/rvQsKppmpBTQBQFmQsrZiBMiRWB5wLciSx8+6TNGbOacgV422JALlcqtlOuQnVdXhoVSXDc1lvJxBT8oNOV5ektAjae2FMS8BKGMqc1KSxNqi83e+/R22Zy2b3Hfk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZoE+68VR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZoE+68VR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A59E1C4CEE5; Tue, 28 Jan 2025 00:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738022795; bh=us6t/BhA/yQmA2s3pD6tzKRkBi35R7LRCdwJPClSus0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZoE+68VR/fcQQ5BHqCi+RYJwydoRAWcii4EfeuqSfFr0whvaK9QjtLosES+PleInM PnjQie3Esyxkn4I/YVncEuRaBV0W8gY79N/Ew9eBWpxtNK7eWMuEXw4QGDTEE8Z5u+ hB+KJhQROVosTs7RmAdPE0Qpsvd5yImaSCVALEJ5A5MAM1Ps7DKe0xrOlCUczbu+9V ayprTmotQVgQCehCTHQ0KZ3MIqciDX/Z8WyLlc3kYsdWwDR5lxIkVK4dadl+As/854 dygV5fsa5dETKwpExg1YYdNj14Vr0j0/UR8Be11Tqm9Xuvi9A2jgTU7mawFyF37U70 LNyfeFYB5YHCg== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tcZ7h-0000000DRKh-2w4P; Tue, 28 Jan 2025 01:06:33 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet , Greg Kroah-Hartman Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , linux-kernel@vger.kernel.org Subject: [RFC v2 05/38] docs: sphinx/kernel_abi: adjust coding style Date: Tue, 28 Jan 2025 01:05:54 +0100 Message-ID: <259b07bffa7907ab8e73939dd5d9f025b2f694a8.1738020236.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" Make pylint and flake8 happier with this module's coding style Signed-off-by: Mauro Carvalho Chehab --- Documentation/sphinx/kernel_abi.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Documentation/sphinx/kernel_abi.py b/Documentation/sphinx/kern= el_abi.py index 8401562cb5d9..a1887b50a900 100644 --- a/Documentation/sphinx/kernel_abi.py +++ b/Documentation/sphinx/kernel_abi.py @@ -32,32 +32,30 @@ u""" =20 """ =20 -import codecs import os -import subprocess -import sys import re +import sys =20 -from docutils import nodes, statemachine +from docutils import nodes from docutils.statemachine import ViewList from docutils.parsers.rst import directives, Directive -from docutils.utils.error_reporting import ErrorString from sphinx.util.docutils import switch_source_input from sphinx.util import logging =20 -__version__ =3D '1.0' +__version__ =3D "1.0" + =20 def setup(app): =20 app.add_directive("kernel-abi", KernelCmd) - return dict( - version =3D __version__ - , parallel_read_safe =3D True - , parallel_write_safe =3D True - ) + return { + "version": __version__, + "parallel_read_safe": True, + "parallel_write_safe": True + } + =20 class KernelCmd(Directive): - u"""KernelABI (``kernel-abi``) directive""" =20 required_arguments =3D 1 @@ -92,15 +90,15 @@ class KernelCmd(Directive): nodeList =3D self.nestedParse(lines, self.arguments[0]) return nodeList =20 - def nestedParse(self, lines, fname): + def nested_parse(self, lines, fname): env =3D self.state.document.settings.env content =3D ViewList() node =3D nodes.section() =20 if "debug" in self.options: code_block =3D "\n\n.. code-block:: rst\n :linenos:\n" - for l in lines.split("\n"): - code_block +=3D "\n " + l + for line in lines.split("\n"): + code_block +=3D "\n " + line lines =3D code_block + "\n\n" =20 line_regex =3D re.compile(r"^\.\. LINENO (\S+)\#([0-9]+)$") --=20 2.48.1