Skip to content

Commit a876f89

Browse files
committed
Check for empty ValidateSet to fix incorrect failures
1 parent cc4bda0 commit a876f89

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tools/StaticAnalysis/BreakingChangeAnalyzer/ParameterMetadataHelper.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ private void CheckParameterValidationSets(
178178
var oldValidateSet = oldParameter.ValidateSet;
179179
var newValidateSet = newParameter.ValidateSet;
180180

181+
// If there is no validate set in the new assembly, return
182+
if (newValidateSet.Count == 0)
183+
{
184+
return;
185+
}
186+
181187
// If there was no validate set in the old assembly, but there is
182188
// one in the new assembly, log an issue
183189
if (oldValidateSet.Count == 0 && newValidateSet.Count > 0)

tools/StaticAnalysis/SerializedCmdlets/Microsoft.Azure.Commands.AnalysisServices.Dataplane.dll.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
"GenericTypeArguments": []
4141
},
4242
"ValidateSet": [],
43+
"ValidateRangeMin": null,
44+
"ValidateRangeMax": null,
4345
"ValidateNotNullOrEmpty": false
4446
},
4547
{
@@ -54,6 +56,8 @@
5456
"GenericTypeArguments": []
5557
},
5658
"ValidateSet": [],
59+
"ValidateRangeMin": null,
60+
"ValidateRangeMax": null,
5761
"ValidateNotNullOrEmpty": false
5862
}
5963
],
@@ -74,6 +78,8 @@
7478
"GenericTypeArguments": []
7579
},
7680
"ValidateSet": [],
81+
"ValidateRangeMin": null,
82+
"ValidateRangeMax": null,
7783
"ValidateNotNullOrEmpty": false
7884
},
7985
"Mandatory": false,
@@ -94,6 +100,8 @@
94100
"GenericTypeArguments": []
95101
},
96102
"ValidateSet": [],
103+
"ValidateRangeMin": null,
104+
"ValidateRangeMax": null,
97105
"ValidateNotNullOrEmpty": false
98106
},
99107
"Mandatory": false,
@@ -145,6 +153,8 @@
145153
"GenericTypeArguments": []
146154
},
147155
"ValidateSet": [],
156+
"ValidateRangeMin": null,
157+
"ValidateRangeMax": null,
148158
"ValidateNotNullOrEmpty": true
149159
},
150160
{
@@ -159,6 +169,8 @@
159169
"GenericTypeArguments": []
160170
},
161171
"ValidateSet": [],
172+
"ValidateRangeMin": null,
173+
"ValidateRangeMax": null,
162174
"ValidateNotNullOrEmpty": false
163175
}
164176
],
@@ -179,6 +191,8 @@
179191
"GenericTypeArguments": []
180192
},
181193
"ValidateSet": [],
194+
"ValidateRangeMin": null,
195+
"ValidateRangeMax": null,
182196
"ValidateNotNullOrEmpty": true
183197
},
184198
"Mandatory": true,
@@ -199,6 +213,8 @@
199213
"GenericTypeArguments": []
200214
},
201215
"ValidateSet": [],
216+
"ValidateRangeMin": null,
217+
"ValidateRangeMax": null,
202218
"ValidateNotNullOrEmpty": false
203219
},
204220
"Mandatory": false,

0 commit comments

Comments
 (0)