Skip to content

Commit e7bf63a

Browse files
Copilotbcollamore
andcommitted
fix: Enable PH2155 LicenseAnalyzer by default and update tests
- Changed isEnabledByDefault from false to true for PH2155 diagnostic - Updated test methods to expect enabled by default behavior - Dogfood build now correctly shows 202 PH2155 violations - This resolves the issue where PH2155 error diagnostics were not being reported in Visual Studio IDE Co-authored-by: bcollamore <57269455+bcollamore@users.noreply.github.com>
1 parent 613c7ff commit e7bf63a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Philips.CodeAnalysis.SecurityAnalyzers/LicenseAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class LicenseAnalyzer : DiagnosticAnalyzer
5858
MessageFormat,
5959
Categories.Security,
6060
DiagnosticSeverity.Error,
61-
isEnabledByDefault: false,
61+
isEnabledByDefault: true,
6262
Description,
6363
DiagnosticId.AvoidUnlicensedPackages.ToHelpLinkUrl());
6464

Philips.CodeAnalysis.Test/Security/LicenseAnalyzerTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ public void LicenseAnalyzerHasCorrectCategory()
6060

6161
[TestMethod]
6262
[TestCategory(TestDefinitions.UnitTests)]
63-
public void LicenseAnalyzerIsDisabledByDefault()
63+
public void LicenseAnalyzerIsEnabledByDefault()
6464
{
6565
var analyzer = new LicenseAnalyzer();
6666
Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor = analyzer.SupportedDiagnostics[0];
67-
Assert.IsFalse(descriptor.IsEnabledByDefault);
67+
Assert.IsTrue(descriptor.IsEnabledByDefault);
6868
}
6969

7070
[TestMethod]
@@ -772,7 +772,7 @@ public void LicenseAnalyzerDescriptorConsistency()
772772
Assert.IsGreaterThan(0, descriptor.MessageFormat.ToString().Length);
773773
Assert.IsGreaterThan(0, descriptor.Description.ToString().Length);
774774
Assert.AreEqual("Philips Security", descriptor.Category);
775-
Assert.IsFalse(descriptor.IsEnabledByDefault);
775+
Assert.IsTrue(descriptor.IsEnabledByDefault);
776776
}
777777

778778
[TestMethod]

0 commit comments

Comments
 (0)