C# Visual Studio不忽略在editorConfig中指定的生成代码
我有一个项目,其中的代码来自我编写的自定义代码生成器。C# Visual Studio不忽略在editorConfig中指定的生成代码,c#,visual-studio,sonarlint,editorconfig,C#,Visual Studio,Sonarlint,Editorconfig,我有一个项目,其中的代码来自我编写的自定义代码生成器。 生成的代码名为\u gen.cs 尽管在编辑器配置中我指定应忽略所有*_gen.cs文件,SonarLint仍然分析gen文件 根据法律规定,这些文件不应该被分析 .editorconfig看起来像这样 root = true [*_gen.cs] exclude = true generated_code = true [*.cs] #Spaces and indents indent_style=space indent_size=4
生成的代码名为\u gen.cs
尽管在编辑器配置中我指定应忽略所有*_gen.cs文件,SonarLint仍然分析gen文件 根据法律规定,这些文件不应该被分析 .editorconfig看起来像这样
root = true
[*_gen.cs]
exclude = true
generated_code = true
[*.cs]
#Spaces and indents
indent_style=space
indent_size=4
and so on...
Project Root
|-Project.sln
|-.editorconfig
|Module A
|-codeA.cs
|-codeB.cs
|-code_gen.cs
|-ModuleA.csproj
|Module B
|-codeA.cs
|-codeB.cs
|-code_gen.cs
|-ModuleB.csproj
项目布局如下所示
root = true
[*_gen.cs]
exclude = true
generated_code = true
[*.cs]
#Spaces and indents
indent_style=space
indent_size=4
and so on...
Project Root
|-Project.sln
|-.editorconfig
|Module A
|-codeA.cs
|-codeB.cs
|-code_gen.cs
|-ModuleA.csproj
|Module B
|-codeA.cs
|-codeB.cs
|-code_gen.cs
|-ModuleB.csproj
EditorConfig不理解名称后缀。可以使用文件扩展名(
*.gen
)或文件夹(gen/*
)定义文件组
文档: