1- using Microsoft . CodeAnalysis . Diagnostics ;
2- using Microsoft . CodeAnalysis ;
1+ using System ;
32using System . Collections . Immutable ;
3+ using System . Diagnostics ;
4+ using Microsoft . CodeAnalysis ;
5+ using Microsoft . CodeAnalysis . Diagnostics ;
46using static ThisAssembly ;
57using static ThisAssembly . Strings ;
6- using System . Diagnostics ;
7- using System ;
88
99namespace NuGetizer ;
1010
@@ -90,7 +90,7 @@ class Descriptors
9090 true ,
9191 description : RepositoryUrl . Description ,
9292 helpLinkUri : "https://learn.microsoft.com/en-us/nuget/reference/nuspec#repository" ) ;
93-
93+
9494 public static readonly DiagnosticDescriptor MissingProjectUrl = new (
9595 ProjectUrl . ID ,
9696 ProjectUrl . Title ,
@@ -124,22 +124,22 @@ class Descriptors
124124
125125 public override ImmutableArray < DiagnosticDescriptor > SupportedDiagnostics { get ; } = ImmutableArray . Create (
126126 Descriptors . DefaultDescription ,
127- Descriptors . LongDescription ,
128- Descriptors . MissingIcon ,
129- Descriptors . MissingReadme ,
130- Descriptors . MissingLicense ,
131- Descriptors . DuplicateLicense ,
132- Descriptors . MissingRepositoryCommit ,
133- Descriptors . MissingRepositoryUrl ,
134- Descriptors . MissingProjectUrl ,
135- Descriptors . MissingSourceLink ,
127+ Descriptors . LongDescription ,
128+ Descriptors . MissingIcon ,
129+ Descriptors . MissingReadme ,
130+ Descriptors . MissingLicense ,
131+ Descriptors . DuplicateLicense ,
132+ Descriptors . MissingRepositoryCommit ,
133+ Descriptors . MissingRepositoryUrl ,
134+ Descriptors . MissingProjectUrl ,
135+ Descriptors . MissingSourceLink ,
136136 Descriptors . MissingSourceEmbed ) ;
137137
138138 public override void Initialize ( AnalysisContext context )
139139 {
140140 context . EnableConcurrentExecution ( ) ;
141141 context . ConfigureGeneratedCodeAnalysis ( GeneratedCodeAnalysisFlags . None ) ;
142-
142+
143143 context . RegisterCompilationAction ( ctx =>
144144 {
145145 var options = ctx . Options . AnalyzerConfigOptionsProvider . GlobalOptions ;
@@ -173,7 +173,7 @@ public override void Initialize(AnalysisContext context)
173173 else if ( string . IsNullOrWhiteSpace ( packageIcon ) && string . IsNullOrWhiteSpace ( packageIconUrl ) )
174174 ctx . ReportDiagnostic ( Diagnostic . Create ( Descriptors . MissingIcon , null ) ) ;
175175
176- if ( ! options . TryGetValue ( "build_property.PackageReadmeFile" , out var readme ) ||
176+ if ( ! options . TryGetValue ( "build_property.PackageReadmeFile" , out var readme ) ||
177177 string . IsNullOrWhiteSpace ( readme ) )
178178 ctx . ReportDiagnostic ( Diagnostic . Create ( Descriptors . MissingReadme , null ) ) ;
179179
@@ -202,7 +202,7 @@ public override void Initialize(AnalysisContext context)
202202 "true" . Equals ( sccSupported , StringComparison . OrdinalIgnoreCase ) )
203203 {
204204 string ? repoCommit = default ;
205-
205+
206206 if ( ! options . TryGetValue ( "build_property.RepositoryCommit" , out repoCommit ) ||
207207 string . IsNullOrWhiteSpace ( repoCommit ) )
208208 {
@@ -226,7 +226,7 @@ public override void Initialize(AnalysisContext context)
226226 ctx . ReportDiagnostic ( Diagnostic . Create ( Descriptors . MissingRepositoryUrl , null ) ) ;
227227
228228 if ( ! options . TryGetValue ( "build_property.PackageProjectUrl" , out var projectUrl ) ||
229- string . IsNullOrWhiteSpace ( projectUrl ) ||
229+ string . IsNullOrWhiteSpace ( projectUrl ) ||
230230 projectUrl == repoUrl )
231231 ctx . ReportDiagnostic ( Diagnostic . Create ( Descriptors . MissingProjectUrl , null , repoUrl ) ) ;
232232
0 commit comments