Skip to content

Commit bc974ab

Browse files
authored
note that suppression applies to code style rules too (#29797)
1 parent 2f05eac commit bc974ab

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

docs/fundamentals/code-analysis/code-quality-rule-options.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
---
22
title: Code quality rule configuration options
33
description: Learn how to specify additional configuration options for code quality rules.
4-
ms.date: 09/24/2020
4+
ms.date: 06/09/2022
55
no-loc: ["EditorConfig"]
66
---
77
# Code quality rule configuration options
88

99
The *code quality* rules have additional configuration options, besides just [configuring their severity](configuration-options.md#severity-level). For example, each code quality analyzer can be configured to only apply to specific parts of your codebase. You specify these options by adding key-value pairs to the same [EditorConfig](https://editorconfig.org) file where you specify rule severities and general editor preferences.
1010

11+
> [!NOTE]
12+
> This article does not detail how to configure a rule's severity. The *.editorconfig* option to set a rule's severity has a different prefix (`dotnet_diagnostic`) to the options described here (`dotnet_code_quality`). In addition, the options described here pertain to code quality rules only, whereas the severity option applies to code style rules as well. As a quick reference, you can configure a rule's severity using the following option syntax:
13+
>
14+
> ```ini
15+
> dotnet_diagnostic.<rule ID>.severity = <severity value>
16+
> ```
17+
>
18+
> However, for detailed information about configuring rule severity, see [Severity level](configuration-options.md#severity-level).
19+
1120
## Option scopes
1221
1322
Each refining option can be configured for all rules, for a category of rules (for example, Security or Design), or for a specific rule.

docs/fundamentals/code-analysis/suppress-warnings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Suppress code analysis warnings
33
description: Learn the different ways you can suppress .NET code analysis violations.
4-
ms.date: 01/28/2021
4+
ms.date: 06/09/2022
55
ms-topic: how-to
66
dev_langs:
77
- CSharp
@@ -12,7 +12,7 @@ helpviewer_keywords:
1212
---
1313
# How to suppress code analysis warnings
1414

15-
This article covers the various ways you can suppress warnings from code analysis when you build your .NET app.
15+
This article covers the various ways you can suppress warnings from code analysis when you build your .NET app. You can suppress code quality rules, code style rules, and third-party analyzer rules using the information provided here.
1616

1717
> [!TIP]
1818
> If you're using Visual Studio as your development environment, the *light bulb* menu provides options that generate the code to suppress warnings for you. For more information, see [Suppress violations](/visualstudio/code-quality/use-roslyn-analyzers?#suppress-violations).

0 commit comments

Comments
 (0)