ratchet(types): fix invalid-parameter-default + enforce the rule#1288
Merged
Conversation
All 15 instances were internal function signatures using a `None` default on a non-optional annotation (`tags: List[str] = None`, `host: str = None`, etc.), plus one where the annotation should have been `type[Task]` (the param is a class, used in `issubclass`). None are request/response models or endpoint parameters, so these are annotation-only changes — no runtime or OpenAPI impact. With the rule at zero, flip `invalid-parameter-default` from "warn" to "error" in [tool.ty.rules] so it stays fixed. First full ratchet step (fix + enforce).
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 ty ratchet PR — the first that flips a rule to
error.What
All 15
invalid-parameter-defaultdiagnostics were internal function signatures with aNonedefault on a non-optional annotation:tags: List[str] = None→tags: List[str] | None = None(the observable/entity/indicatorsave/create/findhelpers)host/port/username/password/database: str|int = NoneinArangoYetiConnector.connectuser: "user.User" = Noneinconnect/filter/the interfaceget_plugins_list(task_class: Task = Task)→type[Task](the param is a class, used inissubclass)None are request/response models or FastAPI endpoint parameters, so these are annotation-only — no runtime behavior, no OpenAPI/wire change (frontend-safe).
Ratchet
With the rule at zero,
invalid-parameter-defaultmoves fromwarntoerrorin[tool.ty.rules]. It's now enforced — a futurearg: list = Nonefails CI.Verification
invalid-parameter-default15 → 0, rule enforced at error,ty check --exit-zero-on-warningexits 0.