Skip to content

Commit bb19a9b

Browse files
Merge pull request #1161 from VWS-Python/replace-docformatter-with-pydocstringformatter
Replace docformatter with pydocstringformatter
2 parents 6e537af + b903185 commit bb19a9b

8 files changed

Lines changed: 37 additions & 58 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ci:
99
- check-manifest
1010
- deptry
1111
- doc8
12-
- docformatter
12+
- pydocstringformatter
1313
- docs
1414
- interrogate
1515
- interrogate-docs
@@ -103,9 +103,9 @@ repos:
103103
additional_dependencies: [uv==0.9.5]
104104
stages: [pre-commit]
105105

106-
- id: docformatter
107-
name: docformatter
108-
entry: uv run --extra=dev -m docformatter --in-place
106+
- id: pydocstringformatter
107+
name: pydocstringformatter
108+
entry: uv run --extra=dev pydocstringformatter
109109
language: python
110110
types_or: [python]
111111
additional_dependencies: [uv==0.9.5]

docs/source/__init__.py

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

docs/source/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python3
2-
"""
3-
Configuration for Sphinx.
4-
"""
2+
"""Configuration for Sphinx."""
53

64
# pylint: disable=invalid-name
75

pyproject.toml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ optional-dependencies.dev = [
4343
"deptry==0.24.0",
4444
"doc8==2.0.0",
4545
"doccmd==2026.1.23.4",
46-
"docformatter==1.7.7",
4746
"furo==2025.12.19",
4847
"interrogate==1.7.0",
4948
"mypy[faster-cache]==1.19.1",
5049
"mypy-strict-kwargs==2026.1.12",
5150
"prek==0.3.0",
51+
"pydocstringformatter==0.7.3",
5252
"pylint[spelling]==4.0.4",
5353
"pyproject-fmt==2.11.1",
5454
"pyrefly==0.49.0",
@@ -116,15 +116,23 @@ lint.select = [
116116
lint.ignore = [
117117
# Ruff warns that this conflicts with the formatter.
118118
"COM812",
119-
# Allow our chosen docstring line-style - no one-line summary.
120-
"D200",
119+
# Allow our chosen docstring line-style - pydocstringformatter handles formatting
120+
# but doesn't enforce D205 (blank line after summary) or D212 (summary on first line).
121121
"D205",
122122
"D212",
123123
"D415",
124124
# Ruff warns that this conflicts with the formatter.
125125
"ISC001",
126126
]
127127

128+
lint.per-file-ignores."doccmd_*.py" = [
129+
# Allow our chosen docstring line-style - pydocstringformatter handles
130+
# formatting but docstrings in docs may not match this style.
131+
"D200",
132+
# Allow asserts in docs.
133+
"S101",
134+
]
135+
128136
lint.per-file-ignores."tests/*.py" = [
129137
# Allow 'assert' as we use it for tests.
130138
"S101",
@@ -245,9 +253,6 @@ spelling-private-dict-file = 'spelling_private_dict.txt'
245253
# --spelling-private-dict-file option instead of raising a message.
246254
spelling-store-unknown-words = 'no'
247255

248-
[tool.docformatter]
249-
make-summary-multi-line = true
250-
251256
[tool.check-manifest]
252257

253258
ignore = [
@@ -318,6 +323,12 @@ enableTypeIgnoreComments = false
318323
reportUnnecessaryTypeIgnoreComment = true
319324
typeCheckingMode = "strict"
320325

326+
[tool.pydocstringformatter]
327+
write = true
328+
split-summary-body = false
329+
max-line-length = 75
330+
linewrap-full-docstring = true
331+
321332
[tool.interrogate]
322333
fail-under = 100
323334
omit-covered-files = true

src/vws_web_tools/__init__.py

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Tools for interacting with the VWS (Vuforia Web Services) website.
3-
"""
1+
"""Tools for interacting with the VWS (Vuforia Web Services) website."""
42

53
import contextlib
64
import time
@@ -21,9 +19,7 @@
2119

2220
@beartype
2321
class DatabaseDict(TypedDict):
24-
"""
25-
A dictionary type which represents a database.
26-
"""
22+
"""A dictionary type which represents a database."""
2723

2824
database_name: str
2925
server_access_key: str
@@ -38,9 +34,7 @@ def log_in(
3834
email_address: str,
3935
password: str,
4036
) -> None: # pragma: no cover
41-
"""
42-
Log in to Vuforia web services.
43-
"""
37+
"""Log in to Vuforia web services."""
4438
log_in_url = "https://developer.vuforia.com/vui/auth/login"
4539
driver.get(url=log_in_url)
4640
email_address_input_element = driver.find_element(
@@ -76,9 +70,7 @@ def create_license(
7670
driver: WebDriver,
7771
license_name: str,
7872
) -> None: # pragma: no cover
79-
"""
80-
Create a license.
81-
"""
73+
"""Create a license."""
8274
licenses_url = "https://developer.vuforia.com/vui/develop/licenses"
8375
driver.get(url=licenses_url)
8476

@@ -130,9 +122,7 @@ def create_database(
130122
database_name: str,
131123
license_name: str,
132124
) -> None: # pragma: no cover
133-
"""
134-
Create a database.
135-
"""
125+
"""Create a database."""
136126
target_manager_url = "https://developer.vuforia.com/vui/develop/databases"
137127
driver.get(url=target_manager_url)
138128
ten_second_wait = WebDriverWait(driver=driver, timeout=10)
@@ -198,9 +188,7 @@ def get_database_details(
198188
driver: WebDriver,
199189
database_name: str,
200190
) -> DatabaseDict: # pragma: no cover
201-
"""
202-
Get details of a database.
203-
"""
191+
"""Get details of a database."""
204192
target_manager_url = "https://developer.vuforia.com/vui/develop/databases"
205193
driver.get(url=target_manager_url)
206194
ten_second_wait = WebDriverWait(driver=driver, timeout=10)
@@ -276,9 +264,7 @@ def get_database_details(
276264
@click.group(name="vws-web")
277265
@beartype
278266
def vws_web_tools_group() -> None:
279-
"""
280-
Commands for interacting with VWS.
281-
"""
267+
"""Commands for interacting with VWS."""
282268

283269

284270
@click.command()
@@ -291,9 +277,7 @@ def create_vws_license(
291277
email_address: str,
292278
password: str,
293279
) -> None: # pragma: no cover
294-
"""
295-
Create a license.
296-
"""
280+
"""Create a license."""
297281
driver = webdriver.Safari()
298282
log_in(driver=driver, email_address=email_address, password=password)
299283
wait_for_logged_in(driver=driver)
@@ -313,9 +297,7 @@ def create_vws_database(
313297
email_address: str,
314298
password: str,
315299
) -> None: # pragma: no cover
316-
"""
317-
Create a database.
318-
"""
300+
"""Create a database."""
319301
driver = webdriver.Safari()
320302
log_in(driver=driver, email_address=email_address, password=password)
321303
wait_for_logged_in(driver=driver)
@@ -340,9 +322,7 @@ def show_database_details(
340322
*,
341323
env_var_format: bool,
342324
) -> None: # pragma: no cover
343-
"""
344-
Show the details of a database.
345-
"""
325+
"""Show the details of a database."""
346326
driver = webdriver.Safari()
347327
log_in(driver=driver, email_address=email_address, password=password)
348328
wait_for_logged_in(driver=driver)

tests/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
"""
2-
Tests.
3-
"""
1+
"""Tests."""

tests/conftest.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
"""
2-
Configuration, plugins and fixtures for `pytest`.
3-
"""
1+
"""Configuration, plugins and fixtures for `pytest`."""
42

53
import pytest
64
from beartype import beartype
75

86

97
@beartype
108
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
11-
"""
12-
Apply the beartype decorator to all collected test functions.
13-
"""
9+
"""Apply the beartype decorator to all collected test functions."""
1410
for item in items:
1511
assert isinstance(item, pytest.Function)
1612
item.obj = beartype(obj=item.obj)

tests/test_help.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Tests for the VWS CLI help.
3-
"""
1+
"""Tests for the VWS CLI help."""
42

53
import pytest
64
from click.testing import CliRunner

0 commit comments

Comments
 (0)