|
56 | 56 | }, |
57 | 57 | "additionalProperties": false, |
58 | 58 | "definitions": { |
59 | | - "DiagnosticFormat": { |
60 | | - "description": "The diagnostic output format.", |
61 | | - "oneOf": [ |
62 | | - { |
63 | | - "description": "The default full mode will print \"pretty\" diagnostics.\n\nThat is, color will be used when printing to a `tty`. Moreover, diagnostic messages may include additional context and annotations on the input to help understand the message.", |
64 | | - "type": "string", |
65 | | - "enum": ["full"] |
66 | | - }, |
67 | | - { |
68 | | - "description": "Print diagnostics in a concise mode.\n\nThis will guarantee that each diagnostic is printed on a single line. Only the most important or primary aspects of the diagnostic are included. Contextual information is dropped.\n\nThis may use color when printing to a `tty`.", |
69 | | - "type": "string", |
70 | | - "enum": ["concise"] |
71 | | - } |
72 | | - ] |
73 | | - }, |
74 | 59 | "EnvironmentOptions": { |
75 | 60 | "type": "object", |
76 | 61 | "properties": { |
|
143 | 128 | } |
144 | 129 | ] |
145 | 130 | }, |
| 131 | + "OutputFormat": { |
| 132 | + "description": "The diagnostic output format.", |
| 133 | + "oneOf": [ |
| 134 | + { |
| 135 | + "description": "The default full mode will print \"pretty\" diagnostics.\n\nThat is, color will be used when printing to a `tty`. Moreover, diagnostic messages may include additional context and annotations on the input to help understand the message.", |
| 136 | + "type": "string", |
| 137 | + "enum": ["full"] |
| 138 | + }, |
| 139 | + { |
| 140 | + "description": "Print diagnostics in a concise mode.\n\nThis will guarantee that each diagnostic is printed on a single line. Only the most important or primary aspects of the diagnostic are included. Contextual information is dropped.\n\nThis may use color when printing to a `tty`.", |
| 141 | + "type": "string", |
| 142 | + "enum": ["concise"] |
| 143 | + } |
| 144 | + ] |
| 145 | + }, |
146 | 146 | "OverrideOptions": { |
147 | 147 | "type": "object", |
148 | 148 | "properties": { |
|
831 | 831 | } |
832 | 832 | ] |
833 | 833 | }, |
| 834 | + "unresolved-global": { |
| 835 | + "title": "detects `global` statements with no definition in the global scope", |
| 836 | + "description": "## What it does\nDetects variables declared as `global` in an inner scope that have no explicit\nbindings or declarations in the global scope.\n\n## Why is this bad?\nFunction bodies with `global` statements can run in any order (or not at all), which makes\nit hard for static analysis tools to infer the types of globals without\nexplicit definitions or declarations.\n\n## Example\n```python\ndef f():\n global x # unresolved global\n x = 42\n\ndef g():\n print(x) # unresolved reference\n```\n\nUse instead:\n```python\nx: int\n\ndef f():\n global x\n x = 42\n\ndef g():\n print(x)\n```\n\nOr:\n```python\nx: int | None = None\n\ndef f():\n global x\n x = 42\n\ndef g():\n print(x)\n```", |
| 837 | + "default": "warn", |
| 838 | + "oneOf": [ |
| 839 | + { |
| 840 | + "$ref": "#/definitions/Level" |
| 841 | + } |
| 842 | + ] |
| 843 | + }, |
834 | 844 | "unresolved-import": { |
835 | 845 | "title": "detects unresolved imports", |
836 | 846 | "description": "## What it does\nChecks for import statements for which the module cannot be resolved.\n\n## Why is this bad?\nImporting a module that cannot be resolved will raise a `ModuleNotFoundError`\nat runtime.\n\n## Examples\n```python\nimport foo # ModuleNotFoundError: No module named 'foo'\n```", |
|
946 | 956 | "description": "The format to use for printing diagnostic messages.\n\nDefaults to `full`.", |
947 | 957 | "anyOf": [ |
948 | 958 | { |
949 | | - "$ref": "#/definitions/DiagnosticFormat" |
| 959 | + "$ref": "#/definitions/OutputFormat" |
950 | 960 | }, |
951 | 961 | { |
952 | 962 | "type": "null" |
|
0 commit comments