Skip to content

ratchet(types): promote missing-argument/invalid-assignment/unresolved-import (plugins) - #1314

Merged
tomchop merged 1 commit into
mainfrom
ty-plugins-batch2
Jul 17, 2026
Merged

ratchet(types): promote missing-argument/invalid-assignment/unresolved-import (plugins)#1314
tomchop merged 1 commit into
mainfrom
ty-plugins-batch2

Conversation

@tomchop

@tomchop tomchop commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Second plugins ratchet batch. Fixes instances and drops three rules from the
[[tool.ty.overrides]] block.

  • missing-argument (passive_total.py) — two real latent bugs:
    e.with_traceback() with no arg → logging.error(e); and add_context(context)
    called with one arg → add_context(context["source"], context).
  • invalid-assignmentdatadog_metrics _metrics_flusher typed
    ClassVar[MetricsFlusher | None]; otx_alienvault context typed
    dict[str, Any] so the datetime context["created"] assignment fits.
  • unresolved-importimport yara in otx_alienvault/yaraify gets a
    per-line # ty: ignore[unresolved-import] (yara-python is a stub-less C ext).

unused-ignore-comment stays at warn: its only instances are the
boto3/tldextract import ignores in core — used by the dev-only main job but
unused in this all-deps plugins job, so they can't be cleanly removed.

Verification

  • Plugins job: 0 errors (96 → 89 warnings)
  • Main typecheck job: unchanged
  • ruff check . + ruff format . --check: clean
  • unittest schemas / apiv2 / core_tests: 186 / 197 / 29, all pass

…d-import (plugins)

Second plugins ratchet batch. Fixes the instances and drops these three rules
from the [[tool.ty.overrides]] block:

- missing-argument (passive_total.py): two real latent bugs — `e.with_traceback()`
  with no arg → `logging.error(e)`; and `add_context(context)` called with a
  single arg → `add_context(context["source"], context)` (add_context needs
  source + context).
- invalid-assignment: datadog_metrics `_metrics_flusher` ClassVar typed
  `MetricsFlusher | None` (default None); otx_alienvault `context` typed
  `dict[str, Any]` so the datetime `context["created"]` assignment fits.
- unresolved-import: `import yara` in otx_alienvault/yaraify gets a per-line
  `# ty: ignore[unresolved-import]` (yara-python is a stub-less C extension).

unused-ignore-comment stays at warn: its only instances are the boto3/tldextract
import ignores in core (used by the dev-only main job, unused in this all-deps
plugins job), so they can't be cleanly removed.

Plugins job: 0 errors (96→89 warnings). Main job unchanged. ruff clean; tests
186/197/29.
@tomchop
tomchop merged commit 6e000af into main Jul 17, 2026
5 checks passed
@tomchop
tomchop deleted the ty-plugins-batch2 branch July 17, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant