Skip to content

Commit 1cda48f

Browse files
Remove dotnet_style_namespace_match_folder from IDE0055 (#34198)
1 parent e2fa772 commit 1cda48f

File tree

3 files changed

+7
-67
lines changed

3 files changed

+7
-67
lines changed

docs/fundamentals/code-analysis/style-rules/dotnet-formatting-options.md

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -81,67 +81,6 @@ using System.Threading.Tasks;
8181
using Octokit;
8282
```
8383

84-
## Dotnet namespace options
85-
86-
This category contains one formatting option that concerns how namespaces are named in both C# and Visual Basic.
87-
88-
- [dotnet\_style\_namespace\_match\_folder](#dotnet_style_namespace_match_folder)
89-
90-
Example *.editorconfig* file:
91-
92-
```ini
93-
# .NET namespace rules
94-
[*.{cs,vb}]
95-
dotnet_style_namespace_match_folder = true
96-
```
97-
98-
### dotnet\_style\_namespace\_match\_folder
99-
100-
| Property | Value | Description |
101-
|--------------------------|-------------------------------------|----------------------------------------------------------------|
102-
| **Option name** | dotnet_style_namespace_match_folder | |
103-
| **Applicable languages** | C# and Visual Basic | |
104-
| **Introduced version** | Visual Studio 2019 version 16.10 | |
105-
| **Option values** | `true` | Match namespaces to folder structure |
106-
| | `false` | Do not report on namespaces that do not match folder structure |
107-
| **Default value** | `true` | |
108-
109-
Code examples:
110-
111-
```csharp
112-
// dotnet_style_namespace_match_folder = true
113-
// file path: Example/Convention/C.cs
114-
using System;
115-
116-
namespace Example.Convention
117-
{
118-
class C
119-
{
120-
}
121-
}
122-
123-
// dotnet_style_namespace_match_folder = false
124-
// file path: Example/Convention/C.cs
125-
using System;
126-
127-
namespace Example
128-
{
129-
class C
130-
{
131-
}
132-
}
133-
```
134-
135-
> [!NOTE]
136-
> `dotnet_style_namespace_match_folder` requires the analyzer to have access to project properties to function correctly. For projects that target .NET Core 3.1 or an earlier version, you must manually add the following items to your project file. (They're added automatically for .NET 5 and later.)
137-
>
138-
> ```xml
139-
> <ItemGroup>
140-
> <CompilerVisibleProperty Include="RootNamespace" />
141-
> <CompilerVisibleProperty Include="ProjectDir" />
142-
> </ItemGroup>
143-
> ```
144-
14584
## See also
14685

14786
- [Formatting rule (IDE0055)](ide0055.md)

docs/fundamentals/code-analysis/style-rules/ide0130.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ Options specify the behavior that you want the rule to enforce. For information
4444
| **Default option value** | `true` | |
4545

4646
> [!NOTE]
47-
> The `dotnet_style_namespace_match_folder` option depends on knowing the current project and root namespace properties. This information is provided by Visual Studio but is not available for command-line builds, such as `dotnet build`. For command-line builds to work, you must add the following properties to your *.editorconfig* file and replace the root directory and namespace placeholders with your values:
47+
> The `dotnet_style_namespace_match_folder` option depends on knowing the current project and root namespace properties. This information is provided by Visual Studio but is not available for command-line builds, such as `dotnet build`. For command-line builds to work, you must add the following properties to your project file:
4848
>
49-
> ```ini
50-
> is_global=true
51-
> build_property.ProjectDir = <root directory>
52-
> build_property.RootNamespace = <root namespace>
49+
> ```xml
50+
> <ItemGroup>
51+
> <CompilerVisibleProperty Include="RootNamespace" />
52+
> <CompilerVisibleProperty Include="ProjectDir" />
53+
> </ItemGroup>
5354
> ```
5455
5556
## Example

docs/fundamentals/code-analysis/style-rules/language-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The style rules in this section are applicable to both C# and Visual Basic.
7676
- [Use null propagation (IDE0031)](ide0031.md)
7777
- [Use 'is null' check (IDE0041)](ide0041.md)
7878
- [File header preferences](ide0073.md)
79-
- [Namespace naming preferences](ide0130.md)
79+
- [Namespace naming preferences (IDE0130)](ide0130.md)
8080

8181
## C# style rules
8282

0 commit comments

Comments
 (0)