|
243 | 243 | "properties": { |
244 | 244 | "byte-string-type-annotation": { |
245 | 245 | "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```", |
247 | 247 | "default": "error", |
248 | 248 | "oneOf": [ |
249 | 249 | { |
|
301 | 301 | } |
302 | 302 | ] |
303 | 303 | }, |
| 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 | + }, |
304 | 314 | "division-by-zero": { |
305 | 315 | "title": "detects division by zero", |
306 | 316 | "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 | 353 | }, |
344 | 354 | "fstring-type-annotation": { |
345 | 355 | "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```", |
347 | 357 | "default": "error", |
348 | 358 | "oneOf": [ |
349 | 359 | { |
|
353 | 363 | }, |
354 | 364 | "implicit-concatenated-string-type-annotation": { |
355 | 365 | "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```", |
357 | 367 | "default": "error", |
358 | 368 | "oneOf": [ |
359 | 369 | { |
|
723 | 733 | }, |
724 | 734 | "raw-string-type-annotation": { |
725 | 735 | "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```", |
727 | 737 | "default": "error", |
728 | 738 | "oneOf": [ |
729 | 739 | { |
|
0 commit comments