summaryrefslogtreecommitdiff
path: root/Documentation/sphinx/kernel_abi.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-02-10 13:17:51 +0300
committerJonathan Corbet <corbet@lwn.net>2025-02-10 21:19:56 +0300
commitfaccc0ec64e193b6aa9894eec134165317ae2a0f (patch)
tree749827e8934b3f47e209688c49a5b2bb057d79c0 /Documentation/sphinx/kernel_abi.py
parent3d89178b85a1c1fd106289afba0adfa6d013676a (diff)
downloadlinux-faccc0ec64e193b6aa9894eec134165317ae2a0f.tar.xz
docs: sphinx/kernel_abi: adjust coding style
Make pylint and flake8 happier with this module's coding style Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/02a9ec0fab61e4c94b9c2ff555bc0e9d93f59100.1739182025.git.mchehab+huawei@kernel.org
Diffstat (limited to 'Documentation/sphinx/kernel_abi.py')
-rw-r--r--Documentation/sphinx/kernel_abi.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/Documentation/sphinx/kernel_abi.py b/Documentation/sphinx/kernel_abi.py
index 8401562cb5d9..38653f5706c0 100644
--- a/Documentation/sphinx/kernel_abi.py
+++ b/Documentation/sphinx/kernel_abi.py
@@ -32,32 +32,31 @@ u"""
"""
-import codecs
import os
+import re
import subprocess
import sys
-import re
-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
-__version__ = '1.0'
+__version__ = "1.0"
+
def setup(app):
app.add_directive("kernel-abi", KernelCmd)
- return dict(
- version = __version__
- , parallel_read_safe = True
- , parallel_write_safe = True
- )
+ return {
+ "version": __version__,
+ "parallel_read_safe": True,
+ "parallel_write_safe": True
+ }
-class KernelCmd(Directive):
+class KernelCmd(Directive):
u"""KernelABI (``kernel-abi``) directive"""
required_arguments = 1
@@ -99,8 +98,8 @@ class KernelCmd(Directive):
if "debug" in self.options:
code_block = "\n\n.. code-block:: rst\n :linenos:\n"
- for l in lines.split("\n"):
- code_block += "\n " + l
+ for line in lines.split("\n"):
+ code_block += "\n " + line
lines = code_block + "\n\n"
line_regex = re.compile(r"^\.\. LINENO (\S+)\#([0-9]+)$")