Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:
- name: Restore tools
run: dotnet tool restore

- name: Build & Test
run: dotnet dotnet-coverage collect "dotnet test --project StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp${{matrix.testversion}}/StyleCop.Analyzers.Test.CSharp${{matrix.testversion}}.csproj -c ${{matrix.configuration}} --verbosity normal" --output TestResults/coverage.cobertura.xml --output-format cobertura --settings CodeCoverage.config
- name: Build
run: dotnet build -c ${{matrix.configuration}}

- name: Test
run: dotnet dotnet-coverage collect "dotnet test --no-build --project StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp${{matrix.testversion}}/StyleCop.Analyzers.Test.CSharp${{matrix.testversion}}.csproj -c ${{matrix.configuration}}" --output TestResults/coverage.cobertura.xml --output-format cobertura --settings CodeCoverage.config

- name: Upload coverage
uses: codecov/codecov-action@e53489f4d376d79066609109e7a95a29eb3740b1 # v7.0.0
Expand Down
8 changes: 8 additions & 0 deletions CodeCoverage.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@
<ModulePath>.*\.Testing\.dll$</ModulePath>
</Exclude>
</ModulePaths>
<Sources>
<Exclude>
<!-- Source-generated code is not hand-written, so covering it is not meaningful. The Lightup
wrappers and the resource accessors are emitted below Lightup\.generated, because the
analyzer project sets EmitCompilerGeneratedFiles. -->
<Source>.*\\\.generated\\.*</Source>
</Exclude>
</Sources>
</CodeCoverage>
</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp9\StyleCop.Analyzers.Test.CSharp9.csproj" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp10\StyleCop.Analyzers.Test.CSharp10.csproj" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp11\StyleCop.Analyzers.Test.CSharp11.csproj" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp12\StyleCop.Analyzers.Test.CSharp12.csproj" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp13\StyleCop.Analyzers.Test.CSharp13.csproj" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp14\StyleCop.Analyzers.Test.CSharp14.csproj" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace StyleCop.Analyzers.Test.CSharp6.Verifiers
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using global::LightJson;
Expand Down Expand Up @@ -103,16 +102,6 @@ internal class CSharpTest : CSharpCodeFixTest<TAnalyzer, TCodeFix, DefaultVerifi
private bool useTabs = DefaultUseTabs;
private int tabSize = DefaultTabSize;

static CSharpTest()
{
// If we have outdated defaults from the host unit test application targeting an older .NET Framework,
// use more reasonable TLS protocol version for outgoing connections.
if (ServicePointManager.SecurityProtocol == (SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls))
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}
}

public CSharpTest()
: this(languageVersion: null)
{
Expand Down Expand Up @@ -230,11 +219,6 @@ public int IndentationSize

set
{
if (this.indentationSize == value)
{
return;
}

this.indentationSize = value;
this.UpdateGlobalAnalyzerConfig();
}
Expand All @@ -256,11 +240,6 @@ public bool UseTabs

set
{
if (this.useTabs == value)
{
return;
}

this.useTabs = value;
this.UpdateGlobalAnalyzerConfig();
}
Expand All @@ -281,11 +260,6 @@ public int TabSize

set
{
if (this.tabSize == value)
{
return;
}

this.tabSize = value;
this.UpdateGlobalAnalyzerConfig();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp6\StyleCop.Analyzers.Test.CSharp6.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp7\StyleCop.Analyzers.Test.CSharp7.csproj" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ItemGroup>
<ProjectReference Include="..\StyleCop.Analyzers.Test.CSharp8\StyleCop.Analyzers.Test.CSharp8.csproj" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" SetTargetFramework="TargetFramework=netstandard2.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\StyleCop.Analyzers.PrivateCodeFixes\StyleCop.Analyzers.PrivateCodeFixes.csproj" PrivateAssets="all" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,16 @@
</ItemGroup>

<ItemGroup>
<!--
SkipGetTargetFrameworkProperties suppresses the netstandard1.1 -> netstandard2.0 compatibility
check for this build-time-only reference. SetTargetFramework="TargetFramework=netstandard2.0"
does that too, but it builds the generator in a different MSBuild configuration than a solution
build does, so "dotnet build" on the solution builds it twice into the same obj folder and the
two builds race each other (MSB3491).
-->
<ProjectReference
Include="..\StyleCop.Analyzers.CodeGeneration\StyleCop.Analyzers.CodeGeneration.csproj"
SetTargetFramework="TargetFramework=netstandard2.0"
SkipGetTargetFrameworkProperties="true"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
</ItemGroup>
Expand Down