Skip to content

Commit e3169d8

Browse files
authored
ci: update pre-commit config (#113)
Update pre-commit config from trame cookiecutter
1 parent f42e915 commit e3169d8

10 files changed

Lines changed: 108 additions & 38 deletions

File tree

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ comment: false
22
coverage:
33
status:
44
project: off
5-
patch: off
5+
patch: off

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[run]
2-
omit = *docs*, *tests*, setup.py
2+
omit = *docs*, *tests*, setup.py

.pre-commit-config.yaml

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,81 @@
1+
ci:
2+
autoupdate_commit_msg: "chore: update pre-commit hooks"
3+
autofix_commit_msg: "style: pre-commit fixes"
4+
5+
exclude: ^.cruft.json|.copier-answers.yml$|.*\.md|LICENSE|static_viewer.html|serve
6+
17
repos:
2-
- repo: https://github.com/codespell-project/codespell
3-
rev: v2.1.0
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: "v6.0.0"
410
hooks:
5-
- id: codespell
11+
- id: check-added-large-files
12+
- id: check-case-conflict
13+
- id: check-merge-conflict
14+
- id: check-symlinks
15+
- id: check-yaml
16+
- id: debug-statements
17+
- id: end-of-file-fixer
18+
- id: mixed-line-ending
19+
- id: name-tests-test
20+
args: ["--pytest-test-first"]
21+
- id: requirements-txt-fixer
22+
- id: trailing-whitespace
23+
24+
- repo: https://github.com/pre-commit/pygrep-hooks
25+
rev: "v1.10.0"
26+
hooks:
27+
- id: rst-backticks
28+
- id: rst-directive-colons
29+
- id: rst-inline-touching-normal
30+
31+
- repo: https://github.com/rbubley/mirrors-prettier
32+
rev: "v3.8.1"
33+
hooks:
34+
- id: prettier
35+
types_or: [yaml, markdown, html, css, scss, javascript, json]
36+
args: [--prose-wrap=always]
637

738
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.8.4
39+
rev: "v0.15.0"
940
hooks:
1041
- id: ruff
11-
- id: ruff-format
42+
args: ["--fix", "--show-fixes"]
43+
- id: ruff-format
44+
45+
- repo: https://github.com/codespell-project/codespell
46+
rev: "v2.4.1"
47+
hooks:
48+
- id: codespell
49+
50+
- repo: https://github.com/shellcheck-py/shellcheck-py
51+
rev: "v0.11.0.1"
52+
hooks:
53+
- id: shellcheck
54+
55+
- repo: local
56+
hooks:
57+
- id: disallow-caps
58+
name: Disallow improper capitalization
59+
language: pygrep
60+
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
61+
exclude: .pre-commit-config.yaml
62+
63+
- repo: https://github.com/abravalheri/validate-pyproject
64+
rev: "v0.25"
65+
hooks:
66+
- id: validate-pyproject
67+
additional_dependencies: ["validate-pyproject-schema-store[all]"]
68+
69+
- repo: https://github.com/python-jsonschema/check-jsonschema
70+
rev: "0.36.1"
71+
hooks:
72+
- id: check-dependabot
73+
- id: check-github-workflows
74+
- id: check-readthedocs
75+
76+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
77+
rev: v9.24.0
78+
hooks:
79+
- id: commitlint
80+
stages: [commit-msg]
81+
additional_dependencies: ["@commitlint/config-conventional"]

README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ VtkLocalView
118118
The VtkLocalView component relies on the server for defining the vtkRenderWindow but then only the geometry is exchanged with the client.
119119
The server does not need a GPU as no rendering is happening on the server.
120120
The vtkRenderWindow is only used to retrieve the scene data and parameters (coloring by, representations, ...).
121-
By relying on the same vtkRenderWindow, you can easily switch from a `VtkRemoteView` to a `VtkLocalView` or vice-versa.
121+
By relying on the same vtkRenderWindow, you can easily switch from a ``VtkRemoteView`` to a ``VtkLocalView`` or vice-versa.
122122
This component gives you controls on how you want to map mouse interaction with the camera.
123-
The default setting mimic default VTK interactor style so you will rarely have to override to the `interactor_settings`.
124-
The VtkLocalView supports WebXR thanks to the `VtkWebXRHelper` component. Please refer to the examples for details on how to use it.
123+
The default setting mimic default VTK interactor style so you will rarely have to override to the ``interactor_settings``.
124+
The VtkLocalView supports WebXR thanks to the ``VtkWebXRHelper`` component. Please refer to the examples for details on how to use it.
125125

126126
How to use it?
127127
```````````````````````````````````````````````````````````
@@ -157,7 +157,7 @@ The component also provides a convenient method to push the scene to the client
157157
Interactor Settings
158158
```````````````````````````````````````````````````````````
159159

160-
For the `interactor_settings` we expect a list of mouse event type linked to an action. The example below is what is used as default:
160+
For the ``interactor_settings`` we expect a list of mouse event type linked to an action. The example below is what is used as default:
161161

162162
.. code-block:: javascript
163163
@@ -247,8 +247,8 @@ Examples
247247
VtkRemoteLocalView
248248
-----------------------------------------------------------
249249

250-
The VtkRemoteLocalView component is a blend of `VtkLocalView` and `VtkRemoteView` where the user can choose dynamically which mode they want to be in.
251-
When instantiating a `VtkRemoteLocalView` several variables and triggers will be created for you to more easily control your view.
250+
The VtkRemoteLocalView component is a blend of ``VtkLocalView`` and ``VtkRemoteView`` where the user can choose dynamically which mode they want to be in.
251+
When instantiating a ``VtkRemoteLocalView`` several variables and triggers will be created for you to more easily control your view.
252252

253253
How to use it?
254254
```````````````````````````````````````````````````````````
@@ -279,7 +279,7 @@ How to use it?
279279
Namespace parameter
280280
```````````````````````````````````````````````````````````
281281

282-
Constructing a VtkRemoteLocalView will set several variables, prefixed by a namespace. In the example below we used `namespace="view"`.
282+
Constructing a VtkRemoteLocalView will set several variables, prefixed by a namespace. In the example below we used ``namespace="view"``.
283283

284284
.. list-table::
285285
:widths: 25 75
@@ -307,12 +307,12 @@ Constructing a VtkRemoteLocalView will also set several trame triggers.
307307
* - viewAnimateStop
308308
- Stop the animation loop
309309

310-
The `namespace` will also be used as `ref=` unless provided by the user.
310+
The ``namespace`` will also be used as ``ref=`` unless provided by the user.
311311

312312
Mode parameter
313313
```````````````````````````````````````````````````````````
314314

315-
The mode is driven by the variable `{namespace}Mode` but can be provided when instantiated so the default can be overridden and a JavaScript expression can be used instead of the default variable. This attribute behaves the same way as any trame one except, we won't register the left side as a state entry since we already have one under `{namespace}Mode`. This means we will evaluate the left side of the expression assuming a tuple is provided and the right side of the tuple is used to set its initial value.
315+
The mode is driven by the variable ``{namespace}Mode`` but can be provided when instantiated so the default can be overridden and a JavaScript expression can be used instead of the default variable. This attribute behaves the same way as any trame one except, we won't register the left side as a state entry since we already have one under ``{namespace}Mode``. This means we will evaluate the left side of the expression assuming a tuple is provided and the right side of the tuple is used to set its initial value.
316316

317317
Examples
318318
```````````````````````````````````````````````````````````

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ build_command = """
4646
python -m build .
4747
"""
4848

49-
[semantic_release.publish]
49+
[tool.semantic_release.publish]
5050
dist_glob_patterns = ["dist/*"]
5151
upload_to_vcs_release = true
5252

@@ -76,5 +76,5 @@ docstring-code-line-length = "dynamic"
7676
[tool.ruff.lint.pycodestyle]
7777
max-line-length = 120
7878

79-
[lint.pydocstyle]
79+
[tool.lint.pydocstyle]
8080
convention = "google"

src/trame_vtk/modules/vtk/serializers/mesh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def volume(dataset):
146146
return state
147147

148148

149-
# Numpy to JS TypedArray
149+
# numpy to JS TypedArray
150150
to_js_type = {
151151
"int8": "Int8Array",
152152
"uint8": "Uint8Array",
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- document:
2-
- banner:
3-
- button
4-
- text: Int64 Validation 1
5-
- main:
6-
- img
2+
- banner:
3+
- button
4+
- text: Int64 Validation 1
5+
- main:
6+
- img

tests/refs/test_rendering_lut.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- document:
2-
- banner:
3-
- button
4-
- text: PyVista Lookup Table N Colors 1
5-
- main:
6-
- img
2+
- banner:
3+
- button
4+
- text: PyVista Lookup Table N Colors 1
5+
- main:
6+
- img
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- document:
2-
- banner:
3-
- button
4-
- text: VTK Volume Rendering 1
5-
- main:
6-
- img
2+
- banner:
3+
- button
4+
- text: VTK Volume Rendering 1
5+
- main:
6+
- img

tests/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
coverage
2+
pytest-asyncio
3+
pytest-playwright
4+
pyvista[all]==0.45.2
15
trame
26
trame-client[test]
37
trame-vuetify
48
vtk==9.4.2
5-
pyvista[all]==0.45.2
6-
pytest-asyncio
7-
pytest-playwright
8-
coverage

0 commit comments

Comments
 (0)