Skip to content

Commit cf85cac

Browse files
authored
Update ty's JSON schema (SchemaStore#5269)
This updates ty's JSON schema to [d18902cdcc4d39badfad86c88e89b866a809c881](astral-sh/ty@d18902c)
1 parent cbd6303 commit cf85cac

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/schemas/json/ty.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@
304304
{
305305
"description": "Python 3.14",
306306
"const": "3.14"
307+
},
308+
{
309+
"description": "Python 3.15",
310+
"const": "3.15"
307311
}
308312
]
309313
},
@@ -778,6 +782,16 @@
778782
}
779783
]
780784
},
785+
"invalid-total-ordering": {
786+
"title": "detects `@total_ordering` classes without an ordering method",
787+
"description": "## What it does\nChecks for classes decorated with `@functools.total_ordering` that don't\ndefine any ordering method (`__lt__`, `__le__`, `__gt__`, or `__ge__`).\n\n## Why is this bad?\nThe `@total_ordering` decorator requires the class to define at least one\nordering method. If none is defined, Python raises a `ValueError` at runtime.\n\n## Example\n\n```python\nfrom functools import total_ordering\n\n@total_ordering\nclass MyClass: # Error: no ordering method defined\n def __eq__(self, other: object) -> bool:\n return True\n```\n\nUse instead:\n\n```python\nfrom functools import total_ordering\n\n@total_ordering\nclass MyClass:\n def __eq__(self, other: object) -> bool:\n return True\n\n def __lt__(self, other: \"MyClass\") -> bool:\n return True\n```",
788+
"default": "error",
789+
"oneOf": [
790+
{
791+
"$ref": "#/definitions/Level"
792+
}
793+
]
794+
},
781795
"invalid-type-alias-type": {
782796
"title": "detects invalid TypeAliasType definitions",
783797
"description": "## What it does\nChecks for the creation of invalid `TypeAliasType`s\n\n## Why is this bad?\nThere are several requirements that you must follow when creating a `TypeAliasType`.\n\n## Examples\n```python\nfrom typing import TypeAliasType\n\nIntOrStr = TypeAliasType(\"IntOrStr\", int | str) # okay\nNewAlias = TypeAliasType(get_name(), int) # error: TypeAliasType name must be a string literal\n```",
@@ -848,6 +862,16 @@
848862
}
849863
]
850864
},
865+
"invalid-typed-dict-statement": {
866+
"title": "detects invalid statements in `TypedDict` class bodies",
867+
"description": "## What it does\nDetects statements other than annotated declarations in `TypedDict` class bodies.\n\n## Why is this bad?\n`TypedDict` class bodies aren't allowed to contain any other types of statements. For\nexample, method definitions and field values aren't allowed. None of these will be\navailable on \"instances of the `TypedDict`\" at runtime (as `dict` is the runtime class of\nall \"`TypedDict` instances\").\n\n## Example\n```python\nfrom typing import TypedDict\n\nclass Foo(TypedDict):\n def bar(self): # error: [invalid-typed-dict-statement]\n pass\n```",
868+
"default": "error",
869+
"oneOf": [
870+
{
871+
"$ref": "#/definitions/Level"
872+
}
873+
]
874+
},
851875
"missing-argument": {
852876
"title": "detects missing required arguments in a call",
853877
"description": "## What it does\nChecks for missing required arguments in a call.\n\n## Why is this bad?\nFailing to provide a required argument will raise a `TypeError` at runtime.\n\n## Examples\n```python\ndef func(x: int): ...\nfunc() # TypeError: func() missing 1 required positional argument: 'x'\n```",

0 commit comments

Comments
 (0)