Skip to content

Commit

Permalink
Change non-public [Parameter] warning severities to error.
Browse files Browse the repository at this point in the history
- In preview8 we warned users for non-public `[Parameter]`s and `[Parameter]` setters. For preview9 this is now an error because things will not work as they expect.
- Updated existing tests to reflect the new error expectation.

#12294
  • Loading branch information
NTaylorMullen committed Aug 2, 2019
1 parent 45f9a2a commit d312d79
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/Components/Analyzers/src/DiagnosticDescriptors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static class DiagnosticDescriptors
new LocalizableResourceString(nameof(Resources.ComponentParameterSettersShouldBePublic_Title), Resources.ResourceManager, typeof(Resources)),
new LocalizableResourceString(nameof(Resources.ComponentParameterSettersShouldBePublic_Format), Resources.ResourceManager, typeof(Resources)),
"Encapsulation",
DiagnosticSeverity.Warning,
DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: new LocalizableResourceString(nameof(Resources.ComponentParameterSettersShouldBePublic_Description), Resources.ResourceManager, typeof(Resources)));

Expand All @@ -43,7 +43,7 @@ internal static class DiagnosticDescriptors
new LocalizableResourceString(nameof(Resources.ComponentParameterShouldBePublic_Title), Resources.ResourceManager, typeof(Resources)),
new LocalizableResourceString(nameof(Resources.ComponentParameterShouldBePublic_Format), Resources.ResourceManager, typeof(Resources)),
"Encapsulation",
DiagnosticSeverity.Warning,
DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: new LocalizableResourceString(nameof(Resources.ComponentParametersShouldBePublic_Description), Resources.ResourceManager, typeof(Resources)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty1' should have a public setter.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 7, 39)
Expand All @@ -88,7 +88,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty2' should have a public setter.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 8, 39)
Expand All @@ -98,7 +98,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty3' should have a public setter.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 9, 39)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.BadProperty1' should be public.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 8, 40)
Expand Down Expand Up @@ -85,7 +85,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty1' should have a public setter.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 8, 39)
Expand All @@ -95,7 +95,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty2' should have a public setter.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 9, 39)
Expand All @@ -105,7 +105,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty3' should have a public setter.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 10, 39)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty1' should be public.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 7, 32)
Expand All @@ -73,7 +73,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty2' should be public.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 8, 40)
Expand All @@ -83,7 +83,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty3' should be public.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 9, 42)
Expand All @@ -93,7 +93,7 @@ class TypeName
{
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty4' should be public.",
Severity = DiagnosticSeverity.Warning,
Severity = DiagnosticSeverity.Error,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 10, 41)
Expand Down

0 comments on commit d312d79

Please sign in to comment.