Skip to content

Commit

Permalink
Set diagnostics category to NuGet
Browse files Browse the repository at this point in the history
This can make it easier to filter diagnostics
  • Loading branch information
kzu committed Mar 1, 2023
1 parent e753903 commit 8b367c8
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/CodeAnalysis/MetadataAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ namespace NuGetizer;
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic, LanguageNames.FSharp)]
class MetadataAnalyzer : DiagnosticAnalyzer
{
const string Category = "NuGet";

class Descriptors
{
public static readonly DiagnosticDescriptor DefaultDescription = new(
Strings.DefaultDescription.ID,
Strings.DefaultDescription.Title,
Strings.DefaultDescription.Message,
"Design",
Category,
DiagnosticSeverity.Warning,
true,
description: Strings.DefaultDescription.Description,
Expand All @@ -27,7 +29,7 @@ class Descriptors
Strings.LongDescription.ID,
Strings.LongDescription.Title,
Strings.LongDescription.Message,
"Design",
Category,
DiagnosticSeverity.Error,
true,
helpLinkUri: "https://learn.microsoft.com/en-us/nuget/reference/nuspec#description");
Expand All @@ -36,7 +38,7 @@ class Descriptors
Strings.MissingIcon.ID,
Strings.MissingIcon.Title,
Strings.MissingIcon.Message,
"Design",
Category,
DiagnosticSeverity.Info,
true,
description: Strings.MissingIcon.Description,
Expand All @@ -46,7 +48,7 @@ class Descriptors
Strings.MissingReadme.ID,
Strings.MissingReadme.Title,
Strings.MissingReadme.Message,
"Design",
Category,
DiagnosticSeverity.Info,
true,
description: Strings.MissingReadme.Description,
Expand All @@ -56,7 +58,7 @@ class Descriptors
Strings.MissingLicense.ID,
Strings.MissingLicense.Title,
Strings.MissingLicense.Message,
"Design",
Category,
DiagnosticSeverity.Info,
true,
description: Strings.MissingLicense.Description,
Expand All @@ -66,7 +68,7 @@ class Descriptors
Strings.DuplicateLicense.ID,
Strings.DuplicateLicense.Title,
Strings.DuplicateLicense.Message,
"Design",
Category,
DiagnosticSeverity.Error,
true,
helpLinkUri: "https://learn.microsoft.com/en-us/nuget/reference/nuspec#license");
Expand All @@ -75,7 +77,7 @@ class Descriptors
RepositoryCommit.ID,
RepositoryCommit.Title,
RepositoryCommit.Message,
"Design",
Category,
DiagnosticSeverity.Info,
true,
description: RepositoryCommit.Description,
Expand All @@ -85,7 +87,7 @@ class Descriptors
RepositoryUrl.ID,
RepositoryUrl.Title,
RepositoryUrl.Message,
"Design",
Category,
DiagnosticSeverity.Info,
true,
description: RepositoryUrl.Description,
Expand All @@ -95,7 +97,7 @@ class Descriptors
ProjectUrl.ID,
ProjectUrl.Title,
ProjectUrl.MessageString,
"Design",
Category,
DiagnosticSeverity.Info,
true,
description: ProjectUrl.Description,
Expand All @@ -105,7 +107,7 @@ class Descriptors
SourceLink.ID,
SourceLink.Title,
SourceLink.Message,
"Design",
Category,
DiagnosticSeverity.Info,
true,
description: SourceLink.Description,
Expand All @@ -115,7 +117,7 @@ class Descriptors
SourceLinkEmbed.ID,
SourceLinkEmbed.Title,
SourceLinkEmbed.Message,
"Design",
Category,
DiagnosticSeverity.Info,
true,
description: SourceLinkEmbed.Description,
Expand Down

0 comments on commit 8b367c8

Please sign in to comment.