Skip to content

Commit faccc0e

Browse files
mchehabJonathan Corbet
authored andcommitted
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
1 parent 3d89178 commit faccc0e

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

Documentation/sphinx/kernel_abi.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,31 @@
3232
3333
"""
3434

35-
import codecs
3635
import os
36+
import re
3737
import subprocess
3838
import sys
39-
import re
4039

41-
from docutils import nodes, statemachine
40+
from docutils import nodes
4241
from docutils.statemachine import ViewList
4342
from docutils.parsers.rst import directives, Directive
44-
from docutils.utils.error_reporting import ErrorString
4543
from sphinx.util.docutils import switch_source_input
4644
from sphinx.util import logging
4745

48-
__version__ = '1.0'
46+
__version__ = "1.0"
47+
4948

5049
def setup(app):
5150

5251
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+
}
5857

59-
class KernelCmd(Directive):
6058

59+
class KernelCmd(Directive):
6160
u"""KernelABI (``kernel-abi``) directive"""
6261

6362
required_arguments = 1
@@ -99,8 +98,8 @@ def nestedParse(self, lines, fname):
9998

10099
if "debug" in self.options:
101100
code_block = "\n\n.. code-block:: rst\n :linenos:\n"
102-
for l in lines.split("\n"):
103-
code_block += "\n " + l
101+
for line in lines.split("\n"):
102+
code_block += "\n " + line
104103
lines = code_block + "\n\n"
105104

106105
line_regex = re.compile(r"^\.\. LINENO (\S+)\#([0-9]+)$")

0 commit comments

Comments
 (0)