|
8 | 8 | </PropertyGroup>
|
9 | 9 | -->
|
10 | 10 |
|
11 |
| - <!-- Analyzers-related configuration --> |
12 | 11 | <PropertyGroup>
|
13 |
| - <RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis> |
14 | 12 | <SolutionDir Condition="'$(SolutionDir)'==''">$(MSBuildThisFileDirectory)</SolutionDir>
|
15 |
| - <CodeAnalysisRuleSet>$(SolutionDir)\CodeAnalysis.ruleset</CodeAnalysisRuleSet> |
16 | 13 | </PropertyGroup>
|
17 | 14 |
|
18 |
| - <!-- StyleCop Analyzer-related configuration --> |
19 |
| - <PropertyGroup Condition="Exists('$(SolutionDir)\CodeAnalysis.ruleset') And '$(BuildingInsideVisualStudio)' == 'true'"> |
20 |
| - <StyleCopTreatErrorsAsWarnings>True</StyleCopTreatErrorsAsWarnings> |
| 15 | + <!-- Documentation-related settings --> |
| 16 | + <PropertyGroup> |
| 17 | + <!-- |
| 18 | + Make sure any documentation comments which are included in code get checked for syntax during the build, but do |
| 19 | + not report warnings for missing comments. |
| 20 | +
|
| 21 | + CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do) |
| 22 | + CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' |
| 23 | + --> |
| 24 | + <NoWarn>$(NoWarn),1573,1591,1712</NoWarn> |
21 | 25 | </PropertyGroup>
|
22 |
| - <ItemGroup Condition="Exists('$(SolutionDir)\stylecop.json') And '$(BuildingInsideVisualStudio)' == 'true'"> |
23 |
| - <AdditionalFiles Include="$(SolutionDir)\stylecop.json" /> |
| 26 | + |
| 27 | + <!-- Analyzers-related configuration --> |
| 28 | + <PropertyGroup> |
| 29 | + <RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild> |
| 30 | + <RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis> |
| 31 | + <StyleCopTreatErrorsAsWarnings>true</StyleCopTreatErrorsAsWarnings> |
| 32 | + <CodeAnalysisRuleSet Condition="Exists('$(SolutionDir)\stylecop.ruleset')" >$(SolutionDir)\stylecop.ruleset</CodeAnalysisRuleSet> |
| 33 | + </PropertyGroup> |
| 34 | + |
| 35 | + <ItemGroup> |
| 36 | + <!-- StyleCop Analyzer-related configuration --> |
| 37 | + <AdditionalFiles Include="$(SolutionDir)\stylecop.json" Condition="Exists('$(SolutionDir)\stylecop.json')" /> |
24 | 38 | <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.*">
|
25 | 39 | <PrivateAssets>all</PrivateAssets>
|
26 | 40 | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
27 | 41 | </PackageReference>
|
28 | 42 | <None Remove="**\*.Cache" />
|
29 |
| - </ItemGroup> |
30 | 43 |
|
31 |
| - <!-- FxCop Analyzer-related configuration --> |
32 |
| - <ItemGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'"> |
| 44 | + <!-- FxCop Analyzer-related configuration --> |
33 | 45 | <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0-beta*">
|
34 | 46 | <PrivateAssets>all</PrivateAssets>
|
35 | 47 | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
36 | 48 | </PackageReference>
|
37 |
| - </ItemGroup> |
38 | 49 |
|
39 |
| - <!-- CodeCracker Analyzer-related configuration --> |
40 |
| - <ItemGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'"> |
| 50 | + <!-- CodeCracker Analyzer-related configuration --> |
41 | 51 | <PackageReference Include="codecracker.CSharp" Version="1.1.*">
|
42 | 52 | <PrivateAssets>all</PrivateAssets>
|
43 | 53 | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
44 | 54 | </PackageReference>
|
45 |
| - </ItemGroup> |
46 | 55 |
|
47 |
| - <!-- Sonar Analyzer-related configuration --> |
48 |
| - <ItemGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'"> |
| 56 | + <!-- Sonar Analyzer-related configuration --> |
49 | 57 | <PackageReference Include="SonarAnalyzer.CSharp" Version="8.6.*">
|
50 | 58 | <PrivateAssets>all</PrivateAssets>
|
51 | 59 | <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
52 | 60 | </PackageReference>
|
53 | 61 | </ItemGroup>
|
54 | 62 |
|
| 63 | + <!-- |
| 64 | + Disable analyzers when building a project inside Visual Studio. |
| 65 | + Note that analyzer behavior for IntelliSense purposes is not altered by this. |
| 66 | + --> |
| 67 | + <Target Name="DisableAnalyzersForVisualStudioBuild" BeforeTargets="CoreCompile" |
| 68 | + Condition="'$(BuildingInsideVisualStudio)' == 'true' And '$(BuildingProject)' == 'true' And '$(Configuration)' == 'Debug'"> |
| 69 | + <ItemGroup> |
| 70 | + <Analyzer Remove="@(Analyzer)"/> |
| 71 | + </ItemGroup> |
| 72 | + </Target> |
| 73 | + |
55 | 74 | </Project>
|
0 commit comments