Skip to content

Commit 7df344f

Browse files
authored
Update ty's JSON schema (#4869)
1 parent eb04802 commit 7df344f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/schemas/json/ty.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
"properties": {
244244
"byte-string-type-annotation": {
245245
"title": "detects byte strings in type annotation positions",
246-
"description": "## What it does\nChecks for byte-strings in type annotation positions.\n\n## Why is this bad?\nStatic analysis tools like ty can't analyse type annotations that use byte-string notation.\n\n## Examples\n```python\ndef test(): -> b\"int\":\n ...\n```\n\nUse instead:\n```python\ndef test(): -> \"int\":\n ...\n```",
246+
"description": "## What it does\nChecks for byte-strings in type annotation positions.\n\n## Why is this bad?\nStatic analysis tools like ty can't analyze type annotations that use byte-string notation.\n\n## Examples\n```python\ndef test(): -> b\"int\":\n ...\n```\n\nUse instead:\n```python\ndef test(): -> \"int\":\n ...\n```",
247247
"default": "error",
248248
"oneOf": [
249249
{
@@ -301,6 +301,16 @@
301301
}
302302
]
303303
},
304+
"deprecated": {
305+
"title": "detects uses of deprecated items",
306+
"description": "## What it does\nChecks for uses of deprecated items\n\n## Why is this bad?\nDeprecated items should no longer be used.\n\n## Examples\n```python\n@warnings.deprecated(\"use new_func instead\")\ndef old_func(): ...\n\nold_func() # emits [deprecated] diagnostic\n```",
307+
"default": "warn",
308+
"oneOf": [
309+
{
310+
"$ref": "#/definitions/Level"
311+
}
312+
]
313+
},
304314
"division-by-zero": {
305315
"title": "detects division by zero",
306316
"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```",
@@ -343,7 +353,7 @@
343353
},
344354
"fstring-type-annotation": {
345355
"title": "detects F-strings in type annotation positions",
346-
"description": "## What it does\nChecks for f-strings in type annotation positions.\n\n## Why is this bad?\nStatic analysis tools like ty can't analyse type annotations that use f-string notation.\n\n## Examples\n```python\ndef test(): -> f\"int\":\n ...\n```\n\nUse instead:\n```python\ndef test(): -> \"int\":\n ...\n```",
356+
"description": "## What it does\nChecks for f-strings in type annotation positions.\n\n## Why is this bad?\nStatic analysis tools like ty can't analyze type annotations that use f-string notation.\n\n## Examples\n```python\ndef test(): -> f\"int\":\n ...\n```\n\nUse instead:\n```python\ndef test(): -> \"int\":\n ...\n```",
347357
"default": "error",
348358
"oneOf": [
349359
{
@@ -353,7 +363,7 @@
353363
},
354364
"implicit-concatenated-string-type-annotation": {
355365
"title": "detects implicit concatenated strings in type annotations",
356-
"description": "## What it does\nChecks for implicit concatenated strings in type annotation positions.\n\n## Why is this bad?\nStatic analysis tools like ty can't analyse type annotations that use implicit concatenated strings.\n\n## Examples\n```python\ndef test(): -> \"Literal[\" \"5\" \"]\":\n ...\n```\n\nUse instead:\n```python\ndef test(): -> \"Literal[5]\":\n ...\n```",
366+
"description": "## What it does\nChecks for implicit concatenated strings in type annotation positions.\n\n## Why is this bad?\nStatic analysis tools like ty can't analyze type annotations that use implicit concatenated strings.\n\n## Examples\n```python\ndef test(): -> \"Literal[\" \"5\" \"]\":\n ...\n```\n\nUse instead:\n```python\ndef test(): -> \"Literal[5]\":\n ...\n```",
357367
"default": "error",
358368
"oneOf": [
359369
{
@@ -723,7 +733,7 @@
723733
},
724734
"raw-string-type-annotation": {
725735
"title": "detects raw strings in type annotation positions",
726-
"description": "## What it does\nChecks for raw-strings in type annotation positions.\n\n## Why is this bad?\nStatic analysis tools like ty can't analyse type annotations that use raw-string notation.\n\n## Examples\n```python\ndef test(): -> r\"int\":\n ...\n```\n\nUse instead:\n```python\ndef test(): -> \"int\":\n ...\n```",
736+
"description": "## What it does\nChecks for raw-strings in type annotation positions.\n\n## Why is this bad?\nStatic analysis tools like ty can't analyze type annotations that use raw-string notation.\n\n## Examples\n```python\ndef test(): -> r\"int\":\n ...\n```\n\nUse instead:\n```python\ndef test(): -> \"int\":\n ...\n```",
727737
"default": "error",
728738
"oneOf": [
729739
{

0 commit comments

Comments
 (0)