Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Visual Studio不忽略在editorConfig中指定的生成代码_C#_Visual Studio_Sonarlint_Editorconfig - Fatal编程技术网

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/*
)定义文件组

文档: