From d3fa8be60b27ec9e45e39d0f8734e409618ad262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicholas=20Kr=C3=A4mer?= Date: Tue, 10 Sep 2024 08:20:57 +0200 Subject: [PATCH] Autoformat the example scripts in all docstrings (#217) * Autoupdate the pre-commit hook * Autoformat the docstring-examples via ruff --- .pre-commit-config.yaml | 2 +- matfree/bounds.py | 1 - matfree/decomp.py | 1 - pyproject.toml | 5 ++++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c71ef58..dddcd4b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: check-merge-conflict - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.6.2 + rev: v0.6.4 hooks: # Run the linter. - id: ruff diff --git a/matfree/bounds.py b/matfree/bounds.py index 99266dd..81aee3a 100644 --- a/matfree/bounds.py +++ b/matfree/bounds.py @@ -30,7 +30,6 @@ def baigolub96_logdet_spd(bound_spectrum, /, nrows, trace, norm_frobenius_square publisher={Citeseer} } ``` - """ mu1, mu2 = trace, norm_frobenius_squared beta = bound_spectrum diff --git a/matfree/decomp.py b/matfree/decomp.py index 30f9411..e2c1796 100644 --- a/matfree/decomp.py +++ b/matfree/decomp.py @@ -358,7 +358,6 @@ def hessenberg( year={2024} } ``` - """ reortho_expected = ["none", "full"] if reortho not in reortho_expected: diff --git a/pyproject.toml b/pyproject.toml index f2ed29e..31e7ca3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,6 +111,7 @@ select = [ # Docstrings: "D", ] + ignore = [ # warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. "D203", @@ -126,8 +127,10 @@ line-ending = "lf" # Prefer single quotes over double quotes. quote-style = "double" skip-magic-trailing-comma = true +docstring-code-format = true +docstring-code-line-length = "dynamic" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Ignore all directories named `tests`. "tests/**" = ["D"] "matfree/backend/**" = ["D"]