简体   繁体   English

Visual Studio 不忽略 editorConfig 中指定的生成代码

[英]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.

相关问题 在Visual Studio中生成的中间代码 - Intermediate code generated in visual studio 生成文件的 Visual Studio 代码分析 - Visual studio code analysis for generated files Visual Studio:生成代码的自动文档 - Visual Studio: auto documentation for generated code OpenXML生成的代码冻结了Visual Studio - OpenXML Generated Code freezing Visual Studio 有没有办法在 entrie 解决方案上应用 Visual Studio 2022 中的 in.editorconfig 中的规则? - Is there a way to apply the rules in .editorconfig in Visual Studio 2022 on the entrie solution? editorConfig 命名约定不起作用 c# Visual Studio 2019 16.4.2 - editorConfig Naming Convention not working c# visual studio 2019 16.4.2 .editorconfig是否在Visual Studio中具有逻辑运算符之间的间距设置? - Does .editorconfig have a setting for spacing around logical operators in Visual Studio? Visual Studio 2019:如何在.editorconfig 中禁用特定的 CodeAnalysis 消息? - Visual Studio 2019: how to disable specific CodeAnalysis messages in .editorconfig? 在.editorconfig (Visual Studio 2019) 中配置缺少 xml 注释的警告 - Configure warnings for mising xml comments in .editorconfig (Visual Studio 2019) Visual Studio 未显示编辑器配置中添加的规则的警告 - Visual Studio isn't showing warnings for rules added in editorconfig
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM