如何配置TeamCity以让ReSharper检查.editorconfig文件中设置的属性?

我们有一个TeamCity的本地实例(2019.1.5),我想利用在解决方案的.editorconfig文件中设置的ReSharper配置属性。

.editorconfig updates,more build options,better Roslyn support in Rider 2018.3 EAPIndex of EditorConfig properties之后,我有一个文件,当前包含以下内容:

# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
insert_final_newline = true

[*.cs]
indent_style = tab
trim_trailing_whitespace = true

# ReSharper custom properties
resharper_unknown_css_class_highlighting = false

但是,仅凭这本身还不足以让TeamCity来解决这个问题,因为在构建后我仍然看到“未知CSS类”检查。

Configuring inspection severities with EditorConfig建议如果我是在本地使用的,则可能必须在ReSharper中启用它(不是),所以我想知道是否必须在TeamCity中配置类似的设置。 / p>

如何让TeamCity检查.editorconfig的ReSharper设置?

响应ReSharper版本和共享设置

响应Dmitry的回答,因为它长于评论:

不幸的是,我们安装了JetBrains ReSharper命令行工具版本2019.2.1,将其设置为默认值,并且我已经验证了该项目正在使用它。 (如果重要,则已安装2017.1.20170428.83814,但不是默认值或未使用;我打算删除它。)

对于您的第二个解决方案,是否(和其他情况一样)记录了(我假设).sln.DotSettings的更改?由于我们还没有完整版本的ReSharper插件,因此我们尝试利用文档来手动更改.sln.DotSettings文件。

例如,通过该文件删除此文件的方法是使用此.sln.DotSettings文件:

<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnknownCssClass/@EntryIndexedValue">DO_NOT_SHOW</s:String>
</wpf:ResourceDictionary>
diankan2009 回答:如何配置TeamCity以让ReSharper检查.editorconfig文件中设置的属性?

简便方法:在TeamCity安装中升级到ReSharper命令行工具2019.2或更高版本。

硬方法:启用“从editorconfig和项目设置中读取严重性设置”并将其保存到解决方案共享设置中,然后将其添加到VCS中。

更新: 我自己测试过。请在.editorconfig中写none而不是false

resharper_unknown_css_class_highlighting = none

恐怕.dotSettings没有正确记录,因为它不是要用户编辑的文件格式。最好的选择是下载ReSharper或JetBrains Rider的试用版或EAP版本,如果决定走这条路,请使用它们进行必要的修改。

,

Dmitry的纠正editorconfig的解决方案是正确的,但是对于像我这样通过TeamCity和Reweak .dotSettings使用ReSharper的其他人,当前密钥如下:

<s:Boolean x:Key="/Default/CodeInspection/Highlighting/ReadSettingsFromFileLevel/@EntryValue">True</s:Boolean>
本文链接:https://www.f2er.com/3025969.html

大家都在问