From 8d884b9f1f3ee0dcb4381d30e092f008d268a80b Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Fri, 22 Nov 2024 07:32:01 +0900 Subject: [PATCH] Add `taplo` pre-commit hook to format and sort `toml` files (#76) * Add `taplo` pre-commit hook to format and sort `toml` files * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 7 +++++++ pyproject.toml | 10 ++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 17d9f39..a879934 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -78,3 +78,10 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace exclude: ^(|pyvista/examples/.*\.ply|pyvista/examples/.*\.vtk) + +- 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", --option, "reorder_keys=true"] diff --git a/pyproject.toml b/pyproject.toml index 1213455..8f10611 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [tool.black] +exclude = '\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|node_modules' line-length = 100 skip-string-normalization = false target-version = ["py38"] -exclude='\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|node_modules' [tool.isort] -profile = "black" line_length = 100 +profile = "black" # Sort by name, don't cluster "from" vs "import" force_sort_within_sections = true # Combines "as" imports on the same line @@ -14,11 +14,9 @@ combine_as_imports = true [tool.pytest.ini_options] -filterwarnings = [ - "ignore::pvxarray.DataCopyWarning", -] +filterwarnings = ["ignore::pvxarray.DataCopyWarning"] [tool.codespell] -skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.ply,*.vtk,*.vti,*.vtu,*.vts,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,doc/_build/*,./dist/*,*~,.hypothesis*,*.mypy_cache/*,*cover,' quiet-level = 3 +skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.ply,*.vtk,*.vti,*.vtu,*.vts,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,doc/_build/*,./dist/*,*~,.hypothesis*,*.mypy_cache/*,*cover,'