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

Add black-doc to pre-commit #4120

Merged
merged 8 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
@@ -1,3 +1,6 @@
# enforce unified code style with black
28914fc2236cd5850f536b151d0ef383855d8519
db0691cfb6b033e55664ffba25deb456a386a48c

# enforce unified code style in our documentation with blackdoc
a26a52d037a265774be0ca06bb141e3346e73ad0
akaszynski marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -4,6 +4,13 @@ repos:
hooks:
- id: black

- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: blackdoc
files: '\.py$'
exclude: pyvista/plotting/charts.py

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Expand Up @@ -116,6 +116,13 @@ skip-string-normalization = true
target-version = ['py39']
exclude='\.eggs|\.git|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist|node_modules'

[tool.blackdoc]
# From https://numpydoc.readthedocs.io/en/latest/format.html
# Extended discussion: https://github.com/pyvista/pyvista/pull/4129
# The length of docstring lines should be kept to 75 characters to facilitate
# reading the docstrings in text terminals.
line-length = 75

[tool.build_sphinx]
source-dir = 'doc'
build-dir = './doc/_build'
Expand Down
6 changes: 4 additions & 2 deletions pyvista/examples/downloads.py
Expand Up @@ -4676,7 +4676,9 @@ def download_fea_hertzian_contact_cylinder(load=True): # pragma: no cover
>>> import pyvista as pv
>>> from pyvista import examples
>>> grid = examples.download_fea_hertzian_contact_cylinder()
>>> grid.plot(scalars='PartID', cmap=['green', 'blue'], show_scalar_bar=False)
>>> grid.plot(
... scalars='PartID', cmap=['green', 'blue'], show_scalar_bar=False
... )

Plot the absolute value of the component stress in the Z direction.

Expand All @@ -4685,7 +4687,7 @@ def download_fea_hertzian_contact_cylinder(load=True): # pragma: no cover
>>> _ = pl.add_mesh(
... grid,
... scalars=z_stress,
... clim=[0, 1.2E9],
... clim=[0, 1.2e9],
... cmap='jet',
... lighting=True,
... show_edges=False,
Expand Down