Skip to content

Commit 434189a

Browse files
committed
generate schemas instead of manually replacing
1 parent ef0ab84 commit 434189a

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

build/build/Tasks/Test/UnitTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public override void OnError(Exception exception, BuildContext context)
4848
public override void Finally(BuildContext context)
4949
{
5050
var testResultsFiles = context.GetFiles($"{Paths.TestOutput}/*.results.xml");
51-
if (!context.IsAzurePipelineBuild || !testResultsFiles.Any()) return;
51+
if (!context.IsAzurePipelineBuild || testResultsFiles.Count == 0) return;
5252

5353
var data = new AzurePipelinesPublishTestResultsData
5454
{

build/common/Utilities/Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static string GetTaskArguments(this Type task)
3838
}
3939

4040
var attributes = task.GetCustomAttributes<TaskArgumentAttribute>().ToArray();
41-
if (attributes.Any())
41+
if (attributes.Length != 0)
4242
{
4343
var arguments = attributes.Select(attribute => $"[--{attribute.Name} ({string.Join(" | ", attribute.PossibleValues)})]");
4444
return string.Join(" ", arguments);

schemas/6.0/GitVersion.configuration.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
"commit-message-incrementing": {
5656
"$ref": "#/$defs/nullableOfCommitMessageIncrementMode"
5757
},
58+
"mode": {
59+
"$ref": "#/$defs/nullableOfDeploymentMode"
60+
},
5861
"ignore": {
5962
"description": "The header property for the ignore configuration.",
6063
"type": "object",
@@ -173,9 +176,6 @@
173176
"default": "(?<version>[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*",
174177
"type": "string"
175178
},
176-
"mode": {
177-
"$ref": "#/$defs/nullableOfDeploymentMode"
178-
},
179179
"workflow": {
180180
"description": "The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'",
181181
"type": "string"
@@ -188,6 +188,9 @@
188188
"commit-message-incrementing": {
189189
"$ref": "#/$defs/nullableOfCommitMessageIncrementMode"
190190
},
191+
"mode": {
192+
"$ref": "#/$defs/nullableOfDeploymentMode"
193+
},
191194
"increment": {
192195
"$ref": "#/$defs/incrementStrategy"
193196
},
@@ -226,9 +229,6 @@
226229
},
227230
"tracks-release-branches": {
228231
"$ref": "#/$defs/nullableOfBoolean5"
229-
},
230-
"mode": {
231-
"$ref": "#/$defs/nullableOfDeploymentMode"
232232
}
233233
}
234234
},
@@ -240,6 +240,15 @@
240240
"MergeMessageOnly"
241241
]
242242
},
243+
"nullableOfDeploymentMode": {
244+
"description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.",
245+
"enum": [
246+
"ManualDeployment",
247+
"ContinuousDelivery",
248+
"ContinuousDeployment",
249+
"TrunkBased"
250+
]
251+
},
243252
"incrementStrategy": {
244253
"description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.",
245254
"enum": [
@@ -330,14 +339,6 @@
330339
"null"
331340
]
332341
},
333-
"nullableOfDeploymentMode": {
334-
"description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.",
335-
"enum": [
336-
"ManualDeployment",
337-
"ContinuousDelivery",
338-
"ContinuousDeployment"
339-
]
340-
},
341342
"string3": {
342343
"format": "date-time",
343344
"description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.",
@@ -352,4 +353,4 @@
352353
}
353354
}
354355
}
355-
}
356+
}

0 commit comments

Comments
 (0)