[英]Visual Studio not ignoring generated code specified in editorConfig
I've got an project with code from an custom code generator that i wrote.我有一个项目,其中包含我编写的自定义代码生成器的代码。
The generated code is named something _gen.cs生成的代码被命名为东西_gen.cs
Although in the editorconfig i specified that all *_gen.cs files should be ignored, SonarLint still analyses the gen files.尽管在 editorconfig 中我指定应忽略所有 *_gen.cs 文件,但 SonarLint 仍会分析 gen 文件。
According to the SonarLint Documentation the Files shouldn't be analysed.根据SonarLint 文档,不应分析文件。
The .editorconfig looks like this .editorconfig 看起来像这样
root = true
[*_gen.cs]
exclude = true
generated_code = true
[*.cs]
#Spaces and indents
indent_style=space
indent_size=4
and so on...
The Project Layout Looks like this项目布局看起来像这样
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 doesn't understand name postfixes. EditorConfig 不理解名称后缀。 It is possible to define a file group with file extension ( *.gen
) or folder ( gen/*
).可以使用文件扩展名 ( *.gen
) 或文件夹 ( gen/*
) 定义文件组。
Documentation: https://editorconfig.org/#file-format-details .文档: https : //editorconfig.org/#file-format-details 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.