|
2 | 2 | "$schema": "http://json-schema.org/draft-07/schema#", |
3 | 3 | "$id": "https://json.schemastore.org/tombi.json", |
4 | 4 | "title": "Tombi", |
5 | | - "description": "**Tombi** (鳶) is a toolkit for TOML; providing a formatter/linter and language server.\n See the [GitHub repository](https://github.com/tombi-toml/tombi) for more information.", |
| 5 | + "description": "**Tombi** (鳶) is a toolkit for TOML; providing a formatter/linter and language server.\nSee the [GitHub repository](https://github.com/tombi-toml/tombi) for more information.", |
6 | 6 | "type": "object", |
7 | 7 | "properties": { |
8 | | - "format": { |
9 | | - "title": "Formatter options.", |
10 | | - "anyOf": [ |
11 | | - { |
12 | | - "$ref": "#/definitions/FormatOptions" |
13 | | - }, |
14 | | - { |
15 | | - "type": "null" |
16 | | - } |
17 | | - ] |
18 | | - }, |
19 | 8 | "toml-version": { |
20 | 9 | "title": "TOML version.", |
21 | 10 | "description": "TOML version to use if not specified in the schema.", |
|
30 | 19 | "default": "v1.0.0" |
31 | 20 | }, |
32 | 21 | "include": { |
33 | | - "title": "File patterns to include.", |
34 | | - "description": "The file match pattern to include in formatting and linting.\n Supports glob pattern.", |
| 22 | + "title": "Deprecated. Use `files.include` instead.", |
35 | 23 | "type": ["array", "null"], |
36 | 24 | "items": { |
37 | 25 | "type": "string" |
38 | 26 | }, |
| 27 | + "deprecated": true, |
39 | 28 | "minItems": 1 |
40 | 29 | }, |
41 | 30 | "exclude": { |
42 | | - "title": "File patterns to exclude.", |
43 | | - "description": "The file match pattern to exclude from formatting and linting.\n Supports glob pattern.", |
| 31 | + "title": "Deprecated. Use `files.exclude` instead.", |
44 | 32 | "type": ["array", "null"], |
45 | 33 | "items": { |
46 | 34 | "type": "string" |
47 | 35 | }, |
| 36 | + "deprecated": true, |
48 | 37 | "minItems": 1 |
49 | 38 | }, |
| 39 | + "files": { |
| 40 | + "anyOf": [ |
| 41 | + { |
| 42 | + "$ref": "#/definitions/FilesOptions" |
| 43 | + }, |
| 44 | + { |
| 45 | + "type": "null" |
| 46 | + } |
| 47 | + ] |
| 48 | + }, |
| 49 | + "format": { |
| 50 | + "title": "Formatter options.", |
| 51 | + "anyOf": [ |
| 52 | + { |
| 53 | + "$ref": "#/definitions/FormatOptions" |
| 54 | + }, |
| 55 | + { |
| 56 | + "type": "null" |
| 57 | + } |
| 58 | + ] |
| 59 | + }, |
50 | 60 | "lint": { |
51 | 61 | "title": "Linter options.", |
52 | 62 | "anyOf": [ |
|
109 | 119 | "type": "string", |
110 | 120 | "enum": ["v1.0.0", "v1.1.0-preview"] |
111 | 121 | }, |
| 122 | + "FilesOptions": { |
| 123 | + "title": "Files options.", |
| 124 | + "type": "object", |
| 125 | + "properties": { |
| 126 | + "include": { |
| 127 | + "title": "File patterns to include.", |
| 128 | + "description": "The file match pattern to include in formatting and linting.\nSupports glob pattern.", |
| 129 | + "type": ["array", "null"], |
| 130 | + "items": { |
| 131 | + "type": "string" |
| 132 | + }, |
| 133 | + "minItems": 1, |
| 134 | + "default": ["**/*.toml"] |
| 135 | + }, |
| 136 | + "exclude": { |
| 137 | + "title": "File patterns to exclude.", |
| 138 | + "description": "The file match pattern to exclude from formatting and linting.\nSupports glob pattern.", |
| 139 | + "type": ["array", "null"], |
| 140 | + "items": { |
| 141 | + "type": "string" |
| 142 | + }, |
| 143 | + "minItems": 1 |
| 144 | + } |
| 145 | + }, |
| 146 | + "additionalProperties": false, |
| 147 | + "x-tombi-table-keys-order": "schema" |
| 148 | + }, |
112 | 149 | "FormatOptions": { |
113 | 150 | "title": "Formatter options.", |
114 | | - "description": "To avoid needless discussion of formatting rules,\n we do not currently have a configuration item for formatting.", |
| 151 | + "description": "To avoid needless discussion of formatting rules,\nwe do not currently have a configuration item for formatting.", |
115 | 152 | "type": "object", |
116 | 153 | "additionalProperties": false, |
117 | 154 | "x-tombi-table-keys-order": "schema" |
|
139 | 176 | "properties": { |
140 | 177 | "key-empty": { |
141 | 178 | "title": "Key empty.", |
142 | | - "description": "Check if the key is empty.\n ```toml\n \"\" = true\n ```", |
| 179 | + "description": "Check if the key is empty.\n\n```toml\n# VALID BUT DISCOURAGED\n\"\" = true\n```", |
| 180 | + "anyOf": [ |
| 181 | + { |
| 182 | + "$ref": "#/definitions/SeverityLevelDefaultWarn" |
| 183 | + }, |
| 184 | + { |
| 185 | + "type": "null" |
| 186 | + } |
| 187 | + ] |
| 188 | + }, |
| 189 | + "dotted-keys-out-of-order": { |
| 190 | + "title": "Dotted keys out of order.", |
| 191 | + "description": "Check if dotted keys are defined out of order.\n\n```toml\n# VALID BUT DISCOURAGED\napple.type = \"fruit\"\norange.type = \"fruit\"\napple.skin = \"thin\"\norange.skin = \"thick\"\n\n# RECOMMENDED\napple.type = \"fruit\"\napple.skin = \"thin\"\norange.type = \"fruit\"\norange.skin = \"thick\"\n```", |
| 192 | + "anyOf": [ |
| 193 | + { |
| 194 | + "$ref": "#/definitions/SeverityLevelDefaultWarn" |
| 195 | + }, |
| 196 | + { |
| 197 | + "type": "null" |
| 198 | + } |
| 199 | + ] |
| 200 | + }, |
| 201 | + "tables-out-of-order": { |
| 202 | + "title": "Tables out of order.", |
| 203 | + "description": "Check if tables are defined out of order.\n\n```toml\n# VALID BUT DISCOURAGED\n[fruit.apple]\n[animal]\n[fruit.orange]\n\n# RECOMMENDED\n[fruit.apple]\n[fruit.orange]\n[animal]\n```", |
143 | 204 | "anyOf": [ |
144 | 205 | { |
145 | 206 | "$ref": "#/definitions/SeverityLevelDefaultWarn" |
|
151 | 212 | } |
152 | 213 | }, |
153 | 214 | "additionalProperties": false, |
154 | | - "x-tombi-table-keys-order": "schema" |
| 215 | + "x-tombi-table-keys-order": "version-sort" |
155 | 216 | }, |
156 | 217 | "SeverityLevelDefaultWarn": { |
157 | 218 | "default": "warn", |
|
162 | 223 | ] |
163 | 224 | }, |
164 | 225 | "SeverityLevel": { |
165 | | - "type": "string", |
166 | | - "enum": ["off", "warn", "error"] |
| 226 | + "oneOf": [ |
| 227 | + { |
| 228 | + "title": "Disable the Rule.", |
| 229 | + "type": "string", |
| 230 | + "const": "off" |
| 231 | + }, |
| 232 | + { |
| 233 | + "title": "Display as Warning.", |
| 234 | + "type": "string", |
| 235 | + "const": "warn" |
| 236 | + }, |
| 237 | + { |
| 238 | + "title": "Display as Error.", |
| 239 | + "type": "string", |
| 240 | + "const": "error" |
| 241 | + } |
| 242 | + ] |
167 | 243 | }, |
168 | 244 | "LspOptions": { |
169 | 245 | "type": "object", |
170 | 246 | "properties": { |
| 247 | + "code-action": { |
| 248 | + "title": "Code Action Feature options.", |
| 249 | + "anyOf": [ |
| 250 | + { |
| 251 | + "$ref": "#/definitions/LspCodeAction" |
| 252 | + }, |
| 253 | + { |
| 254 | + "type": "null" |
| 255 | + } |
| 256 | + ] |
| 257 | + }, |
171 | 258 | "completion": { |
172 | 259 | "title": "Completion Feature options.", |
173 | 260 | "anyOf": [ |
|
260 | 347 | "additionalProperties": false, |
261 | 348 | "x-tombi-table-keys-order": "ascending" |
262 | 349 | }, |
263 | | - "LspCompletion": { |
| 350 | + "LspCodeAction": { |
264 | 351 | "type": "object", |
265 | 352 | "properties": { |
266 | 353 | "enabled": { |
267 | | - "title": "Enable completion feature.", |
268 | | - "description": "Whether to enable completion.", |
| 354 | + "title": "Enable code action feature.", |
| 355 | + "description": "Whether to enable code action.", |
269 | 356 | "anyOf": [ |
270 | 357 | { |
271 | 358 | "$ref": "#/definitions/BoolDefaultTrue" |
|
282 | 369 | "type": "boolean", |
283 | 370 | "default": true |
284 | 371 | }, |
| 372 | + "LspCompletion": { |
| 373 | + "type": "object", |
| 374 | + "properties": { |
| 375 | + "enabled": { |
| 376 | + "title": "Enable completion feature.", |
| 377 | + "description": "Whether to enable completion.", |
| 378 | + "anyOf": [ |
| 379 | + { |
| 380 | + "$ref": "#/definitions/BoolDefaultTrue" |
| 381 | + }, |
| 382 | + { |
| 383 | + "type": "null" |
| 384 | + } |
| 385 | + ] |
| 386 | + } |
| 387 | + }, |
| 388 | + "additionalProperties": false |
| 389 | + }, |
285 | 390 | "LspDiagnostics": { |
286 | 391 | "type": "object", |
287 | 392 | "properties": { |
|
388 | 493 | }, |
389 | 494 | "strict": { |
390 | 495 | "title": "Enable or disable strict schema validation.", |
391 | | - "description": "If `additionalProperties` is not specified in the JSON Schema,\n the strict mode treats it as `additionalProperties: false`,\n which is different from the JSON Schema specification.", |
| 496 | + "description": "If `additionalProperties` is not specified in the JSON Schema,\nthe strict mode treats it as `additionalProperties: false`,\nwhich is different from the JSON Schema specification.", |
392 | 497 | "anyOf": [ |
393 | 498 | { |
394 | 499 | "$ref": "#/definitions/BoolDefaultTrue" |
|
428 | 533 | "properties": { |
429 | 534 | "paths": { |
430 | 535 | "title": "The schema catalog path/url array.", |
431 | | - "description": "The catalog is evaluated after the schemas specified by [[schemas]].", |
| 536 | + "description": "The catalog is evaluated after the schemas specified by [[schemas]].\\\nSchemas are loaded in order from the beginning of the catalog list.", |
432 | 537 | "type": ["array", "null"], |
433 | 538 | "items": { |
434 | 539 | "$ref": "#/definitions/SchemaCatalogPath" |
435 | 540 | }, |
436 | | - "default": ["https://www.schemastore.org/api/json/catalog.json"] |
| 541 | + "default": [ |
| 542 | + "tombi:///json/catalog.json", |
| 543 | + "https://json.schemastore.org/api/json/catalog.json" |
| 544 | + ] |
437 | 545 | } |
438 | 546 | }, |
439 | 547 | "additionalProperties": false |
|
447 | 555 | "properties": { |
448 | 556 | "path": { |
449 | 557 | "title": "The schema catalog path or url.", |
450 | | - "description": "**🚧 Deprecated 🚧**\\\n Please use `schema.catalog.paths` instead.", |
| 558 | + "description": "**🚧 Deprecated 🚧**\\\nPlease use `schema.catalog.paths` instead.", |
451 | 559 | "anyOf": [ |
452 | 560 | { |
453 | | - "$ref": "#/definitions/OneOrMany_for_SchemaCatalogPath" |
| 561 | + "$ref": "#/definitions/OneOrMany" |
454 | 562 | }, |
455 | 563 | { |
456 | 564 | "type": "null" |
457 | 565 | } |
458 | 566 | ], |
459 | 567 | "deprecated": true, |
460 | | - "default": "https://www.schemastore.org/api/json/catalog.json" |
| 568 | + "default": "https://json.schemastore.org/api/json/catalog.json" |
461 | 569 | } |
462 | 570 | }, |
463 | 571 | "additionalProperties": false |
464 | 572 | }, |
465 | | - "OneOrMany_for_SchemaCatalogPath": { |
| 573 | + "OneOrMany": { |
466 | 574 | "anyOf": [ |
467 | 575 | { |
468 | 576 | "$ref": "#/definitions/SchemaCatalogPath" |
|
509 | 617 | }, |
510 | 618 | "include": { |
511 | 619 | "title": "The file match pattern of the schema.", |
512 | | - "description": "The file match pattern to include the target to apply the schema.\n Supports glob pattern.", |
| 620 | + "description": "The file match pattern to include the target to apply the schema.\nSupports glob pattern.", |
513 | 621 | "type": "array", |
514 | 622 | "items": { |
515 | 623 | "type": "string" |
|
527 | 635 | "properties": { |
528 | 636 | "root": { |
529 | 637 | "title": "The accessors to apply the sub schema.", |
530 | | - "type": ["string", "null"], |
| 638 | + "type": "string", |
531 | 639 | "examples": ["tools.tombi", "items[0].name"], |
532 | 640 | "minLength": 1 |
533 | 641 | }, |
|
537 | 645 | }, |
538 | 646 | "include": { |
539 | 647 | "title": "The file match pattern of the sub schema.", |
540 | | - "description": "The file match pattern to include the target to apply the sub schema.\n Supports glob pattern.", |
| 648 | + "description": "The file match pattern to include the target to apply the sub schema.\nSupports glob pattern.", |
541 | 649 | "type": "array", |
542 | 650 | "items": { |
543 | 651 | "type": "string" |
|
546 | 654 | } |
547 | 655 | }, |
548 | 656 | "additionalProperties": false, |
549 | | - "required": ["path", "include"], |
| 657 | + "required": ["root", "path", "include"], |
550 | 658 | "x-tombi-table-keys-order": "schema" |
551 | 659 | }, |
552 | 660 | "OldSubSchema": { |
|
560 | 668 | }, |
561 | 669 | "include": { |
562 | 670 | "title": "The file match pattern of the sub schema.", |
563 | | - "description": "The file match pattern to include the target to apply the sub schema.\n Supports glob pattern.", |
| 671 | + "description": "The file match pattern to include the target to apply the sub schema.\nSupports glob pattern.", |
564 | 672 | "type": "array", |
565 | 673 | "items": { |
566 | 674 | "type": "string" |
|
569 | 677 | }, |
570 | 678 | "root-keys": { |
571 | 679 | "title": "The keys to apply the sub schema.", |
572 | | - "description": "**🚧 Deprecated 🚧**\\\n Please use `schemas[*].root` instead.", |
573 | | - "type": ["string", "null"], |
| 680 | + "description": "**🚧 Deprecated 🚧**\\\nPlease use `schemas[*].root` instead.", |
| 681 | + "type": "string", |
574 | 682 | "deprecated": true, |
575 | 683 | "minLength": 1 |
576 | 684 | } |
577 | 685 | }, |
578 | 686 | "additionalProperties": false, |
579 | | - "required": ["path", "include"], |
| 687 | + "required": ["path", "include", "root-keys"], |
580 | 688 | "x-tombi-table-keys-order": "schema" |
581 | 689 | } |
582 | 690 | } |
|
0 commit comments