Skip to content

Commit dfb9159

Browse files
committed
Improve messaging for SA1205
StyleCop Analyzers is able to determine the accessibility of elements whether or not it is declared, so the SA1205 suggestions to the contrary are misleading.
1 parent d6c83c4 commit dfb9159

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1205PartialElementsMustDeclareAccess.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ namespace StyleCop.Analyzers.OrderingRules
1212
using Microsoft.CodeAnalysis.Diagnostics;
1313

1414
/// <summary>
15-
/// The partial element does not have an access modifier defined. StyleCop may not be able to determine the correct
16-
/// placement of the elements in the file. Please declare an access modifier for all partial elements.
15+
/// The partial element does not have an access modifier defined.
1716
/// </summary>
1817
/// <remarks>
1918
/// <para>A violation of this rule occurs when the partial elements does not have an access modifier defined.</para>
@@ -27,7 +26,7 @@ internal class SA1205PartialElementsMustDeclareAccess : DiagnosticAnalyzer
2726
public const string DiagnosticId = "SA1205";
2827
private const string Title = "Partial elements must declare access";
2928
private const string MessageFormat = "Partial elements must declare an access modifier";
30-
private const string Description = "The partial element does not have an access modifier defined. StyleCop may not be able to determine the correct placement of the elements in the file. Please declare an access modifier for all partial elements.";
29+
private const string Description = "The partial element does not have an access modifier defined.";
3130
private const string HelpLink = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1205.md";
3231

3332
private static readonly DiagnosticDescriptor Descriptor =

documentation/SA1205.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717

1818
## Cause
1919

20-
The partial element does not have an access modifier defined. StyleCop may not be able to determine the correct
21-
placement of the elements in the file. Please declare an access modifier for all partial elements.
20+
The partial element does not have an access modifier defined.
2221

2322
## Rule description
2423

2524
A violation of this rule occurs when the partial elements does not have an access modifier defined.
2625

2726
## How to fix violations
2827

29-
To fix an instance of this violation, specify an acess modifier for the partial element.
28+
To fix an instance of this violation, specify an access modifier for the partial element.
3029

3130
## How to suppress violations
3231

0 commit comments

Comments
 (0)