1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-18 23:50:07 +03:00

nixos-render-docs: De-lint using ruff --fix

This automated de-linting has applied a few different refactors:

- Remove unused imports and variables
- Change f-strings with no variables to regular strings
- Remove trailing semicolon
This commit is contained in:
Victor Engmark 2023-06-14 14:39:00 +12:00
parent 7403dd3fe2
commit 7b396875bb
13 changed files with 18 additions and 28 deletions

View file

@ -1,7 +1,6 @@
from collections.abc import Mapping, Sequence
from typing import Any, cast, Optional, NamedTuple
from typing import cast, Optional, NamedTuple
import markdown_it
from markdown_it.token import Token
from xml.sax.saxutils import escape, quoteattr
@ -197,7 +196,7 @@ class DocBookRenderer(Renderer):
spacing = ' spacing="compact"' if token.meta.get('compact', False) else ''
return f"<orderedlist{start}{spacing}>"
def ordered_list_close(self, token: Token, tokens: Sequence[Token], i: int) -> str:
return f"</orderedlist>"
return "</orderedlist>"
def heading_open(self, token: Token, tokens: Sequence[Token], i: int) -> str:
hlevel = int(token.tag[1:])
result = self._close_headings(hlevel)