From 9e1658b2711c52b97b2cd89a3194c644da589e7b Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Mon, 27 Apr 2026 21:24:32 -0400 Subject: [PATCH 1/3] build: change pre-commit workflow to ruff --- .pre-commit-config.yaml | 11 +++++------ news/ruff.rst | 23 +++++++++++++++++++++++ pyproject.toml | 9 +++++---- 3 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 news/ruff.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5dc03f8..758147d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,10 +58,9 @@ repos: - id: prettier additional_dependencies: - "prettier@^3.2.4" - # docformatter - PEP 257 compliant docstring formatter - - repo: https://github.com/s-weigand/docformatter - rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c + # ruff - An extremely fast Python linter and code formatter, written in Rust. + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.15.12 hooks: - - id: docformatter - additional_dependencies: [tomli] - args: [--in-place, --config, ./pyproject.toml] + - id: ruff-check + args: [--fix] diff --git a/news/ruff.rst b/news/ruff.rst new file mode 100644 index 0000000..f007906 --- /dev/null +++ b/news/ruff.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Changed pre-commit workflow from docformatter to ruff + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index 76a00e8..2e05dde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,10 +3,11 @@ exclude-file = ".codespell/ignore_lines.txt" ignore-words = ".codespell/ignore_words.txt" skip = "*.cif,*.dat" -[tool.docformatter] -recursive = true -wrap-summaries = 72 -wrap-descriptions = 72 +[tool.ruff] +line-length = 115 + +[tool.ruff.lint.pydocstyle] +convention = "numpy" [tool.black] line-length = 79 From d97c0617679cae0c630f3477516380f74fe83504 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Mon, 4 May 2026 18:17:17 -0400 Subject: [PATCH 2/3] chore: change line length to 79 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2e05dde..401840d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ ignore-words = ".codespell/ignore_words.txt" skip = "*.cif,*.dat" [tool.ruff] -line-length = 115 +line-length = 79 [tool.ruff.lint.pydocstyle] convention = "numpy" From c5439acf2ecc9f9c9501afc869149e5f8f8871a6 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 7 May 2026 23:23:21 -0400 Subject: [PATCH 3/3] chore: link project.toml and change lin-length limit --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 758147d..3c7126e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -63,4 +63,4 @@ repos: rev: v0.15.12 hooks: - id: ruff-check - args: [--fix] + args: [--fix, --config=pyproject.toml] diff --git a/pyproject.toml b/pyproject.toml index 401840d..de259eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ ignore-words = ".codespell/ignore_words.txt" skip = "*.cif,*.dat" [tool.ruff] -line-length = 79 +line-length = 72 [tool.ruff.lint.pydocstyle] convention = "numpy"