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: 8 additions & 0 deletions .audit/oberstet_fix_1840.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- [ ] I did **not** use any AI-assistance tools to help create this pull request.
- [x] I **did** use AI-assistance tools to *help* create this pull request.
- [x] I have read, understood and followed the projects' [AI Policy](https://github.com/crossbario/autobahn-python/blob/main/AI_POLICY.md) when creating code, documentation etc. for this pull request.

Submitted by: @oberstet
Date: 2026-07-01
Related issue(s): #1840
Branch: oberstet:fix_1840
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Changelog
**Build & CI/CD**

* Add CalVer / PEP 440 version-management ``just`` recipes (``file-version``, ``bump-dev``, ``bump-next``, ``prep-release``) mirroring Crossbar.io, and document the versioning policy in ``CONTRIBUTING.md`` (#1894)
* Add ``ruff check --select ANN,UP,TCH`` (annotation presence, ``pyupgrade`` modern syntax, ``TYPE_CHECKING`` imports) to the ``just check-typing`` recipe so annotation/style regressions are caught in the ``quality-checks`` CI job. The existing gaps in ``src/autobahn/`` are ratcheted via an explicit ``--ignore`` allowlist to be removed module-by-module (#1839); all other ``UP``/``TC`` rules are enforced immediately, and generated code is excluded. The annotation rules are scoped to this recipe via the command line rather than the global ``[tool.ruff.lint]`` select, so the repo-wide ``check-format`` gate is unaffected (#1840)

26.6.2
------
Expand Down
16 changes: 15 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ check-format venv="": (install-tools venv)
# Run static type checking with ty (Astral's Rust-based type checker)
# FIXME: Many type errors need to be fixed. For now, we ignore most rules
# to get CI passing. Create follow-up issue to address type errors.
check-typing venv="": (install venv)
check-typing venv="": (install venv) (install-tools venv)
#!/usr/bin/env bash
set -e
VENV_NAME="{{ venv }}"
Expand All @@ -740,6 +740,20 @@ check-typing venv="": (install venv)
echo "==> Defaulting to venv: '${VENV_NAME}'"
fi
VENV_PATH="{{ VENV_DIR }}/${VENV_NAME}"
echo "==> Checking type annotation presence and modern syntax (via ruff)..."
# Annotation presence (ANN), modern syntax (UP/pyupgrade) and TYPE_CHECKING
# imports (TC). The ANN/TC ignores below track the EXISTING gaps in src/autobahn/
# and should be removed module-by-module as typing improves (see #1839); every
# other UP and TC rule is enforced now, so new code cannot regress modern syntax.
# Generated code is skipped via the [tool.ruff] exclude list; --force-exclude makes
# that apply to the explicit src/autobahn/ path too.
"${VENV_PATH}/bin/ruff" check --select ANN,UP,TCH --force-exclude \
--ignore ANN001 --ignore ANN002 --ignore ANN003 \
--ignore ANN201 --ignore ANN202 --ignore ANN204 --ignore ANN205 --ignore ANN206 \
--ignore ANN401 \
--ignore UP037 \
--ignore TC001 --ignore TC002 --ignore TC003 \
src/autobahn/
echo "==> Running static type checks with ty (using ${VENV_NAME} for type stubs)..."
# Note: Only check src/autobahn/, not src/flatbuffers/ (generated code)
# FIXME: Many ignores needed until type annotations are fixed
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,10 @@ docstring-code-line-length = "dynamic"

[tool.ruff.lint.pydocstyle]
convention = "google" # Accepts: "google", "numpy", or "pep257".

# Shapes the flake8-annotations (ANN) rules that `just check-typing` selects on the
# command line (see #1839). Inert for `check-format`, which does not select ANN.
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true # allow __init__ without an explicit -> None
suppress-none-returning = false # still require -> None on functions returning only None
allow-star-arg-any = false # *args/**kwargs must be typed, not implicitly Any
Loading