Skip to content

Commit 784f2e7

Browse files
Merge pull request #2415 from VWS-Python/more-precommit
2 parents 62d848a + 4cb28c0 commit 784f2e7

20 files changed

+102
-69
lines changed

.checkmake-config.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[minphony]
2+
disabled = true

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ jobs:
8686
uv build --sdist --wheel --out-dir dist/
8787
uv run --extra=release check-wheel-contents dist/*.whl
8888
89-
# We use PyPI trusted publishing rather than a PyPI API token.
90-
# See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing.
9189
- name: Publish distribution 📦 to PyPI
90+
# We use PyPI trusted publishing rather than a PyPI API token.
91+
# See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing.
9292
uses: pypa/gh-action-pypi-publish@release/v1
9393
with:
9494
verbose: true

.pre-commit-config.yaml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ci:
1212
- check-manifest
1313
- deptry
1414
- doc8
15+
- docformatter
1516
- docs
1617
- interrogate
1718
- interrogate-docs
@@ -28,13 +29,13 @@ ci:
2829
- ruff-check-fix-docs
2930
- ruff-format-fix
3031
- ruff-format-fix-docs
31-
- spelling
32-
- vulture
33-
- vulture-docs
3432
- shellcheck
3533
- shellcheck-docs
3634
- shfmt
3735
- shfmt-docs
36+
- spelling
37+
- vulture
38+
- vulture-docs
3839

3940
default_install_hook_types: [pre-commit, pre-push, commit-msg]
4041
repos:
@@ -58,6 +59,22 @@ repos:
5859
- id: file-contents-sorter
5960
files: spelling_private_dict\.txt$
6061
- id: trailing-whitespace
62+
- repo: https://github.com/pre-commit/pygrep-hooks
63+
rev: v1.10.0
64+
hooks:
65+
- id: rst-directive-colons
66+
- id: rst-inline-touching-normal
67+
- id: text-unicode-replacement-char
68+
- id: rst-backticks
69+
- repo: https://github.com/mrtazz/checkmake.git
70+
rev: 0.2.2
71+
hooks:
72+
- id: checkmake
73+
args: ["--config", ".checkmake-config.ini"]
74+
- repo: https://github.com/google/yamlfmt
75+
rev: v0.13.0
76+
hooks:
77+
- id: yamlfmt
6178
- repo: local
6279
hooks:
6380
- id: actionlint
@@ -68,6 +85,13 @@ repos:
6885
types_or: [yaml]
6986
additional_dependencies: ["uv"]
7087

88+
- id: docformatter
89+
name: docformatter
90+
entry: uv run --extra=dev -m docformatter
91+
language: python
92+
types_or: [python]
93+
additional_dependencies: ["uv"]
94+
7195
- id: shellcheck
7296
name: shellcheck
7397
entry: uv run --extra=dev shellcheck --shell=bash --exclude=SC1017

.yamlfmt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
formatter:
2+
include_document_start: true
3+
retain_line_breaks_single: true
4+
trim_trailing_whitespace: true
5+
end_of_file_newline: true

codecov.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
coverage:
23
status:
34
patch:

conftest.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
"""Setup for Sybil."""
1+
"""
2+
Setup for Sybil.
3+
"""
24

35
import io
46
import uuid
@@ -31,8 +33,8 @@ def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
3133
def fixture_make_image_file(
3234
high_quality_image: io.BytesIO,
3335
) -> Generator[None]:
34-
"""
35-
Make an image file available in the test directory.
36+
"""Make an image file available in the test directory.
37+
3638
The path of this file matches the path in the documentation.
3739
"""
3840
new_image = Path("high_quality_image.jpg")
@@ -46,8 +48,7 @@ def fixture_make_image_file(
4648
def fixture_mock_vws(
4749
monkeypatch: pytest.MonkeyPatch,
4850
) -> Generator[None]:
49-
"""
50-
Yield a mock VWS.
51+
"""Yield a mock VWS.
5152
5253
The keys used here match the keys in the documentation.
5354
"""

docs/source/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
"""Documentation."""
1+
"""
2+
Documentation.
3+
"""

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ optional-dependencies.dev = [
4444
"deptry==0.20.0",
4545
"doc8==1.1.2",
4646
"doccmd==2024.10.8.12",
47+
"docformatter==1.7.5",
4748
"freezegun==1.5.1",
4849
"furo==2024.8.6",
4950
"interrogate==1.7.0",
@@ -258,6 +259,9 @@ spelling-private-dict-file = 'spelling_private_dict.txt'
258259
# --spelling-private-dict-file option instead of raising a message.
259260
spelling-store-unknown-words = 'no'
260261

262+
[tool.docformatter]
263+
make-summary-multi-line = true
264+
261265
[tool.check-manifest]
262266

263267
ignore = [

readthedocs.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
version: 2
23

34
build:
@@ -7,10 +8,10 @@ build:
78

89
python:
910
install:
10-
- method: pip
11-
path: .
12-
extra_requirements:
13-
- dev
11+
- method: pip
12+
path: .
13+
extra_requirements:
14+
- dev
1415

1516
sphinx:
1617
builder: html

src/vws/exceptions/base_exceptions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def response(self) -> Response:
3232

3333
@beartype
3434
class VWSError(Exception):
35-
"""
36-
Base class for Vuforia Web Services errors.
35+
"""Base class for Vuforia Web Services errors.
3736
3837
These errors are defined at
3938
https://developer.vuforia.com/library/web-api/cloud-targets-web-services-api#result-codes.

0 commit comments

Comments
 (0)