Skip to content

Commit 25bcc4c

Browse files
authored
chore: Add prettier overrides for other JSON files (Azure#12604)
1 parent aba45a0 commit 25bcc4c

File tree

10 files changed

+279
-201
lines changed

10 files changed

+279
-201
lines changed

.prettierrc.json

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
{
2-
"plugins": ["./scripts/prettier-swagger-plugin"],
3-
"parser": "json-swagger",
4-
"printWidth": 20
2+
"overrides": [
3+
{
4+
"files": [
5+
"specification/**/*.json",
6+
"documentation/swagger-bootstrap.json",
7+
"documentation/samplefiles/**/*.json"
8+
],
9+
"options": {
10+
"plugins": [
11+
"./scripts/prettier-swagger-plugin"
12+
],
13+
"parser": "json-swagger",
14+
"printWidth": 20
15+
}
16+
},
17+
{
18+
"files": [
19+
"**/*.json"
20+
],
21+
"options": {
22+
"parser": "json",
23+
"printWidth": 20
24+
},
25+
"excludeFiles": [
26+
"specification/**/*.json"
27+
]
28+
}
29+
]
530
}

documentation/samplefiles/Microsoft.YourServiceName/stable/YYYY-MM-DD/YourServiceName.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@
99
}
1010
},
1111
"host": "management.azure.com",
12-
"schemes": ["https"],
13-
"consumes": ["application/json"],
14-
"produces": ["application/json"],
12+
"schemes": [
13+
"https"
14+
],
15+
"consumes": [
16+
"application/json"
17+
],
18+
"produces": [
19+
"application/json"
20+
],
1521
"security": [
1622
{
17-
"azure_auth": ["user_impersonation"]
23+
"azure_auth": [
24+
"user_impersonation"
25+
]
1826
}
1927
],
2028
"securityDefinitions": {
@@ -31,10 +39,14 @@
3139
"paths": {
3240
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.YourServiceName/operations": {
3341
"get": {
34-
"tags": ["Tag1"],
42+
"tags": [
43+
"Tag1"
44+
],
3545
"operationId": "OperationGroup_Get",
3646
"x-ms-examples": {
37-
"BatchAccountDelete": { "$ref": "./examples/OperationGroupGet.json" }
47+
"BatchAccountDelete": {
48+
"$ref": "./examples/OperationGroupGet.json"
49+
}
3850
},
3951
"description": "This is a sample get operation, please see guidelines in azure-rest-api-specs repository for more info",
4052
"parameters": [

documentation/sdkautomation/GenerateInputSchema.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,13 @@
4747
"$ref": "InstallInstructionScriptInput#"
4848
}
4949
},
50-
"required": ["specFolder", "headSha", "headRef", "repoHttpsUrl", "trigger", "changedFiles", "relatedReadmeMdFiles"]
50+
"required": [
51+
"specFolder",
52+
"headSha",
53+
"headRef",
54+
"repoHttpsUrl",
55+
"trigger",
56+
"changedFiles",
57+
"relatedReadmeMdFiles"
58+
]
5159
}

documentation/sdkautomation/GenerateOutputSchema.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
}
99
}
1010
},
11-
"required": ["packages"],
11+
"required": [
12+
"packages"
13+
],
1214
"definitions": {
1315
"PackageResult": {
1416
"properties": {
@@ -20,7 +22,11 @@
2022
"result": {
2123
// Status of package. By default it's succeeded.
2224
"type": "string",
23-
"enum": ["failed", "succeeded", "warning"],
25+
"enum": [
26+
"failed",
27+
"succeeded",
28+
"warning"
29+
],
2430
"default": "succeeded"
2531
},
2632
"path": {
@@ -52,7 +58,9 @@
5258
"type": "boolean"
5359
}
5460
},
55-
"required": ["content"]
61+
"required": [
62+
"content"
63+
]
5664
},
5765
"artifacts": {
5866
"type": "array",
@@ -65,7 +73,9 @@
6573
"$ref": "InstallInstructionScriptOutput"
6674
}
6775
},
68-
"required": ["path"]
76+
"required": [
77+
"path"
78+
]
6979
}
7080
}
7181
}

documentation/sdkautomation/InstallInstructionScriptOutputSchema.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
"type": "string"
1414
}
1515
},
16-
"required": ["full"]
16+
"required": [
17+
"full"
18+
]
1719
}

documentation/sdkautomation/SpecConfigSchema.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
}
3333
}
3434
},
35-
"required": ["sdkRepositoryMappings"],
35+
"required": [
36+
"sdkRepositoryMappings"
37+
],
3638
"definitions": {
3739
"RepositoryName": {
3840
// Reference to a repository on github. Could be <repo> or <owner>/<repo>.
@@ -76,7 +78,9 @@
7678
"default": "swagger_to_sdk_config.json"
7779
}
7880
},
79-
"required": ["mainRepository"]
81+
"required": [
82+
"mainRepository"
83+
]
8084
}
8185
}
8286
}

documentation/sdkautomation/SwaggerToSdkConfigSchema.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
// If we have multiple related readme.md, should we call generation once with
2424
// all the readme.md or should we call generation multiple times and one per readme.md.
2525
"type": "string",
26-
"enum": ["one-per-config", "one-for-all-configs"],
26+
"enum": [
27+
"one-per-config",
28+
"one-for-all-configs"
29+
],
2730
"default": "one-for-all-configs"
2831
},
2932
"cloneDir": {
@@ -112,7 +115,9 @@
112115
"type": "string"
113116
}
114117
},
115-
"required": ["searchRegex"]
118+
"required": [
119+
"searchRegex"
120+
]
116121
},
117122
{
118123
// If this option is set to false, then package folder will be from generateOutput.json.
@@ -167,7 +172,9 @@
167172
"format": "regex"
168173
}
169174
},
170-
"required": ["searchRegex"]
175+
"required": [
176+
"searchRegex"
177+
]
171178
},
172179
{
173180
// If this option is set to false, then package folder will be from generateOutput.json
@@ -200,7 +207,7 @@
200207
"envs": {
201208
// Extra environment variable to be passed to the script.
202209
// By default the following envs will be passed:
203-
// USER, HOME, PATH, SHELL, PWD (current directory), TMPDIR (dedicated temp folder)
210+
// USER, HOME, PATH, SHELL, PWD (current directory), TMPDIR (dedicated temp folder)
204211
"type": "array",
205212
"items": {
206213
"type": "string"
@@ -241,7 +248,11 @@
241248
"result": {
242249
// If script has non-error exitCode how should we mark the script's result.
243250
"type": "string",
244-
"enum": ["error", "warning", "ignore"],
251+
"enum": [
252+
"error",
253+
"warning",
254+
"ignore"
255+
],
245256
"default": "error"
246257
}
247258
},
@@ -251,7 +262,9 @@
251262
}
252263
}
253264
},
254-
"required": ["path"]
265+
"required": [
266+
"path"
267+
]
255268
},
256269
"RunLogOptions": {
257270
// How should SDK Automation handle the log stream.

0 commit comments

Comments
 (0)