当我将 SonarLint 集成到我的 VS 解决方案中时,我得到了一个 SonarLint.xml 文件引用。对于每个项目。我想知道,它是如何使用的?我可以删除这个引用吗?找不到任何相关文档。
最佳答案
When I integrated SonarLint into my VS solution, I got a SonarLint.xml file ref. for every project.
这是需要的并且是设计使然的。该文件包含 SonarLint 使用的代码质量规则参数。示例参数:
<Rule>
<Key>S103</Key>
<Parameters>
<Parameter>
<Key>maximumLineLength</Key>
<Value>200</Value>
当您从 SonarQube 绑定(bind)或更新解决方案时,主 SonarLint.xml 文件将下载到解决方案的 .sonarlint 文件夹中;并将该主文件的软链接(soft link)文件添加到正在分析的每个项目中。
(SonarLint NuGet 显然没有或无法访问主 SonarLint.xml 文件,因此它需要项目级 SonarLint.xml 软链接(soft link)文件。)
关于SonarLint.xml 添加到每个 VS 项目中?我在哪里可以读到相关内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68526089/