Skip to content

Commit

Permalink
Merge pull request #1180 from MattFromRVA/Add_Compilation_End_Custom_Tag
Browse files Browse the repository at this point in the history
Add CompilationEnd Tag to CompilationStartedAnalyzerWithCompilationWideAnalysis Sample
  • Loading branch information
sharwell authored Aug 23, 2024
2 parents dda9795 + 1db03a9 commit 0af0fc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public class CompilationStartedAnalyzerWithCompilationWideAnalysis : DiagnosticA
DiagnosticCategories.Stateful,
DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: Description);
description: Description,
customTags: WellKnownDiagnosticTags.CompilationEnd);

public const string UnsecureMethodAttributeName = "MyNamespace.UnsecureMethodAttribute";
public const string SecureTypeInterfaceName = "MyNamespace.ISecureType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Namespace BasicAnalyzers
Friend Shared ReadOnly MessageFormat As LocalizableString = "Type '{0}' is a secure type as it implements interface '{1}', but it also implements interface '{2}' which has unsecure method(s)."
Friend Shared ReadOnly Description As LocalizableString = "Secure types must not implement interfaces with unsecure methods."

Friend Shared Rule As New DiagnosticDescriptor(DiagnosticIds.CompilationStartedAnalyzerWithCompilationWideAnalysisRuleId, Title, MessageFormat, DiagnosticCategories.Stateful, DiagnosticSeverity.Warning, isEnabledByDefault:=True, description:=Description)
Friend Shared Rule As New DiagnosticDescriptor(DiagnosticIds.CompilationStartedAnalyzerWithCompilationWideAnalysisRuleId, Title, MessageFormat, DiagnosticCategories.Stateful, DiagnosticSeverity.Warning, isEnabledByDefault:=True, description:=Description, Nothing, WellKnownDiagnosticTags.CompilationEnd)
#End Region

Public Const UnsecureMethodAttributeName As String = "MyNamespace.UnsecureMethodAttribute"
Expand Down

0 comments on commit 0af0fc3

Please sign in to comment.