Skip to content

Commit 1e015e4

Browse files
feat(schemas): add project and user config schemas
- Add project-config.schema.json for project config. - Add user-config.schema.json for user config. adds json schema definitions for ai-commit project and user configs to enable validation and tooling Co-Authored-By: Ai Commit <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 628d3bd commit 1e015e4

2 files changed

Lines changed: 157 additions & 0 deletions

File tree

schemas/project-config.schema.json

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "ai-commit project config",
4+
"type": "object",
5+
"properties": {
6+
"$schema": {
7+
"anyOf": [
8+
{
9+
"type": "string"
10+
},
11+
{
12+
"type": "null"
13+
}
14+
]
15+
},
16+
"scopes": {
17+
"anyOf": [
18+
{
19+
"type": "array",
20+
"items": {
21+
"$ref": "#/definitions/ProjectScope"
22+
}
23+
},
24+
{
25+
"type": "null"
26+
}
27+
]
28+
},
29+
"hook": {
30+
"anyOf": [
31+
{
32+
"type": "array",
33+
"items": {
34+
"type": "string"
35+
}
36+
},
37+
{
38+
"type": "null"
39+
}
40+
]
41+
},
42+
"max_diff_lines": {
43+
"anyOf": [
44+
{
45+
"type": "integer"
46+
},
47+
{
48+
"type": "null"
49+
}
50+
]
51+
},
52+
"no_commit_co_author": {
53+
"anyOf": [
54+
{
55+
"type": "boolean"
56+
},
57+
{
58+
"type": "null"
59+
}
60+
]
61+
},
62+
"no_model_co_author": {
63+
"anyOf": [
64+
{
65+
"type": "boolean"
66+
},
67+
{
68+
"type": "null"
69+
}
70+
]
71+
}
72+
},
73+
"additionalProperties": false,
74+
"definitions": {
75+
"ProjectScope": {
76+
"type": "object",
77+
"properties": {
78+
"name": {
79+
"type": "string"
80+
},
81+
"description": {
82+
"type": "string"
83+
}
84+
},
85+
"required": ["name"],
86+
"additionalProperties": false
87+
}
88+
}
89+
}

schemas/user-config.schema.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "ai-commit user config",
4+
"type": "object",
5+
"properties": {
6+
"$schema": {
7+
"anyOf": [
8+
{
9+
"type": "string"
10+
},
11+
{
12+
"type": "null"
13+
}
14+
]
15+
},
16+
"api_key": {
17+
"anyOf": [
18+
{
19+
"type": "string"
20+
},
21+
{
22+
"type": "null"
23+
}
24+
]
25+
},
26+
"base_url": {
27+
"anyOf": [
28+
{
29+
"type": "string"
30+
},
31+
{
32+
"type": "null"
33+
}
34+
]
35+
},
36+
"model": {
37+
"anyOf": [
38+
{
39+
"type": "string"
40+
},
41+
{
42+
"type": "null"
43+
}
44+
]
45+
},
46+
"no_commit_co_author": {
47+
"anyOf": [
48+
{
49+
"type": "boolean"
50+
},
51+
{
52+
"type": "null"
53+
}
54+
]
55+
},
56+
"no_model_co_author": {
57+
"anyOf": [
58+
{
59+
"type": "boolean"
60+
},
61+
{
62+
"type": "null"
63+
}
64+
]
65+
}
66+
},
67+
"additionalProperties": false
68+
}

0 commit comments

Comments
 (0)