ratchet(types): promote unresolved-attribute + deprecated (plugins)#1317
Open
tomchop wants to merge 1 commit into
Open
ratchet(types): promote unresolved-attribute + deprecated (plugins)#1317tomchop wants to merge 1 commit into
tomchop wants to merge 1 commit into
Conversation
Final plugins ratchet batch; drops unresolved-attribute and deprecated from the overrides. The [[tool.ty.overrides]] block now holds only unused-ignore-comment (the two core boto3/tldextract import ignores, which are env-dependent). unresolved-attribute (32): - Event handlers (dockerhub, hostname_extract): `message.event` is a ObjectEvent | LinkEvent | TagEvent union and only ObjectEvent has `yeti_object`. Narrow with `assert isinstance(event, ObjectEvent)`, then cast yeti_object to the concrete observable (ContainerImage / Url). - save()/find() return the base Observable/Entity through the connector, so plugins doing `x = SpecificType(...).save()` then `x.<subclass attr>` cast the result: abusech/botvrij/hybrid File.name/.size, malpedia Malware/IntrusionSet .aliases, wiz AttackPattern.kill_chain_phases, dockerhub ContainerImage.registry. - Response | None guards for `_make_request(...).content/.text` (cisco_umbrella, tranco, lolbas). deprecated (5): `datetime.utcnow()` -> `datetime.now(timezone.utc)` (abusech, abuseipdb, azorult-tracker, misp). Plugins job: 0 errors, 2 warnings (the intentional unused-ignore-comment). 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.
Final plugins ratchet batch. Drops
unresolved-attributeanddeprecatedfrom the overrides — the
[[tool.ty.overrides]]block now holds onlyunused-ignore-comment(the two core boto3/tldextract import ignores, which areenv-dependent: used by the dev-only main job, unused in the all-deps plugins job).
unresolved-attribute (32)
message.eventis anObjectEvent | LinkEvent | TagEventunion and onlyObjectEventhasyeti_object. Narrow withassert isinstance(event, ObjectEvent), thencastyeti_objectto the concrete observable (ContainerImage/Url).Observable/Entitythrough the connector,so plugins doing
x = SpecificType(...).save()thenx.<subclass attr>castthe result: File
.name/.size(abusech, botvrij, hybrid), Malware/IntrusionSet.aliases(malpedia), AttackPattern.kill_chain_phases(wiz), ContainerImage.registry(dockerhub).Response | Noneguards for_make_request(...).content/.text(cisco_umbrella, tranco, lolbas).
deprecated (5)
datetime.utcnow()→datetime.now(timezone.utc)(abusech, abuseipdb,azorult-tracker, misp).
Verification
unused-ignore-comment)ruff check .+ruff format . --check: cleanPlugins ratchet complete 🎉
114 diagnostics at rollout → 0 real diagnostics.
core,yetictl, andpluginsare all now type-checked; only the env-dependentunused-ignore-commentremains atwarn.🤖 Generated with Claude Code