ratchet(types): promote invalid-method-override + invalid-return-type (plugins)#1315
Merged
Conversation
… (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.
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.
Third plugins ratchet batch; drops both rules from the
[[tool.ty.overrides]]block.
invalid-method-override (12) — all analytics
eachoverridesobservable_objvs baseobservable). Made the baseAnalyticsTask.each/OneShotTask.eachparameter positional-only (
observable, /) incore/schemas/task.py—the framework only ever calls
each()positionally, so the callback'sparameter name is an implementation detail. Clears all 8 at once.
IPv4/MacAddress)— an LSP violation. They now take
observable: Observableandcastto theconcrete type on the first line.
shodanalso returned the observable from aOneShotTask.each(-> None); dropped the stray return.invalid-return-type (7)
dockerhub._iter_endpoint_pagesis a generator →-> Iterator(was-> dict).et_open._extract_cve/_extract_mitre_attackcast the connector'sEntity-typed
save()/filter()results back toVulnerability/AttackPattern.miningpoolstats._get_coin_names→-> set | None(returns a set or None).Verification
ruff check .+ruff format . --check: clean🤖 Generated with Claude Code