MAINT: suppress ty missing-override-decorator rule#1935
Merged
romanlutz merged 1 commit intoJun 4, 2026
Conversation
PR microsoft#1919 bumped allganize/ty-pre-commit from v0.0.32 to v0.0.43. The newer ty release activated the missing-override-decorator rule, which under the existing `[tool.ty.rules] all = "error"` config produced 735 hard CI errors across pyrit/ (287 files) and turned main RED. Adopting `@override` everywhere would require `typing_extensions` (`typing.override` is 3.12+, PyRIT supports 3.10+), adding a new direct runtime dependency plus the ongoing import-path footgun of contributors copying `from typing import override` from 3.12-only examples. Suppressing the rule is consistent with the file's other pragmatic ignores (`unresolved-import`, `possibly-missing-attribute`, `empty-body`) and keeps the project mergeable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
adrian-gavrila
approved these changes
Jun 4, 2026
romanlutz
pushed a commit
to romanlutz/PyRIT
that referenced
this pull request
Jun 4, 2026
PR microsoft#1935 just landed on main and globally suppressed ty's missing-override-decorator rule rather than backfilling @OverRide across pyrit/, citing the typing_extensions friction on Python 3.10/3.11. Drop our two newly-added @OverRide decorators (and the typing_extensions import) so this loader is consistent with the rest of the codebase. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
#1919 bumped
allganize/ty-pre-commitfrom v0.0.32 to v0.0.43, and the newer ty release activated themissing-override-decoratorrule. Under PyRIT's existing[tool.ty.rules] all = "error"config that turned 735 method overrides across 287 files inpyrit/into hard CI errors, which has been blockingmainand every open PR (#1884 in particular).This change suppresses the rule with a one-line entry under
[tool.ty.rules], alongside the existing pragmatic ignores (unresolved-import,possibly-missing-attribute,empty-body). The accompanying comment explains why we don't just adopt@overrideeverywhere instead:typing.overrideis Python 3.12+. PyRIT supports 3.10+, so adopting it would requirefrom typing_extensions import overrideon every site.typing_extensionsis currently installed only transitively (via Azure SDK, SQLAlchemy, pydantic, etc.) -- adopting would mean a new direct runtime dep.from typing import overridewould silently break 3.10/3.11.If the team later wants the override safety check back, that can be a separate, incremental effort (e.g., per-package PRs) -- at which point this single line is trivial to remove.
Note: this PR only addresses the
missing-override-decoratorfallout. The ty hook onmainis also failing on a handful of unrelated diagnostics (possibly-unresolved-referenceinpyrit/auth/copilot_authenticator.py,unresolved-attributeinpyrit/output/score/pretty.py,invalid-attribute-overrideinpyrit/scenario/scenarios/adaptive/text_adaptive.py,deprecatedos.systeminpyrit/cli/pyrit_shell.py). Those are pre-existing and out of scope here; happy to clean them up in a follow-up.Tests and Documentation
No code changes, so no new tests or docs needed. Verified locally on this worktree:
uv run --link-mode=copy pre-commit run ty-check --all-files-- 0missing-override-decoratorerrors (down from 735).uv run --link-mode=copy ruff check pyrit/ tests/ doc/clean.uv run --link-mode=copy ruff format --check pyrit/ tests/ doc/clean (1264 files).uv run --link-mode=copy pytest tests/unit -n 8 -q-- 9359 passed, 124 skipped.