Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop black from pre-commit hooks and add ruff-format #343

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
repos:
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
Expand Down Expand Up @@ -51,3 +46,8 @@ repos:
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
hooks:
- id: ruff-format
25 changes: 19 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[project]
requires-python = '>=3.9'

[tool.isort]
profile = "black"
line_length = 100
Expand All @@ -7,11 +10,21 @@ force_sort_within_sections = true
combine_as_imports = true
skip_glob = "pyvista/**/__init__.py,pyvista/__init__.py"

[tool.black]
line-length = 100
skip-string-normalization = true
target-version = ["py39"]
exclude='\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|node_modules'

[tool.pydocstyle]
match = '(?!coverage).*.py'

[tool.ruff]
exclude = [
'.git',
'pycache__',
'build',
'dist',
'doc/tutorial',
'doc/_build',
]
line-length = 100
indent-width = 4

[tool.ruff.format]
docstring-code-format = true
quote-style = "preserve"
1 change: 0 additions & 1 deletion tutorial/03_figures/a_lesson_figures.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Lesson Overview
~~~~~~~~~~~~~~~

"""

import pyvista as pv
Expand Down
1 change: 0 additions & 1 deletion tutorial/06_vtk/e_vtk_next.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@


def build_magnetic_coils(mesh, current=1000):

magpy_coils = magpy.Collection()

# Extract blocks under the "coils" node.
Expand Down
1 change: 1 addition & 0 deletions tutorial/09_trame/a_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Getting started with PyVista and Trame

"""

import pyvista as pv
from pyvista import examples

Expand Down
Loading