当我指向我的解决方案时它运行正常,但分析所有测试项目和一些生成的文件.我想将它们排除在检查之外.文件说
If you want to configure InspectCode on a CI server, you can make all configurations locally with ReSharper.
出于各种原因,我现在无法安装ReSharper的演示版本. InspectCode.exe工具可以生成配置文件,但我不清楚如何手动编辑它以从分析中排除某些文件或项目.这是自动生成的XML文件:
<?xml version="1.0" encoding="utf-8"?> <InspectCodeOptions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <NoSolutionWideAnalysis>false</NoSolutionWideAnalysis> <IncludedProjects /> <SuppressBuildInSettings>false</SuppressBuildInSettings> <Debug>false</Debug> <Extensions /> <Properties /> <DumpIssuesTypes>false</DumpIssuesTypes> </InspectCodeOptions>
如何修改此XML文件以排除以“generated.cs”结尾的文件,或名称中带有“test”的任何文件或项目?
UPDATE
derigel:我明白我做错了什么.我已重置我的ReSharper配置并重新启动.现在我在设置中更改的是转到ReSharper→选项→代码检查→设置→编辑要跳过的项目.
我添加了一个文件掩码“test”.
点击保存到 – >; [SOLUTIONNAME]团队共享将其保存到我预期的文件中.但是配置文件现在看起来像这样:
<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:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002Atest_002A/@EntryIndexedValue">True</s:Boolean>
哪个InspectCode.exe不喜欢.如果我使用/config=FILENAME.DotSettings,它会给我这个错误:
文档描述了解决方案的设置,而不是工具本身.Failed to load options from file
D:\SVN\Development\branches\OpenSolutionClinicalID_v1.0_Development\src\OpenSolutionConnect.sln.DotSettings.
Caused b y: System.InvalidOperationException: There is an error in XML
document (1, 2). —> System.InvalidOperationException:
http://schemas.microsoft.com/winfx/2006/xaml/presentation’> was not
expected.
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderInspectCodeSettingsData.Read3_InspectCodeOptions()
— End of inner exception stack trace —
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader, String encodingStyle, XmlDeserializationEvents events)
at
JetBrains.CommandLine.Common.Options.OptionsUtils.DeserializeFromFile[T](FileSystemPath
pathToConfig)
例如,以下是生成文件的设置:Configuring Code Inspection Settings和此处关于排除文件:http://www.jetbrains.com/resharper/webhelp/Code_Analysis__Configuring_Warnings.html#d2375e201
更改它们并保存到解决方案共享级别后,将有文件< solutionname> .sln.dotsettings,这些将由命令行工具考虑.
虽然这是一个XML文件,但它并不是很容易编辑的.为什么不能安装ReSharper的试用实例并配置所需的全部内容?