From 0386d291abfc1943e02b2e0106dd89bc3b931f32 Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Wed, 13 Nov 2024 08:46:44 +0900 Subject: [PATCH 1/2] Add `taplo` pre-commit hook to format and sort `toml` files --- .pre-commit-config.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1910cd91..d1182a73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,6 +73,12 @@ repos: rev: 2024.08.19 hooks: - id: sp-repo-review + - repo: https://github.com/ComPWA/taplo-pre-commit + rev: v0.9.3 + hooks: + - id: taplo-format + # See options: https://taplo.tamasfe.dev/configuration/formatter-options.html + args: [--option, "reorder_arrays=true"] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: @@ -90,7 +96,3 @@ repos: args: [--branch, main] - id: requirements-txt-fixer - id: trailing-whitespace - - repo: https://github.com/pappasam/toml-sort - rev: v0.23.1 - hooks: - - id: toml-sort-fix From 9ad7d9542cbf430155b1acbfa6cd6db1a2a48520 Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Wed, 13 Nov 2024 13:26:50 +0900 Subject: [PATCH 2/2] Remove unused comments from `pyproject.toml` file --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c09744cd..aea5f6f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,9 +77,7 @@ ignore = [ ] [tool.ruff.lint.isort] -# Sort by name, don't cluster "from" vs "import" force-sort-within-sections = true -# Combines "as" imports on the same line combine-as-imports = true required-imports = ["from __future__ import annotations"] force-single-line = true @@ -90,7 +88,6 @@ force-single-line = true "examples/**" = ["D205", "D400", "D415", "INP001", "T201"] [tool.ruff.lint.pyupgrade] -# Preserve types, even if a file imports `from __future__ import annotations`. keep-runtime-typing = true [tool.setuptools.dynamic]