Skip to content

Commit

Permalink
docs(conf) Fix UP031 (printf-string-formatting)
Browse files Browse the repository at this point in the history
https://docs.astral.sh/ruff/rules/printf-string-formatting/

docs/conf.py:201:16: UP031 Use format specifiers instead of percent format
    |
195 |         lineno = None
196 |
197 |     linespec = "#L%d-L%d" % (lineno, lineno + len(source) - 1) if lineno else ""
    |                ^^^^^^^^^^ UP031
198 |
199 |     fn = relpath(fn, start=pathlib.Path(vcspull.__file__).parent)
    |
    = help: Replace with format specifiers
  • Loading branch information
tony committed Nov 23, 2024
1 parent 727b3f3 commit aa84153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def linkcode_resolve(domain: str, info: dict[str, str]) -> t.Union[None, str]:
except Exception:
lineno = None

linespec = "#L%d-L%d" % (lineno, lineno + len(source) - 1) if lineno else ""
linespec = f"#L{lineno}-L{lineno + len(source) - 1}" if lineno else ""

fn = relpath(fn, start=pathlib.Path(libvcs.__file__).parent)

Expand Down

0 comments on commit aa84153

Please sign in to comment.