Skip to content

Commit 0b29f9e

Browse files
authored
Update ty's JSON schema (SchemaStore#4714)
1 parent c0355c7 commit 0b29f9e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/schemas/json/ty.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
"division-by-zero": {
273273
"title": "detects division by zero",
274274
"description": "## What it does\nIt detects division by zero.\n\n## Why is this bad?\nDividing by zero raises a `ZeroDivisionError` at runtime.\n\n## Examples\n```python\n5 / 0\n```",
275-
"default": "error",
275+
"default": "ignore",
276276
"oneOf": [
277277
{
278278
"$ref": "#/definitions/Level"
@@ -529,6 +529,16 @@
529529
}
530530
]
531531
},
532+
"invalid-type-alias-type": {
533+
"title": "detects invalid TypeAliasType definitions",
534+
"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```",
535+
"default": "error",
536+
"oneOf": [
537+
{
538+
"$ref": "#/definitions/Level"
539+
}
540+
]
541+
},
532542
"invalid-type-checking-constant": {
533543
"title": "detects invalid `TYPE_CHECKING` constant assignments",
534544
"description": "## What it does\nChecks for a value other than `False` assigned to the `TYPE_CHECKING` variable, or an\nannotation not assignable from `bool`.\n\n## Why is this bad?\nThe name `TYPE_CHECKING` is reserved for a flag that can be used to provide conditional\ncode seen only by the type checker, and not at runtime. Normally this flag is imported from\n`typing` or `typing_extensions`, but it can also be defined locally. If defined locally, it\nmust be assigned the value `False` at runtime; the type checker will consider its value to\nbe `True`. If annotated, it must be annotated as a type that can accept `bool` values.\n\n## Examples\n```python\nTYPE_CHECKING: str\nTYPE_CHECKING = ''\n```",
@@ -818,7 +828,7 @@
818828
"type": "object",
819829
"properties": {
820830
"root": {
821-
"description": "The root of the project, used for finding first-party modules.",
831+
"description": "The root of the project, used for finding first-party modules.\n\nIf left unspecified, ty will try to detect common project layouts and initialize `src.root` accordingly:\n\n* if a `./src` directory exists, include `.` and `./src` in the first party search path (src layout or flat) * if a `./<project-name>/<project-name>` directory exists, include `.` and `./<project-name>` in the first party search path * otherwise, default to `.` (flat layout)",
822832
"type": ["string", "null"]
823833
}
824834
},

0 commit comments

Comments
 (0)