Skip to content

Commit efa5486

Browse files
authored
feat: Enhance pyproject.json schema (SchemaStore#5110)
Co-authored-by: ya7010 <[email protected]>
1 parent b832c2c commit efa5486

File tree

1 file changed

+58
-35
lines changed

1 file changed

+58
-35
lines changed

src/schemas/json/pyproject.json

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"items": {
1313
"type": "string",
1414
"pattern": "^[A-Za-z_][A-Za-z_0-9]*(?:\\.[A-Za-z_][A-Za-z_0-9]*)*(?:\\s*;\\s*private)?$"
15-
}
15+
},
16+
"x-tombi-array-values-order": "version-sort"
1617
},
1718
"projectAuthor": {
1819
"type": "object",
@@ -105,6 +106,35 @@
105106
"x-tombi-table-keys-order": "version-sort"
106107
}
107108
}
109+
},
110+
"DependencyGroup": {
111+
"type": "array",
112+
"title": "Dependency specifiers or include groups",
113+
"description": "Each list item should be either:\n- [dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/), or\n- table with a single key `include-group` which specifies another group name to include into this one",
114+
"markdownDescription": "Each list item should be either:\n- [dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/), or\n- table with a single key `include-group` which specifies another group name to include into this one",
115+
"x-intellij-html-description": "<p>Each list item should be either:</p><ul><li><a href=\"https://packaging.python.org/en/latest/specifications/dependency-specifiers/\">dependency specifiers</a>, or</li><li>table with a single key <code>include-group</code> which specifies another group name to include into this one</li></ul>",
116+
"x-tombi-array-values-order": {
117+
"oneOf": ["version-sort", "ascending"]
118+
},
119+
"uniqueItems": true,
120+
"items": {
121+
"oneOf": [
122+
{
123+
"type": "string"
124+
},
125+
{
126+
"type": "object",
127+
"additionalProperties": false,
128+
"properties": {
129+
"include-group": {
130+
"type": "string",
131+
"pattern": "^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9])$"
132+
}
133+
},
134+
"x-tombi-array-values-order-by": "include-group"
135+
}
136+
]
137+
}
108138
}
109139
},
110140
"properties": {
@@ -408,6 +438,7 @@
408438
"key": "https://packaging.python.org/en/latest/specifications/pyproject-toml/#urls"
409439
}
410440
},
441+
"x-tombi-additional-key-label": "url_label",
411442
"x-tombi-table-keys-order": "version-sort",
412443
"examples": [
413444
{
@@ -434,6 +465,7 @@
434465
"key": "https://packaging.python.org/en/latest/specifications/entry-points/#use-for-scripts"
435466
}
436467
},
468+
"x-tombi-additional-key-label": "script_name",
437469
"x-tombi-table-keys-order": "version-sort",
438470
"examples": [
439471
{
@@ -455,6 +487,7 @@
455487
"key": "https://packaging.python.org/en/latest/specifications/entry-points/#use-for-scripts"
456488
}
457489
},
490+
"x-tombi-additional-key-label": "script_name",
458491
"x-tombi-table-keys-order": "version-sort",
459492
"examples": [
460493
{
@@ -470,7 +503,8 @@
470503
"type": "object",
471504
"additionalProperties": {
472505
"type": "string"
473-
}
506+
},
507+
"x-tombi-additional-key-label": "entry_point_name"
474508
}
475509
},
476510
"propertyNames": {
@@ -494,6 +528,7 @@
494528
"key": "https://packaging.python.org/en/latest/specifications/entry-points/#use-for-plugins"
495529
}
496530
},
531+
"x-tombi-additional-key-label": "entry_point_group_name",
497532
"x-tombi-table-keys-order": "version-sort",
498533
"examples": [
499534
{
@@ -523,7 +558,6 @@
523558
},
524559
"optional-dependencies": {
525560
"type": "object",
526-
"x-tombi-table-keys-order": "version-sort",
527561
"patternProperties": {
528562
"^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9])$": {
529563
"type": "array",
@@ -541,6 +575,8 @@
541575
"key": "https://packaging.python.org/en/latest/specifications/pyproject-toml/#dependencies-optional-dependencies"
542576
}
543577
},
578+
"x-tombi-additional-key-label": "package_name",
579+
"x-tombi-table-keys-order": "version-sort",
544580
"examples": [
545581
{
546582
"typing": ["boto3-stubs", "typing-extensions ~= 4.1"]
@@ -881,41 +917,27 @@
881917
"title": "PEP 735 dependency groups",
882918
"description": "Named groups of dependencies, similar to `requirements.txt` files, which launchers, IDEs, and other tools can find and identify by name. Each item in `[dependency-groups]` is defined as mapping of group name to list of [dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/).",
883919
"markdownDescription": "Named groups of dependencies, similar to `requirements.txt` files, which launchers, IDEs, and other tools can find and identify by name. Each item in `[dependency-groups]` is defined as mapping of group name to list of [dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/).",
884-
"x-intellij-html-description": "<p>Named groups of dependencies, similar to <code>requirements.txt</code> files, which launchers, IDEs, and other tools can find and identify by name. Each item in <code>[dependency-groups]</code> is defined as mapping of group name to list of <a href=\"https://packaging.python.org/en/latest/specifications/dependency-specifiers/\">dependency specifiers</a>.</p>",
885-
"x-tombi-table-keys-order": "version-sort",
886-
"x-taplo": {
887-
"links": {
888-
"key": "https://peps.python.org/pep-0735/"
920+
"type": "object",
921+
"properties": {
922+
"dev": {
923+
"$ref": "#/definitions/DependencyGroup"
889924
}
890925
},
891-
"type": "object",
892-
"additionalProperties": false,
893926
"patternProperties": {
894927
"^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9])$": {
895-
"type": "array",
896-
"title": "Dependency specifiers or include groups",
897-
"description": "Each list item should be either:\n- [dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/), or\n- table with a single key `include-group` which specifies another group name to include into this one",
898-
"markdownDescription": "Each list item should be either:\n- [dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/), or\n- table with a single key `include-group` which specifies another group name to include into this one",
899-
"x-intellij-html-description": "<p>Each list item should be either:</p><ul><li><a href=\"https://packaging.python.org/en/latest/specifications/dependency-specifiers/\">dependency specifiers</a>, or</li><li>table with a single key <code>include-group</code> which specifies another group name to include into this one</li></ul>",
900-
"x-tombi-array-values-order": "version-sort",
901-
"uniqueItems": true,
902-
"items": {
903-
"oneOf": [
904-
{
905-
"type": "string"
906-
},
907-
{
908-
"type": "object",
909-
"additionalProperties": false,
910-
"properties": {
911-
"include-group": {
912-
"type": "string",
913-
"pattern": "^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9])$"
914-
}
915-
}
916-
}
917-
]
918-
}
928+
"$ref": "#/definitions/DependencyGroup"
929+
}
930+
},
931+
"additionalProperties": false,
932+
"x-intellij-html-description": "<p>Named groups of dependencies, similar to <code>requirements.txt</code> files, which launchers, IDEs, and other tools can find and identify by name. Each item in <code>[dependency-groups]</code> is defined as mapping of group name to list of <a href=\"https://packaging.python.org/en/latest/specifications/dependency-specifiers/\">dependency specifiers</a>.</p>",
933+
"x-tombi-additional-key-label": "group_name",
934+
"x-tombi-table-keys-order": {
935+
"properties": "version-sort",
936+
"patternProperties": "version-sort"
937+
},
938+
"x-taplo": {
939+
"links": {
940+
"key": "https://peps.python.org/pep-0735/"
919941
}
920942
}
921943
},
@@ -937,6 +959,7 @@
937959
"key": "https://packaging.python.org/en/latest/specifications/pyproject-toml/#arbitrary-tool-configuration-the-tool-table"
938960
}
939961
},
962+
"x-tombi-additional-key-label": "tool_name",
940963
"x-tombi-table-keys-order": "version-sort",
941964
"properties": {
942965
"black": {
@@ -1027,7 +1050,7 @@
10271050
"tombi": {
10281051
"$ref": "https://json.schemastore.org/tombi.json",
10291052
"title": "TOML Toolkit",
1030-
"description": "Tombi (鳶) is a toolkit for TOML; providing a formatter/linter and language server"
1053+
"description": "Tombi is a toolkit for TOML; providing a formatter/linter and language server"
10311054
},
10321055
"tox": {
10331056
"$ref": "https://json.schemastore.org/partial-tox.json",

0 commit comments

Comments
 (0)