Skip to content

Commit 0482aef

Browse files
feat(claude-code-settings): improve test coverage (SchemaStore#5385)
Co-authored-by: domdomegg <domdomegg@users.noreply.github.com>
1 parent 10f7f85 commit 0482aef

12 files changed

Lines changed: 120 additions & 18 deletions
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2+
"autoUpdatesChannel": "beta",
3+
"effortLevel": "extreme",
24
"forceLoginMethod": "github",
35
"permissions": {
4-
"defaultMode": "invalid-mode"
6+
"defaultMode": "invalid-mode",
7+
"disableBypassPermissionsMode": "enabled"
58
},
69
"spinnerVerbs": {
710
"mode": "merge",
811
"verbs": ["Analyzing"]
9-
}
12+
},
13+
"teammateMode": "split"
1014
}

src/negative_test/claude-code-settings/invalid-marketplace-host-pattern.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"extraKnownMarketplaces": {
3+
"corp-bad-git": {
4+
"source": {
5+
"source": "git",
6+
"url": "https://example.com/no-git-suffix"
7+
}
8+
},
39
"internal-git": {
410
"source": {
511
"source": "hostPattern"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"allowedMcpServers": [
3+
{
4+
"serverName": "invalid server name!"
5+
}
6+
],
7+
"deniedMcpServers": [
8+
{
9+
"serverName": "also.invalid.name"
10+
}
11+
]
12+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cleanupPeriodDays": "thirty",
33
"enableAllProjectMcpServers": 1,
4+
"fastMode": "yes",
45
"hooks": {
56
"PreToolUse": [
67
{

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

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@
322322
"description": "Control Opus 4.6 adaptive reasoning effort. Lower effort is faster and cheaper for straightforward tasks, higher effort provides deeper reasoning. See https://code.claude.com/docs/en/model-config#adjust-effort-level",
323323
"default": "high"
324324
},
325+
"fastMode": {
326+
"type": "boolean",
327+
"description": "Enable fast mode for Opus 4.6. Fast mode uses the same model with faster output at higher cost per token. Alternatively, toggle with /fast command. See https://code.claude.com/docs/en/fast-mode",
328+
"default": false
329+
},
325330
"enableAllProjectMcpServers": {
326331
"type": "boolean",
327332
"description": "Whether to automatically approve all MCP servers in the project. See https://code.claude.com/docs/en/mcp",
@@ -580,13 +585,16 @@
580585
"properties": {
581586
"type": {
582587
"type": "string",
588+
"description": "The type of status line handler; must be set to \"command\" to run a custom shell script that receives JSON session data via stdin.",
583589
"const": "command"
584590
},
585591
"command": {
586-
"type": "string"
592+
"type": "string",
593+
"description": "A shell command or path to a script that displays session information (context usage, costs, git status, etc.) by reading JSON data from stdin and writing output to stdout. See https://code.claude.com/docs/en/statusline"
587594
},
588595
"padding": {
589-
"type": "number"
596+
"type": "number",
597+
"description": "Optional number of extra horizontal spacing characters added to the status line content; defaults to 0."
590598
}
591599
},
592600
"required": ["type", "command"],
@@ -604,6 +612,7 @@
604612
"properties": {
605613
"type": {
606614
"type": "string",
615+
"description": "The type of file suggestion handler; must be set to \"command\" to execute a custom shell script that generates file suggestions for the @ file picker.",
607616
"const": "command"
608617
},
609618
"command": {
@@ -653,6 +662,7 @@
653662
"properties": {
654663
"source": {
655664
"type": "string",
665+
"description": "Identifies the marketplace source type",
656666
"const": "url"
657667
},
658668
"url": {
@@ -669,6 +679,7 @@
669679
"properties": {
670680
"source": {
671681
"type": "string",
682+
"description": "Identifies the marketplace source type",
672683
"const": "hostPattern"
673684
},
674685
"hostPattern": {
@@ -684,6 +695,7 @@
684695
"properties": {
685696
"source": {
686697
"type": "string",
698+
"description": "Identifies the marketplace source type",
687699
"const": "github"
688700
},
689701
"repo": {
@@ -707,6 +719,7 @@
707719
"properties": {
708720
"source": {
709721
"type": "string",
722+
"description": "Identifies the marketplace source type",
710723
"const": "git"
711724
},
712725
"url": {
@@ -731,6 +744,7 @@
731744
"properties": {
732745
"source": {
733746
"type": "string",
747+
"description": "Identifies the marketplace source type",
734748
"const": "npm"
735749
},
736750
"package": {
@@ -746,6 +760,7 @@
746760
"properties": {
747761
"source": {
748762
"type": "string",
763+
"description": "Identifies the marketplace source type",
749764
"const": "file"
750765
},
751766
"path": {
@@ -761,6 +776,7 @@
761776
"properties": {
762777
"source": {
763778
"type": "string",
779+
"description": "Identifies the marketplace source type",
764780
"const": "directory"
765781
},
766782
"path": {
@@ -794,6 +810,7 @@
794810
"properties": {
795811
"source": {
796812
"type": "string",
813+
"description": "Identifies the marketplace source type",
797814
"const": "hostPattern"
798815
},
799816
"hostPattern": {
@@ -809,6 +826,7 @@
809826
"properties": {
810827
"source": {
811828
"type": "string",
829+
"description": "Identifies the marketplace source type",
812830
"const": "github"
813831
},
814832
"repo": {
@@ -832,6 +850,7 @@
832850
"properties": {
833851
"source": {
834852
"type": "string",
853+
"description": "Identifies the marketplace source type",
835854
"const": "git"
836855
},
837856
"url": {
@@ -855,6 +874,7 @@
855874
"properties": {
856875
"source": {
857876
"type": "string",
877+
"description": "Identifies the marketplace source type",
858878
"const": "url"
859879
},
860880
"url": {
@@ -878,6 +898,7 @@
878898
"properties": {
879899
"source": {
880900
"type": "string",
901+
"description": "Identifies the marketplace source type",
881902
"const": "npm"
882903
},
883904
"package": {
@@ -893,6 +914,7 @@
893914
"properties": {
894915
"source": {
895916
"type": "string",
917+
"description": "Identifies the marketplace source type",
896918
"const": "file"
897919
},
898920
"path": {
@@ -908,6 +930,7 @@
908930
"properties": {
909931
"source": {
910932
"type": "string",
933+
"description": "Identifies the marketplace source type",
911934
"const": "directory"
912935
},
913936
"path": {
@@ -976,6 +999,7 @@
976999
"properties": {
9771000
"network": {
9781001
"type": "object",
1002+
"description": "Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.",
9791003
"properties": {
9801004
"allowUnixSockets": {
9811005
"type": "array",
@@ -1039,7 +1063,8 @@
10391063
},
10401064
"autoAllowBashIfSandboxed": {
10411065
"type": "boolean",
1042-
"description": "Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed."
1066+
"description": "Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed.",
1067+
"default": true
10431068
},
10441069
"enableWeakerNestedSandbox": {
10451070
"type": "boolean",
@@ -1063,7 +1088,7 @@
10631088
"mode": {
10641089
"type": "string",
10651090
"enum": ["append", "replace"],
1066-
"description": "How custom verbs should be combined with the default spinner verbs"
1091+
"description": "How to combine custom verbs with default spinner verbs: 'append' adds custom verbs to the default list, 'replace' uses only custom verbs"
10671092
},
10681093
"verbs": {
10691094
"type": "array",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"effortLevel": "high",
23
"model": "sonnet",
4+
"teammateMode": "auto",
35
"verbose": false
46
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"WebFetch(domain:anthropic.com)"
1616
],
1717
"ask": ["Write(//tmp/**)", "WebFetch(domain:trusted.example.com)"],
18+
"defaultMode": "delegate",
1819
"deny": [
1920
"Bash(rm:*)",
2021
"Bash(curl:*)",
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
{
2+
"autoUpdatesChannel": "stable",
23
"cleanupPeriodDays": 0,
4+
"effortLevel": "low",
35
"env": {},
6+
"fastMode": false,
7+
"forceLoginMethod": "claudeai",
48
"permissions": {
59
"allow": [],
610
"ask": [],
11+
"defaultMode": "dontAsk",
712
"deny": []
8-
}
13+
},
14+
"prefersReducedMotion": false,
15+
"respectGitignore": true,
16+
"showTurnDuration": true,
17+
"spinnerTipsEnabled": true,
18+
"spinnerVerbs": {
19+
"mode": "append",
20+
"verbs": ["Thinking"]
21+
},
22+
"teammateMode": "in-process",
23+
"terminalProgressBarEnabled": true
924
}

src/test/claude-code-settings/marketplace-host-pattern.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"extraKnownMarketplaces": {
3+
"corp-git-repo": {
4+
"source": {
5+
"source": "git",
6+
"url": "https://git.corp.example/plugins/marketplace.git"
7+
}
8+
},
39
"internal-git": {
410
"source": {
511
"hostPattern": "git.internal.example.com",

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

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
{
22
"$schema": "https://json.schemastore.org/claude-code-settings.json",
33
"allowManagedHooksOnly": false,
4+
"allowManagedPermissionRulesOnly": false,
45
"alwaysThinkingEnabled": false,
56
"apiKeyHelper": "/usr/local/bin/claude-auth-helper",
67
"attribution": {
78
"commit": "Generated with AI\n\nCo-Authored-By: AI <ai@example.com>",
89
"pr": ""
910
},
10-
"autoUpdatesChannel": "stable",
11+
"autoUpdatesChannel": "latest",
1112
"availableModels": ["sonnet", "haiku"],
13+
"awsAuthRefresh": "aws sso login --profile myprofile",
14+
"awsCredentialExport": "/bin/generate_aws_grant.sh",
1215
"cleanupPeriodDays": 60,
16+
"companyAnnouncements": ["Welcome to the team!"],
17+
"disableAllHooks": false,
1318
"disabledMcpjsonServers": ["untrusted-server"],
14-
"effortLevel": "high",
19+
"effortLevel": "medium",
1520
"enableAllProjectMcpServers": true,
21+
"enabledPlugins": {
22+
"formatter@anthropic-tools": true
23+
},
1624
"env": {
1725
"ANTHROPIC_MODEL": "claude-3-5-sonnet-20241022",
1826
"ANTHROPIC_SMALL_FAST_MODEL": "claude-3-5-haiku-20241022",
@@ -27,11 +35,13 @@
2735
}
2836
}
2937
},
38+
"fastMode": true,
3039
"fileSuggestion": {
3140
"command": "~/.claude/file-suggestion.sh",
3241
"type": "command"
3342
},
34-
"forceLoginMethod": "claudeai",
43+
"forceLoginMethod": "console",
44+
"forceLoginOrgUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
3545
"hooks": {
3646
"PermissionRequest": [
3747
{
@@ -80,6 +90,7 @@
8090
"includeCoAuthoredBy": true,
8191
"language": "english",
8292
"model": "opus",
93+
"otelHeadersHelper": "/usr/local/bin/otel-headers.sh",
8394
"outputStyle": "Explanatory",
8495
"permissions": {
8596
"additionalDirectories": ["~/Documents/reference", "~/.config/claude-code"],
@@ -107,11 +118,20 @@
107118
]
108119
},
109120
"plansDirectory": "./plans",
110-
"prefersReducedMotion": false,
111-
"respectGitignore": true,
121+
"pluginConfigs": {
122+
"formatter@anthropic-tools": {
123+
"mcpServers": {
124+
"formatter": {
125+
"autoFormat": "true"
126+
}
127+
}
128+
}
129+
},
130+
"prefersReducedMotion": true,
131+
"respectGitignore": false,
112132
"sandbox": {
113133
"allowUnsandboxedCommands": false,
114-
"autoAllowBashIfSandboxed": true,
134+
"autoAllowBashIfSandboxed": false,
115135
"enableWeakerNestedSandbox": false,
116136
"enabled": true,
117137
"excludedCommands": ["docker", "git"],
@@ -125,16 +145,24 @@
125145
"socksProxyPort": 8081
126146
}
127147
},
128-
"showTurnDuration": true,
129-
"spinnerTipsEnabled": true,
148+
"showTurnDuration": false,
149+
"skipWebFetchPreflight": false,
150+
"skippedMarketplaces": ["untrusted-marketplace"],
151+
"skippedPlugins": ["risky-plugin@unknown-marketplace"],
152+
"spinnerTipsEnabled": false,
130153
"spinnerTipsOverride": {
131154
"excludeDefault": false,
132155
"tips": ["Check the style guide", "Run tests before committing"]
133156
},
134157
"spinnerVerbs": {
135-
"mode": "append",
158+
"mode": "replace",
136159
"verbs": ["Analyzing", "Building"]
137160
},
138-
"teammateMode": "auto",
139-
"terminalProgressBarEnabled": true
161+
"statusLine": {
162+
"command": "~/.claude/statusline.sh",
163+
"padding": 1,
164+
"type": "command"
165+
},
166+
"teammateMode": "tmux",
167+
"terminalProgressBarEnabled": false
140168
}

0 commit comments

Comments
 (0)