Skip to content

Commit 2b6e360

Browse files
authored
Merge pull request #5716 from Evangelink/missing-api-surface-doc
Add Configurability - Api Surface section
2 parents e5a8038 + 18d40b0 commit 2b6e360

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed

docs/code-quality/ca1002.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ To fix a violation of this rule, change the <xref:System.Collections.Generic.Lis
4949

5050
Do not suppress a warning from this rule unless the assembly that raises this warning is not meant to be a reusable library. For example, it would be safe to suppress this warning in a performance-tuned application where a performance benefit was gained from the use of generic lists.
5151

52+
## Configurability
53+
54+
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
55+
56+
```ini
57+
dotnet_code_quality.ca1002.api_surface = private, internal
58+
```
59+
60+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
61+
5262
## Related rules
5363

5464
[CA1005: Avoid excessive parameters on generic types](../code-quality/ca1005.md)

docs/code-quality/ca1046.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ b and a are == ? No
5555
c and a are == ? Yes
5656
```
5757

58+
## Configurability
59+
60+
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
61+
62+
```ini
63+
dotnet_code_quality.ca1046.api_surface = private, internal
64+
```
65+
66+
You can configure this option for just this rule, for all rules, or for all rules in this category (Design). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
67+
5868
## Related rules
5969

6070
[CA1013: Overload operator equals on overloading add and subtract](../code-quality/ca1013.md)

docs/code-quality/ca1700.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ To fix a violation of this rule, remove or rename the member.
4949

5050
It is safe to suppress a warning from this rule for a member that is currently used or for libraries that have previously shipped.
5151

52+
## Configurability
53+
54+
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
55+
56+
```ini
57+
dotnet_code_quality.ca1700.api_surface = private, internal
58+
```
59+
60+
You can configure this option for just this rule, for all rules, or for all rules in this category (Naming). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
61+
5262
## Related rules
5363

5464
[CA2217: Do not mark enums with FlagsAttribute](../code-quality/ca2217.md)

docs/code-quality/ca1707.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ Do not suppress warnings for production code. However, it's safe to suppress thi
4343

4444
For well-known methods in Microsoft code that currently use an underscore and cannot be modified, the rule should be suppressed.
4545

46+
## Configurability
47+
48+
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
49+
50+
```ini
51+
dotnet_code_quality.ca1707.api_surface = private, internal
52+
```
53+
54+
You can configure this option for just this rule, for all rules, or for all rules in this category (Naming). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
55+
4656
## Related rules
4757

4858
- [CA1709: Identifiers should be cased correctly](../code-quality/ca1709.md)

docs/code-quality/ca1822.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ Mark the member as static (or Shared in [!INCLUDE[vbprvb](../code-quality/includ
3535
## When to suppress warnings
3636
It is safe to suppress a warning from this rule for previously shipped code for which the fix would be a breaking change.
3737

38+
## Configurability
39+
40+
If you're running this rule from [FxCop analyzers](install-fxcop-analyzers.md) (and not with legacy analysis), you can configure which parts of your codebase to run this rule on, based on their accessibility. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
41+
42+
```ini
43+
dotnet_code_quality.ca1822.api_surface = private, internal
44+
```
45+
46+
You can configure this option for just this rule, for all rules, or for all rules in this category (Performance). For more information, see [Configure FxCop analyzers](configure-fxcop-analyzers.md).
47+
3848
## Related rules
3949
[CA1811: Avoid uncalled private code](../code-quality/ca1811.md)
4050

0 commit comments

Comments
 (0)