15
15
using System ;
16
16
using System . Collections . Generic ;
17
17
using System . Linq ;
18
- using System . Text ;
19
18
using System . Text . RegularExpressions ;
20
- using System . Threading . Tasks ;
19
+ using Tools . Common . Loggers ;
20
+ using Tools . Common . Models ;
21
21
22
22
namespace StaticAnalysis . BreakingChangeAnalyzer
23
23
{
24
24
/// <summary>
25
- /// This class is responsible for comparing CmdletBreakingChangeMetadata and
25
+ /// This class is responsible for comparing CmdletMetadata and
26
26
/// checking for breaking changes between old (serialized) metadata and new metadata.
27
27
/// </summary>
28
28
public class CmdletMetadataHelper
@@ -47,29 +47,29 @@ public CmdletMetadataHelper(TypeMetadataHelper typeMetadataHelper)
47
47
48
48
/// <summary>
49
49
/// Compares the metadata of cmdlets with the same name (or alias) for any breaking changes.
50
- ///
50
+ ///
51
51
/// Breaking changes for cmdlets include
52
52
/// - Removing a cmdlet
53
53
/// - Removing an alias to a cmdlet
54
54
/// - Removing SupportsShouldProcess
55
55
/// - Removing SupportsPaging
56
56
/// - Output type (or any of its properties) of cmdlet has changed
57
57
/// - Default parameter set has changed
58
- ///
58
+ ///
59
59
/// This method will also check for breaking changes in the cmdlets' parameters and
60
60
/// parameter sets using the appropriate helpers.
61
61
/// </summary>
62
62
/// <param name="oldCmdlets">The list of cmdlets from the old (serialized) metadata.</param>
63
63
/// <param name="newCmdlets">The list of cmdlets from the new metadata.</param>
64
64
/// <param name="issueLogger">ReportLogger that will keep track of issues found.</param>
65
65
public void CompareCmdletMetadata (
66
- List < CmdletBreakingChangeMetadata > oldCmdlets ,
67
- List < CmdletBreakingChangeMetadata > newCmdlets ,
66
+ List < CmdletMetadata > oldCmdlets ,
67
+ List < CmdletMetadata > newCmdlets ,
68
68
ReportLogger < BreakingChangeIssue > issueLogger )
69
69
{
70
70
// This dictionary will map a cmdlet name (or alias) to the corresponding metadata
71
- Dictionary < string , CmdletBreakingChangeMetadata > cmdletDictionary =
72
- new Dictionary < string , CmdletBreakingChangeMetadata > ( ) ;
71
+ Dictionary < string , CmdletMetadata > cmdletDictionary =
72
+ new Dictionary < string , CmdletMetadata > ( ) ;
73
73
74
74
// Add each cmdlet and its aliases to the dictionary
75
75
foreach ( var newCmdlet in newCmdlets )
@@ -125,8 +125,8 @@ public void CompareCmdletMetadata(
125
125
/// <param name="newCmdlet">The cmdlet metadata from the new assembly.</param>
126
126
/// <param name="issueLogger">ReportLogger that will keep track of issues found.</param>
127
127
private void CheckForRemovedCmdletAlias (
128
- CmdletBreakingChangeMetadata oldCmdlet ,
129
- CmdletBreakingChangeMetadata newCmdlet ,
128
+ CmdletMetadata oldCmdlet ,
129
+ CmdletMetadata newCmdlet ,
130
130
ReportLogger < BreakingChangeIssue > issueLogger )
131
131
{
132
132
// This set will contain all of the aliases in the new metadata
@@ -164,8 +164,8 @@ private void CheckForRemovedCmdletAlias(
164
164
/// <param name="newCmdlet">The cmdlet metadata from the new assembly.</param>
165
165
/// <param name="issueLogger">ReportLogger that will keep track of issues found.</param>
166
166
private void CheckForRemovedSupportsShouldProcess (
167
- CmdletBreakingChangeMetadata oldCmdlet ,
168
- CmdletBreakingChangeMetadata newCmdlet ,
167
+ CmdletMetadata oldCmdlet ,
168
+ CmdletMetadata newCmdlet ,
169
169
ReportLogger < BreakingChangeIssue > issueLogger )
170
170
{
171
171
// If the old cmdlet implements SupportsShouldProcess and the new cmdlet does not, log an issue
@@ -187,8 +187,8 @@ private void CheckForRemovedSupportsShouldProcess(
187
187
/// <param name="newCmdlet">The cmdlet metadata from the new assembly.</param>
188
188
/// <param name="issueLogger">ReportLogger that will keep track of issues found.</param>
189
189
private void CheckForRemovedSupportsPaging (
190
- CmdletBreakingChangeMetadata oldCmdlet ,
191
- CmdletBreakingChangeMetadata newCmdlet ,
190
+ CmdletMetadata oldCmdlet ,
191
+ CmdletMetadata newCmdlet ,
192
192
ReportLogger < BreakingChangeIssue > issueLogger )
193
193
{
194
194
// If the old cmdlet implements SupportsPaging and the new cmdlet does not, log an issue
@@ -211,8 +211,8 @@ private void CheckForRemovedSupportsPaging(
211
211
/// <param name="newCmdlet">The cmdlet metadata from the new assembly.</param>
212
212
/// <param name="issueLogger">ReportLogger that will keep track of issues found.</param>
213
213
private void CheckForChangedOutputType (
214
- CmdletBreakingChangeMetadata oldCmdlet ,
215
- CmdletBreakingChangeMetadata newCmdlet ,
214
+ CmdletMetadata oldCmdlet ,
215
+ CmdletMetadata newCmdlet ,
216
216
ReportLogger < BreakingChangeIssue > issueLogger )
217
217
{
218
218
// This dictionary will map an output type name to the corresponding type metadata
@@ -262,8 +262,8 @@ private void CheckForChangedOutputType(
262
262
/// <param name="newCmdlet">The cmdlet metadata from the new assembly.</param>
263
263
/// <param name="issueLogger">ReportLogger that will keep track of issues found.</param>
264
264
private void CheckDefaultParameterName (
265
- CmdletBreakingChangeMetadata oldCmdlet ,
266
- CmdletBreakingChangeMetadata newCmdlet ,
265
+ CmdletMetadata oldCmdlet ,
266
+ CmdletMetadata newCmdlet ,
267
267
ReportLogger < BreakingChangeIssue > issueLogger )
268
268
{
269
269
// If the default parameter name hasn't changed, or if there wasn't a
@@ -315,7 +315,7 @@ private void CheckDefaultParameterName(
315
315
}
316
316
317
317
/// <summary>
318
- /// Comparer for assebly qualified names. Parses of the PublicKeyToken, so that types from signed and unsigned assemblies match
318
+ /// Comparer for assebly qualified names. Parses of the PublicKeyToken, so that types from signed and unsigned assemblies match
319
319
/// </summary>
320
320
class TypeNameComparer : IEqualityComparer < string >
321
321
{
0 commit comments