From 94582cb5207fa502c7213084eabb6a38a9dc3cd1 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Tue, 10 Nov 2026 11:56:39 +0100 Subject: [PATCH 1/2] start new dev branch; add audit file --- .audit/oberstet_fix_250.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .audit/oberstet_fix_250.md diff --git a/.audit/oberstet_fix_250.md b/.audit/oberstet_fix_250.md new file mode 100644 index 0000000..b257362 --- /dev/null +++ b/.audit/oberstet_fix_250.md @@ -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 project's AI_POLICY.md when creating code, documentation etc. for this pull request. + +Submitted by: @oberstet +Date: 2026-11-10 +Related issue(s): #250 +Branch: oberstet:fix_250 From 02258beae248cab534f293a9d01215a62861700f Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Tue, 10 Nov 2026 12:08:59 +0100 Subject: [PATCH 2/2] #250: check-typing follows ty 0.0.100's rule names, and names a renamed rule after the errors ty 0.0.100 (2026-11-09) failed `just check-typing` at master: unresolved-attribute -> missing-attribute renamed, so its --ignore silenced nothing, and new rules reported on code the old ones covered. - Renamed in the ignore list: unresolved-attribute -> missing-attribute. - New ignores: missing-union-attribute, until their sites are fixed (#251). - The recipe prints ty's version, tees its output, and after it repeats any unknown-rule, renamed-rule or renamed-rule-in-ignore-comment warning and exits 1, so the next rename is one named line, not a wall of errors. Same change as crossbar#2392 and autobahn-python#2051. Tested with ty 0.0.100: check-typing passes; with unresolved-attribute put back the recipe fails and names it; with missing-union-attribute's ignore removed it fails on those errors (exit code kept). Note: This work was completed with AI assistance (Claude Code). --- justfile | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index ec9cbe6..cb3e0a3 100644 --- a/justfile +++ b/justfile @@ -561,17 +561,38 @@ check-typing venv="": (install-tools venv) (install venv) echo "==> Running static type checks with ty (using ${VENV_NAME} for type stubs)..." # ty uses the venv's Python for resolving third-party type stubs # Note: Some rules are ignored due to txaio's design patterns: - # - unresolved-attribute: txaio dynamically sets module attributes (using_twisted, using_asyncio) + # - missing-attribute (unresolved-attribute before ty 0.0.100): txaio dynamically sets module attributes (using_twisted, using_asyncio) # - possibly-missing-attribute: sys._getframe() returns FrameType | None # - call-non-callable: callback type inference edge cases # - deprecated: abc.abstractproperty usage (fix later) + # - missing-union-attribute: new in ty 0.0.100, 14 sites to fix (#251) + # + # CI installs the newest ty, on purpose: we follow it as it moves (#250). ty + # renames rules now and then, and an --ignore naming an old name then silences + # nothing, so the rule comes back with many errors and the one warning that + # explains them is lost among them. The warnings are repeated at the end. + echo " ty: $("${VENV_PATH}/bin/ty" --version)" + TY_OUT=$(mktemp) + trap 'rm -f "${TY_OUT}" "${TY_OUT}.names"' EXIT + set +e "${VENV_PATH}/bin/ty" check \ --python "${VENV_PATH}/bin/python" \ - --ignore unresolved-attribute \ + --ignore missing-attribute \ --ignore possibly-missing-attribute \ --ignore call-non-callable \ --ignore deprecated \ - src/ + --ignore missing-union-attribute \ + src/ 2>&1 | tee "${TY_OUT}" + rc=${PIPESTATUS[0]} + set -e + if grep -E '^warning\[(unknown-rule|renamed-rule|renamed-rule-in-ignore-comment)\]' "${TY_OUT}" > "${TY_OUT}.names"; then + echo "" + echo "==> ty does not know a rule name this recipe or a ty: ignore comment uses:" + sed 's/^/ /' "${TY_OUT}.names" + echo " Rename it to ty's current name (the errors above may be that rule, back on)." + exit 1 + fi + exit ${rc} # Run tests and generate an HTML coverage report in a specific directory. check-coverage venv="": (install-tools venv) (install venv)