Skip to content
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ci:
- check-manifest
- deptry
- doc8
- docformatter
- pydocstringformatter
- docs
- interrogate
- interrogate-docs
Expand Down Expand Up @@ -103,9 +103,9 @@ repos:
additional_dependencies: [uv==0.9.5]
stages: [pre-commit]

- id: docformatter
name: docformatter
entry: uv run --extra=dev -m docformatter --in-place
- id: pydocstringformatter
name: pydocstringformatter
entry: uv run --extra=dev pydocstringformatter
language: python
types_or: [python]
additional_dependencies: [uv==0.9.5]
Expand Down
8 changes: 2 additions & 6 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Setup for test suite.
"""
"""Setup for test suite."""

import uuid
from collections.abc import Generator
Expand Down Expand Up @@ -63,9 +61,7 @@ def fixture_mock_vws(

@beartype
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
"""
Apply the beartype decorator to all collected test functions.
"""
"""Apply the beartype decorator to all collected test functions."""
for item in items:
if isinstance(item, pytest.Function):
item.obj = beartype(obj=item.obj)
4 changes: 1 addition & 3 deletions docs/source/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
"""
Documentation.
"""
"""Documentation."""
4 changes: 1 addition & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python3
"""
Configuration for Sphinx.
"""
"""Configuration for Sphinx."""

import importlib.metadata
from pathlib import Path
Expand Down
18 changes: 12 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ optional-dependencies.dev = [
"deptry==0.24.0",
"doc8==2.0.0",
"doccmd==2026.1.23.4",
"docformatter==1.7.7",
"freezegun==1.5.5",
"furo==2025.12.19",
"interrogate==1.7.0",
"mypy[faster-cache]==1.19.1",
"mypy-strict-kwargs==2026.1.12",
"prek==0.3.0",
"pydocstringformatter==0.7.3",
"pylint[spelling]==4.0.4",
"pylint-per-file-ignores==3.2.0",
"pyproject-fmt==2.11.1",
Expand Down Expand Up @@ -112,8 +112,8 @@ lint.select = [
lint.ignore = [
# Ruff warns that this conflicts with the formatter.
"COM812",
# Allow our chosen docstring line-style - no one-line summary.
"D200",
# Allow our chosen docstring line-style - pydocstringformatter handles formatting
# but doesn't enforce D205 (blank line after summary) or D212 (summary on first line).
"D205",
"D212",
# Ruff warns that this conflicts with the formatter.
Expand All @@ -124,6 +124,9 @@ lint.ignore = [
]

lint.per-file-ignores."doccmd_*.py" = [
# Allow our chosen docstring line-style - pydocstringformatter handles
# formatting but docstrings in docs may not match this style.
"D200",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D200 ignore pattern misses docs/source/doccmd files

Low Severity

The ruff per-file-ignores pattern doccmd_*.py only matches root-level files, not files in subdirectories like docs/source/doccmd_*.py. The pylint config (line 247) shows the project expects files matching docs/source/doccmd_*.py to exist. Before this PR, D200 was globally ignored so all doccmd files were covered. Now only root-level doccmd files have D200 ignored, creating a gap where docs/source/doccmd_*.py files could trigger D200 violations. The pattern could be changed to **/doccmd_*.py or a separate entry added for docs/source/doccmd_*.py.

Fix in Cursor Fix in Web

# Allow asserts in docs.
"S101",
]
Expand Down Expand Up @@ -264,9 +267,6 @@ spelling-private-dict-file = 'spelling_private_dict.txt'
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words = 'no'

[tool.docformatter]
make-summary-multi-line = true

[tool.check-manifest]

ignore = [
Expand Down Expand Up @@ -331,6 +331,12 @@ enableTypeIgnoreComments = false
reportUnnecessaryTypeIgnoreComment = true
typeCheckingMode = "strict"

[tool.pydocstringformatter]
write = true
split-summary-body = false
max-line-length = 75
linewrap-full-docstring = true

[tool.interrogate]
fail-under = 100
omit-covered-files = true
Expand Down
10 changes: 5 additions & 5 deletions src/vws_auth_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Authorization helpers.
"""
"""Authorization helpers."""

import base64
import email.utils
Expand All @@ -13,7 +11,8 @@
@beartype
def _compute_hmac_base64(key: bytes, data: bytes) -> bytes:
"""
Return the Base64 encoded HMAC-SHA1 hash of `data` using the `key`.
Return the Base64 encoded HMAC-SHA1 hash of `data` using the
`key`.
"""
hashed = hmac.new(key=key, msg=None, digestmod=hashlib.sha1)
hashed.update(msg=data)
Expand All @@ -22,7 +21,8 @@ def _compute_hmac_base64(key: bytes, data: bytes) -> bytes:

@beartype
def rfc_1123_date() -> str:
"""Return the date formatted as per RFC 2616, section 3.3.1, rfc1123-date.
"""Return the date formatted as per RFC 2616, section 3.3.1,
rfc1123-date.

This is the date needed by the VWS API, as described in
https://developer.vuforia.com/library/web-api/vuforia-web-api-authentication.
Expand Down
4 changes: 1 addition & 3 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
"""
Tests for authorization tools.
"""
"""Tests for authorization tools."""
10 changes: 5 additions & 5 deletions tests/test_vws_auth_tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Tests for authorization tools.
"""
"""Tests for authorization tools."""

import datetime
from zoneinfo import ZoneInfo
Expand All @@ -12,7 +10,8 @@


def test_rfc_1123_date() -> None:
"""The date is returned in the format described in the VWS documentation.
"""The date is returned in the format described in the VWS
documentation.

See https://developer.vuforia.com/library/web-api/vuforia-web-api-authentication:

Expand Down Expand Up @@ -74,7 +73,8 @@ def test_authorization_header(content: bytes | str) -> None:
@pytest.mark.parametrize(argnames="content", argvalues=[b"", None])
def test_authorization_header_none_content(content: bytes | None) -> None:
"""
The Authorization header is the same whether the content is None or b"".
The Authorization header is the same whether the content is None or
b"".
"""
access_key = "my_access_key"
# Ignore "Possible hardcoded password" as it is appropriate here.
Expand Down