Skip to content

Commit c9ce7f7

Browse files
feat(claude-code-settings): sync to Claude Code v2.1.119 (SchemaStore#5614)
Co-authored-by: domdomegg <domdomegg@users.noreply.github.com>
1 parent 8dfabd4 commit c9ce7f7

12 files changed

Lines changed: 433 additions & 20 deletions

src/helpers/coverage.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,33 @@ function collectPropertyValues(data, propName) {
6060
// matching is deferred to v2.
6161
function collectValuesByPath(data, path) {
6262
const values = []
63+
64+
// For $defs paths (e.g. "#$defs/hookCommand.shell"), path-based traversal
65+
// cannot work because the path references the schema definition, not the
66+
// test data structure. Fall back to a deep name-based search for the
67+
// terminal property name so that test files exercising the property via
68+
// $ref usage are still matched.
69+
if (path.startsWith('#')) {
70+
const propName = path.split('.').pop()
71+
function deepCollect(current) {
72+
if (!current || typeof current !== 'object') return
73+
if (Array.isArray(current)) {
74+
for (const item of current) deepCollect(item)
75+
return
76+
}
77+
for (const [key, val] of Object.entries(current)) {
78+
if (key === propName && val !== undefined && val !== null) {
79+
values.push(val)
80+
}
81+
if (typeof val === 'object' && val !== null) {
82+
deepCollect(val)
83+
}
84+
}
85+
}
86+
deepCollect(data)
87+
return values
88+
}
89+
6390
const segments = path.split('.')
6491

6592
function traverse(current, remaining) {
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
{
22
"autoUpdatesChannel": "beta",
3+
"defaultShell": "zsh",
4+
"disableDeepLinkRegistration": "enabled",
35
"effortLevel": "extreme",
46
"forceLoginMethod": "github",
57
"permissions": {
68
"defaultMode": "invalid-mode",
9+
"disableAutoMode": "enabled",
710
"disableBypassPermissionsMode": "enabled"
811
},
912
"spinnerVerbs": {
1013
"mode": "merge",
1114
"verbs": ["Analyzing"]
1215
},
13-
"teammateMode": "split"
16+
"teammateMode": "split",
17+
"tui": "mini",
18+
"viewMode": "list"
1419
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"hooks": [
6+
{
7+
"command": "echo test",
8+
"shell": "fish",
9+
"type": "command"
10+
}
11+
],
12+
"matcher": "Bash"
13+
}
14+
]
15+
}
16+
}

src/negative_test/claude-code-settings/missing-required-hook-fields.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"hooks": [
66
{
77
"type": "command"
8+
},
9+
{
10+
"tool": "lint_file",
11+
"type": "mcp_tool"
812
}
913
]
1014
}

src/negative_test/claude-code-settings/wrong-property-types.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"sandbox": {
2525
"network": {
2626
"allowAllUnixSockets": "yes",
27-
"allowedDomains": "api.anthropic.com"
27+
"allowedDomains": "api.anthropic.com",
28+
"deniedDomains": "should-be-array"
2829
}
2930
},
3031
"strictKnownMarketplaces": [

src/schemas/json/claude-code-settings.json

Lines changed: 270 additions & 11 deletions
Large diffs are not rendered by default.

src/test/claude-code-settings/complete-config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"apiKeyHelper": "/usr/local/bin/claude-auth",
33
"cleanupPeriodDays": 30,
4+
"effortLevel": "medium",
45
"env": {
56
"DEBUG_MODE": "true",
67
"EDITOR": "vim"
@@ -22,5 +23,6 @@
2223
"Bash(wget:*)",
2324
"WebFetch(domain:bad.actor.com)"
2425
]
25-
}
26+
},
27+
"viewMode": "default"
2628
}

src/test/claude-code-settings/edge-cases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"autoUpdatesChannel": "stable",
3-
"cleanupPeriodDays": 0,
3+
"cleanupPeriodDays": 1,
44
"effortLevel": "low",
55
"env": {},
66
"fastMode": false,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
3+
"channelsEnabled": false,
4+
"defaultShell": "bash",
5+
"effortLevel": "xhigh",
6+
"hooks": {
7+
"PreToolUse": [
8+
{
9+
"hooks": [
10+
{
11+
"command": "echo bash",
12+
"shell": "bash",
13+
"type": "command"
14+
},
15+
{
16+
"command": "Get-Content",
17+
"shell": "powershell",
18+
"type": "command"
19+
}
20+
],
21+
"matcher": "Bash"
22+
}
23+
]
24+
},
25+
"terminalTitleFromRename": true,
26+
"tui": "fullscreen",
27+
"viewMode": "verbose"
28+
}

src/test/claude-code-settings/hooks-complete.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@
9090
"command": "git diff",
9191
"statusMessage": "Reviewing changes",
9292
"type": "command"
93+
},
94+
{
95+
"input": {
96+
"file": "${tool_input.file_path}"
97+
},
98+
"server": "linter",
99+
"statusMessage": "Linting edited file",
100+
"timeout": 30,
101+
"tool": "lint_file",
102+
"type": "mcp_tool"
93103
}
94104
],
95105
"matcher": "Edit"

0 commit comments

Comments
 (0)