Skip to content

Commit 501cb14

Browse files
committed
chore: ruff
1 parent fa533ad commit 501cb14

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

mknodes/info/mkdocsconfigfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def mkdocstrings_config(self) -> dict:
3434
def remove_plugin(self, name: str):
3535
for plg in self.plugins:
3636
if plg == name or (isinstance(plg, dict) and next(iter(plg.keys())) == name):
37-
self.plugins.remove(plg)
37+
self.plugins.remove(plg) # noqa: B909
3838

3939
def update_mknodes_section(
4040
self,

mknodes/info/nodefile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_representations(jinja: str, parent: mk.MkNode) -> dict[str, str | mk.MkN
4848
dct: dict[str, str | mk.MkNode] = dict( # type: ignore[annotation-unchecked]
4949
Jinja=mk.MkCode(jinja, language="jinja"),
5050
Repr=mk.MkCode(textfilters.format_code(repr(node))),
51-
Rendered=node.__copy__(),
51+
Rendered=node.__copy__(), # noqa: PLC2801
5252
Markdown=mk.MkCode(node, language="markdown"),
5353
Html=mk.MkCode(node.to_html(), language="html"),
5454
)

mknodes/manual/navs_section.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _(nav: mk.MkNav):
2424
nav.parse.file(summary_file, hide="toc")
2525
page = nav.add_page(is_index=True, hide="toc", icon="file")
2626
text = summary_file.read_text()
27-
text = text.replace("](", "] (") ##
27+
text = text.replace("](", "] (") ## # noqa: E262
2828
path = paths.TEST_RESOURCES / "nav_tree/"
2929
variables = dict(path=path, text=text)
3030
page += mk.MkTemplate("navs/nav_from_file.jinja", variables=variables)

mknodes/templatenodes/mklicense/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Any
44

55
from mknodes.basenodes import mktext
6-
from mknodes.info import license
6+
from mknodes.info import license as lic
77
from mknodes.utils import log
88

99

@@ -38,13 +38,13 @@ def __init__(
3838
@property
3939
def text(self):
4040
if self.license_type:
41-
lic = license.License.from_name(self.license_type)
41+
obj = lic.License.from_name(self.license_type)
4242
if self.ctx.metadata.distribution_name:
43-
lic.resolve_by_distribution(self.ctx.metadata.distribution_name)
44-
return lic.content
43+
obj.resolve_by_distribution(self.ctx.metadata.distribution_name)
44+
return obj.content
4545
return self.ctx.metadata.license_text or ""
4646

4747

4848
if __name__ == "__main__":
49-
lic = MkLicense.with_context("GPL-3.0")
50-
print(repr(lic))
49+
node = MkLicense.with_context("GPL-3.0")
50+
print(repr(node))

0 commit comments

Comments
 (0)