Skip to content

ratchet(types): promote invalid-method-override + invalid-return-type (plugins)#1315

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

ratchet(types): promote invalid-method-override + invalid-return-type (plugins)#1315
tomchop merged 1 commit into
mainfrom
ty-plugins-batch3

Conversation

@tomchop

@tomchop tomchop commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Third plugins ratchet batch; drops both rules from the [[tool.ty.overrides]]
block.

invalid-method-override (12) — all analytics each overrides

  • 8 were pure parameter-name mismatches (observable_obj vs base
    observable). Made the base AnalyticsTask.each / OneShotTask.each
    parameter positional-only (observable, /) in core/schemas/task.py
    the framework only ever calls each() positionally, so the callback's
    parameter name is an implementation detail. Clears all 8 at once.
  • 4 narrowed the parameter to a concrete observable type (IPv4/MacAddress)
    — an LSP violation. They now take observable: Observable and cast to the
    concrete type on the first line. shodan also returned the observable from a
    OneShotTask.each (-> None); dropped the stray return.

invalid-return-type (7)

  • dockerhub._iter_endpoint_pages is a generator → -> Iterator (was -> dict).
  • et_open._extract_cve/_extract_mitre_attack cast the connector's
    Entity-typed save()/filter() results back to Vulnerability/AttackPattern.
  • miningpoolstats._get_coin_names-> set | None (returns a set or None).

Verification

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

🤖 Generated with Claude Code

… (plugins)

Third plugins ratchet batch; drops both rules from the [[tool.ty.overrides]]
block.

invalid-method-override (12), all on analytics `each` overrides:
- 8 were pure parameter-name mismatches (`observable_obj` vs base `observable`).
  Made the base `AnalyticsTask.each` / `OneShotTask.each` parameter
  positional-only (`observable, /`) in core/schemas/task.py — the framework only
  ever calls each() positionally (self.each(observable)), so the callback's
  parameter name is an implementation detail. Clears all 8 at once.
- 4 narrowed the parameter to a specific observable type (IPv4/MacAddress),
  an LSP violation. They now take `observable: Observable` and cast to the
  concrete type on the first line (circl_passive_ssl, macaddress_io,
  network_whois, shodan_api). shodan also returned the observable from a
  OneShotTask.each (`-> None`); dropped the stray return.

invalid-return-type (7):
- dockerhub `_iter_endpoint_pages` is a generator → `-> Iterator` (was `-> dict`).
- et_open `_extract_cve`/`_extract_mitre_attack` cast the connector's Entity-typed
  save()/filter() results back to Vulnerability/AttackPattern.
- miningpoolstats `_get_coin_names` → `-> set | None` (returns a set or None, not
  a list).

Plugins job: 0 errors (89→70 warnings). Main job unchanged (0/0). ruff clean;
tests 186/197/29.
@tomchop
tomchop merged commit 13d0393 into main Jul 17, 2026
5 checks passed
@tomchop
tomchop deleted the ty-plugins-batch3 branch July 17, 2026 23:10
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