Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
faccc0ec 3d89178b

+12 -13
+12 -13
Documentation/sphinx/kernel_abi.py
··· 32 32 33 33 """ 34 34 35 - import codecs 36 35 import os 36 + import re 37 37 import subprocess 38 38 import sys 39 - import re 40 39 41 - from docutils import nodes, statemachine 40 + from docutils import nodes 42 41 from docutils.statemachine import ViewList 43 42 from docutils.parsers.rst import directives, Directive 44 - from docutils.utils.error_reporting import ErrorString 45 43 from sphinx.util.docutils import switch_source_input 46 44 from sphinx.util import logging 47 45 48 - __version__ = '1.0' 46 + __version__ = "1.0" 47 + 49 48 50 49 def setup(app): 51 50 52 51 app.add_directive("kernel-abi", KernelCmd) 53 - return dict( 54 - version = __version__ 55 - , parallel_read_safe = True 56 - , parallel_write_safe = True 57 - ) 52 + return { 53 + "version": __version__, 54 + "parallel_read_safe": True, 55 + "parallel_write_safe": True 56 + } 57 + 58 58 59 59 class KernelCmd(Directive): 60 - 61 60 u"""KernelABI (``kernel-abi``) directive""" 62 61 63 62 required_arguments = 1 ··· 98 99 99 100 if "debug" in self.options: 100 101 code_block = "\n\n.. code-block:: rst\n :linenos:\n" 101 - for l in lines.split("\n"): 102 - code_block += "\n " + l 102 + for line in lines.split("\n"): 103 + code_block += "\n " + line 103 104 lines = code_block + "\n\n" 104 105 105 106 line_regex = re.compile(r"^\.\. LINENO (\S+)\#([0-9]+)$")