From 73167dae625741daa57b8b256e09af840336afcd Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Fri, 20 Feb 2026 13:36:35 -0800 Subject: [PATCH] Update ty's JSON schema This updates ty's JSON schema to [751672710c88eaf0ee4b79728979377e11488120](https://github.com/astral-sh/ty/commit/751672710c88eaf0ee4b79728979377e11488120) --- src/schemas/json/ty.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/schemas/json/ty.json b/src/schemas/json/ty.json index b8197b08cb3..2feb61db3ab 100644 --- a/src/schemas/json/ty.json +++ b/src/schemas/json/ty.json @@ -80,6 +80,13 @@ "$ref": "#/definitions/string" } }, + "replace-imports-with-any": { + "description": "A list of module glob patterns whose imports should be replaced with `typing.Any`.\n\nUnlike `allowed-unresolved-imports`, this setting replaces the module's type information\nwith `typing.Any` even if the module can be resolved. Import diagnostics are\nunconditionally suppressed for matching modules.\n\n- Prefix a pattern with `!` to exclude matching modules\n\nWhen multiple patterns match, later entries take precedence.\n\nGlob patterns can be used in combinations with each other. For example, to suppress errors for\nany module where the first component contains the substring `test`, use `*test*.**`.\n\nWhen multiple patterns match, later entries take precedence.", + "type": ["array", "null"], + "items": { + "$ref": "#/definitions/string" + } + }, "respect-type-ignore-comments": { "description": "Whether ty should respect `type: ignore` comments.\n\nWhen set to `false`, `type: ignore` comments are treated like any other normal\ncomment and can't be used to suppress ty errors (you have to use `ty: ignore` instead).\n\nSetting this option can be useful when using ty alongside other type checkers or when\nyou prefer using `ty: ignore` over `type: ignore`.\n\nDefaults to `true`.", "type": ["boolean", "null"] @@ -794,6 +801,16 @@ } ] }, + "invalid-match-pattern": { + "title": "detect invalid match patterns", + "description": "## What it does\nChecks for invalid match patterns.\n\n## Why is this bad?\nMatching on invalid patterns will lead to a runtime error.\n\n## Examples\n```python\nNotAClass = 42\n\nmatch x:\n case NotAClass(): # TypeError at runtime: must be a class\n ...\n```", + "default": "error", + "oneOf": [ + { + "$ref": "#/definitions/Level" + } + ] + }, "invalid-metaclass": { "title": "detects invalid `metaclass=` arguments", "description": "## What it does\nChecks for arguments to `metaclass=` that are invalid.\n\n## Why is this bad?\nPython allows arbitrary expressions to be used as the argument to `metaclass=`.\nThese expressions, however, need to be callable and accept the same arguments\nas `type.__new__`.\n\n## Example\n\n```python\ndef f(): ...\n\n# TypeError: f() takes 0 positional arguments but 3 were given\nclass B(metaclass=f): ...\n```\n\n## References\n- [Python documentation: Metaclasses](https://docs.python.org/3/reference/datamodel.html#metaclasses)", @@ -1204,6 +1221,16 @@ } ] }, + "redundant-final-classvar": { + "title": "detects redundant combinations of `ClassVar` and `Final`", + "description": "## What it does\nChecks for redundant combinations of the `ClassVar` and `Final` type qualifiers.\n\n## Why is this bad?\nAn attribute that is marked `Final` in a class body is implicitly a class variable.\nMarking it as `ClassVar` is therefore redundant.\n\nNote that this diagnostic is not emitted for dataclass fields, where\n`ClassVar[Final[int]]` has a distinct meaning from `Final[int]`.\n\n## Examples\n```python\nfrom typing import ClassVar, Final\n\nclass C:\n x: ClassVar[Final[int]] = 1 # redundant\n y: Final[ClassVar[int]] = 1 # redundant\n```", + "default": "warn", + "oneOf": [ + { + "$ref": "#/definitions/Level" + } + ] + }, "static-assert-error": { "title": "Failed static assertion", "description": "## What it does\nMakes sure that the argument of `static_assert` is statically known to be true.\n\n## Why is this bad?\nA `static_assert` call represents an explicit request from the user\nfor the type checker to emit an error if the argument cannot be verified\nto evaluate to `True` in a boolean context.\n\n## Examples\n```python\nfrom ty_extensions import static_assert\n\nstatic_assert(1 + 1 == 3) # error: evaluates to `False`\n\nstatic_assert(int(2.0 * 3.0) == 6) # error: does not have a statically known truthiness\n```",