Skip to content

Commit

Permalink
Add taplo pre-commit hook to format and sort toml files (#392)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
tkoyama010 and pre-commit-ci[bot] authored Nov 13, 2024
1 parent baa56d6 commit af464be
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 41 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ repos:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format

- 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"]
63 changes: 22 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,34 @@ name = "pyvista-tutorial"
requires-python = '>=3.9'

[tool.ruff]
exclude = [
'.git',
'pycache__',
'build',
'dist',
'doc/tutorial',
'doc/_build',
]
exclude = ['.git', 'build', 'dist', 'doc/_build', 'doc/tutorial', 'pycache__']
line-length = 100
indent-width = 4
lint.select = ["ALL"]
lint.ignore = [
"COM812",
"D203",
"D212",
"E501",
"ERA001",
"ISC001"
]
lint.ignore = ["COM812", "D203", "D212", "E501", "ERA001", "ISC001"]

[tool.ruff.lint.per-file-ignores]
"doc/**" = [
"ANN",
"ARG",
"D",
"INP001",
]
"doc/**" = ["ANN", "ARG", "D", "INP001"]
"tutorial/**" = [
"ANN",
"ARG",
# https://github.com/pyvista/pyvista/pull/6014
"B015",
# https://github.com/pyvista/pyvista/pull/6019
"B018",
"E402",
"D101",
"D102",
"D103",
"D107",
"D205",
"D400",
"D401",
"D415",
"F704",
"INP001",
"NPY",
"PLE1142",
"ANN",
"ARG",
# https://github.com/pyvista/pyvista/pull/6014
"B015",
# https://github.com/pyvista/pyvista/pull/6019
"B018",
"D101",
"D102",
"D103",
"D107",
"D205",
"D400",
"D401",
"D415",
"E402",
"F704",
"INP001",
"NPY",
"PLE1142",
]

[tool.ruff.format]
Expand Down

0 comments on commit af464be

Please sign in to comment.