Skip to content

Commit 10a432e

Browse files
authored
feat: update tombi. (SchemaStore#4811)
Co-authored-by: ya7010 <[email protected]>
1 parent 928c14f commit 10a432e

File tree

1 file changed

+147
-39
lines changed

1 file changed

+147
-39
lines changed

src/schemas/json/tombi.json

Lines changed: 147 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,9 @@
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://json.schemastore.org/tombi.json",
44
"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.",
66
"type": "object",
77
"properties": {
8-
"format": {
9-
"title": "Formatter options.",
10-
"anyOf": [
11-
{
12-
"$ref": "#/definitions/FormatOptions"
13-
},
14-
{
15-
"type": "null"
16-
}
17-
]
18-
},
198
"toml-version": {
209
"title": "TOML version.",
2110
"description": "TOML version to use if not specified in the schema.",
@@ -30,23 +19,44 @@
3019
"default": "v1.0.0"
3120
},
3221
"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.",
3523
"type": ["array", "null"],
3624
"items": {
3725
"type": "string"
3826
},
27+
"deprecated": true,
3928
"minItems": 1
4029
},
4130
"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.",
4432
"type": ["array", "null"],
4533
"items": {
4634
"type": "string"
4735
},
36+
"deprecated": true,
4837
"minItems": 1
4938
},
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+
},
5060
"lint": {
5161
"title": "Linter options.",
5262
"anyOf": [
@@ -109,9 +119,36 @@
109119
"type": "string",
110120
"enum": ["v1.0.0", "v1.1.0-preview"]
111121
},
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+
},
112149
"FormatOptions": {
113150
"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.",
115152
"type": "object",
116153
"additionalProperties": false,
117154
"x-tombi-table-keys-order": "schema"
@@ -139,7 +176,31 @@
139176
"properties": {
140177
"key-empty": {
141178
"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```",
143204
"anyOf": [
144205
{
145206
"$ref": "#/definitions/SeverityLevelDefaultWarn"
@@ -151,7 +212,7 @@
151212
}
152213
},
153214
"additionalProperties": false,
154-
"x-tombi-table-keys-order": "schema"
215+
"x-tombi-table-keys-order": "version-sort"
155216
},
156217
"SeverityLevelDefaultWarn": {
157218
"default": "warn",
@@ -162,12 +223,38 @@
162223
]
163224
},
164225
"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+
]
167243
},
168244
"LspOptions": {
169245
"type": "object",
170246
"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+
},
171258
"completion": {
172259
"title": "Completion Feature options.",
173260
"anyOf": [
@@ -260,12 +347,12 @@
260347
"additionalProperties": false,
261348
"x-tombi-table-keys-order": "ascending"
262349
},
263-
"LspCompletion": {
350+
"LspCodeAction": {
264351
"type": "object",
265352
"properties": {
266353
"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.",
269356
"anyOf": [
270357
{
271358
"$ref": "#/definitions/BoolDefaultTrue"
@@ -282,6 +369,24 @@
282369
"type": "boolean",
283370
"default": true
284371
},
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+
},
285390
"LspDiagnostics": {
286391
"type": "object",
287392
"properties": {
@@ -388,7 +493,7 @@
388493
},
389494
"strict": {
390495
"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.",
392497
"anyOf": [
393498
{
394499
"$ref": "#/definitions/BoolDefaultTrue"
@@ -428,12 +533,15 @@
428533
"properties": {
429534
"paths": {
430535
"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.",
432537
"type": ["array", "null"],
433538
"items": {
434539
"$ref": "#/definitions/SchemaCatalogPath"
435540
},
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+
]
437545
}
438546
},
439547
"additionalProperties": false
@@ -447,22 +555,22 @@
447555
"properties": {
448556
"path": {
449557
"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.",
451559
"anyOf": [
452560
{
453-
"$ref": "#/definitions/OneOrMany_for_SchemaCatalogPath"
561+
"$ref": "#/definitions/OneOrMany"
454562
},
455563
{
456564
"type": "null"
457565
}
458566
],
459567
"deprecated": true,
460-
"default": "https://www.schemastore.org/api/json/catalog.json"
568+
"default": "https://json.schemastore.org/api/json/catalog.json"
461569
}
462570
},
463571
"additionalProperties": false
464572
},
465-
"OneOrMany_for_SchemaCatalogPath": {
573+
"OneOrMany": {
466574
"anyOf": [
467575
{
468576
"$ref": "#/definitions/SchemaCatalogPath"
@@ -509,7 +617,7 @@
509617
},
510618
"include": {
511619
"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.",
513621
"type": "array",
514622
"items": {
515623
"type": "string"
@@ -527,7 +635,7 @@
527635
"properties": {
528636
"root": {
529637
"title": "The accessors to apply the sub schema.",
530-
"type": ["string", "null"],
638+
"type": "string",
531639
"examples": ["tools.tombi", "items[0].name"],
532640
"minLength": 1
533641
},
@@ -537,7 +645,7 @@
537645
},
538646
"include": {
539647
"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.",
541649
"type": "array",
542650
"items": {
543651
"type": "string"
@@ -546,7 +654,7 @@
546654
}
547655
},
548656
"additionalProperties": false,
549-
"required": ["path", "include"],
657+
"required": ["root", "path", "include"],
550658
"x-tombi-table-keys-order": "schema"
551659
},
552660
"OldSubSchema": {
@@ -560,7 +668,7 @@
560668
},
561669
"include": {
562670
"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.",
564672
"type": "array",
565673
"items": {
566674
"type": "string"
@@ -569,14 +677,14 @@
569677
},
570678
"root-keys": {
571679
"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",
574682
"deprecated": true,
575683
"minLength": 1
576684
}
577685
},
578686
"additionalProperties": false,
579-
"required": ["path", "include"],
687+
"required": ["path", "include", "root-keys"],
580688
"x-tombi-table-keys-order": "schema"
581689
}
582690
}

0 commit comments

Comments
 (0)