Enforce code style only on correctness leg

This changes the code style analyzers so that they only execute on the
build correctness leg. This means that even in the face of style errors
our build will be covered via this leg but we will also get test run
output as the other legs won't hit the style errors.
上级 25a63eee
......@@ -35,6 +35,7 @@
<RoslynPortableTargetFrameworks>net472;netcoreapp2.1</RoslynPortableTargetFrameworks>
<RoslynPortableRuntimeIdentifiers>win;win-x64;linux-x64;osx-x64</RoslynPortableRuntimeIdentifiers>
<RoslynEnforceCodeStyle Condition="'$(ContinuousIntegrationBuild)' != 'true'">true</RoslynEnforceCodeStyle>
<UseSharedCompilation>true</UseSharedCompilation>
<Features>strict, IOperation</Features>
......@@ -146,13 +147,13 @@
<!-- Language-specific analyzer packages -->
<Choose>
<When Condition="'$(Language)' == 'VB'">
<When Condition="'$(Language)' == 'VB' and '$(RoslynEnforceCodeStyle)' == 'true'">
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.CodeStyle" Version="$(MicrosoftCodeAnalysisVisualBasicCodeStyleVersion)" PrivateAssets="all" />
</ItemGroup>
</When>
<When Condition="'$(Language)' == 'C#'">
<When Condition="'$(Language)' == 'C#' and '$(RoslynEnforceCodeStyle)' == 'true'">
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="$(MicrosoftCodeAnalysisCSharpCodeStyleVersion)" PrivateAssets="all" />
</ItemGroup>
......
......@@ -34,7 +34,7 @@ try {
Push-Location $RepoRoot
Write-Host "Building Roslyn"
Exec-Block { & (Join-Path $PSScriptRoot "build.ps1") -restore -build -ci:$ci -configuration:$configuration -pack -binaryLog -useGlobalNuGetCache:$false }
Exec-Block { & (Join-Path $PSScriptRoot "build.ps1") -restore -build -ci:$ci -configuration:$configuration -pack -binaryLog -useGlobalNuGetCache:$false -properties "/p:RoslynEnforceCodeStyle=true"}
# Verify the state of our various build artifacts
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册