ratchet(types): promote missing-argument/invalid-assignment/unresolved-import (plugins) - #1314
Merged
Conversation
…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.
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.
Second plugins ratchet batch. Fixes instances and drops three rules from the
[[tool.ty.overrides]]block.passive_total.py) — two real latent bugs:e.with_traceback()with no arg →logging.error(e); andadd_context(context)called with one arg →
add_context(context["source"], context).datadog_metrics_metrics_flushertypedClassVar[MetricsFlusher | None];otx_alienvaultcontexttypeddict[str, Any]so the datetimecontext["created"]assignment fits.import yarainotx_alienvault/yaraifygets aper-line
# ty: ignore[unresolved-import](yara-python is a stub-less C ext).unused-ignore-commentstays atwarn: its only instances are theboto3/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
ruff check .+ruff format . --check: clean