Skip to content

Commit

Permalink
[GH-66] - adjusting diagnostic category name
Browse files Browse the repository at this point in the history
  • Loading branch information
tpodolak committed Feb 17, 2019
1 parent b8f13d9 commit eb0a081
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions documentation/rules/NS1000.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</tr>
<tr>
<td>Category</td>
<td>Non virtual substitution</td>
<td>Non-substitutable member</td>
</tr>
</table>

Expand Down Expand Up @@ -36,7 +36,7 @@ To fix a violation of this rule, make the member of your class virtual or substi
This warning can be suppressed by disabling the warning in the **ruleset** file for the project or by suppressing it (for selected members) in `nsubstitute.json` file. See the [configuration](../Configuration.md) section for details on how to set this up.
The warning can also be suppressed programmatically for an assembly:
````c#
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Non virtual substitution", "NS1000:Non-virtual setup specification.", Justification = "Reviewed")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Non-substitutable member", "NS1000:Non-virtual setup specification.", Justification = "Reviewed")]
````

Or for a specific code block:
Expand Down
4 changes: 2 additions & 2 deletions documentation/rules/NS1001.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</tr>
<tr>
<td>Category</td>
<td>Non virtual substitution</td>
<td>Non-substitutable member</td>
</tr>
</table>

Expand All @@ -34,7 +34,7 @@ To fix a violation of this rule, make the member of your class virtual or substi
This warning can be suppressed by disabling the warning in the **ruleset** file for the project.
The warning can also be suppressed programmatically for an assembly:
````c#
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Non virtual substitution", "NS1001:Non-virtual setup specification.", Justification = "Reviewed")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Non-substitutable member", "NS1001:Non-virtual setup specification.", Justification = "Reviewed")]
````

Or for a specific code block:
Expand Down
4 changes: 2 additions & 2 deletions documentation/rules/NS1002.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</tr>
<tr>
<td>Category</td>
<td>Non virtual substitution</td>
<td>Non-substitutable member</td>
</tr>
</table>

Expand All @@ -32,7 +32,7 @@ To fix a violation of this rule, make the member of your class virtual or substi
This warning can be suppressed by disabling the warning in the **ruleset** file for the project.
The warning can also be suppressed programmatically for an assembly:
````c#
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Non virtual substitution", "NS1002:Non-virtual setup specification.", Justification = "Reviewed")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Non-substitutable member", "NS1002:Non-virtual setup specification.", Justification = "Reviewed")]
````

Or for a specific code block:
Expand Down
8 changes: 4 additions & 4 deletions documentation/rules/NS1003.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</tr>
<tr>
<td>Category</td>
<td>Non virtual substitution</td>
<td>Non-substitutable member</td>
</tr>
</table>

Expand Down Expand Up @@ -35,12 +35,12 @@ There are several ways to fix this:
This warning can be suppressed by disabling the warning in the **ruleset** file for the project.
The warning can also be suppressed programmatically for an assembly:
````c#
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Non virtual substitution", "NS1003:Non-virtual setup specification.", Justification = "Reviewed")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Non-substitutable member", "NS1003:Intdernal virtual setup specification.", Justification = "Reviewed")]
````

Or for a specific code block:
````c#
#pragma warning disable NS1003 // Non-virtual setup specification.
#pragma warning disable NS1003 // Internal virtual setup specification.
// the code which produces warning
#pragma warning restore NS1003 // Non-virtual setup specification.
#pragma warning restore NS1003 // Internal virtual setup specification.
````
2 changes: 1 addition & 1 deletion src/NSubstitute.Analyzers.Shared/DiagnosticCategories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
internal enum DiagnosticCategory
{
[DisplayName("Non virtual substitution")]
[DisplayName("Non-substitutable member")]
NonVirtualSubstitution = 1,

[DisplayName("Substitute creation")]
Expand Down

0 comments on commit eb0a081

Please sign in to comment.