Skip to content

Commit 3b4a659

Browse files
committed
fix warnings
1 parent b0170ef commit 3b4a659

File tree

14 files changed

+37
-29
lines changed

14 files changed

+37
-29
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<AnalysisLevel>preview</AnalysisLevel>
1414
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1515
<LangVersion>preview</LangVersion>
16-
<NoWarn>$(NoWarn);NU5105</NoWarn>
16+
<NoWarn>$(NoWarn);NU5105;CS1591</NoWarn>
1717
<RestoreSources>
1818
https://api.nuget.org/v3/index.json;
1919
</RestoreSources>

src/coverlet.collector/DataCollection/CoverageWrapper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ internal class CoverageWrapper : ICoverageWrapper
1717
/// </summary>
1818
/// <param name="settings">Coverlet settings</param>
1919
/// <param name="coverletLogger">Coverlet logger</param>
20+
/// <param name="instrumentationHelper"></param>
21+
/// <param name="fileSystem"></param>
22+
/// <param name="sourceRootTranslator"></param>
23+
/// <param name="cecilSymbolHelper"></param>
2024
/// <returns>Coverage object</returns>
2125
public Coverage CreateCoverage(CoverletSettings settings, ILogger coverletLogger, IInstrumentationHelper instrumentationHelper, IFileSystem fileSystem, ISourceRootTranslator sourceRootTranslator, ICecilSymbolHelper cecilSymbolHelper)
2226
{

src/coverlet.collector/coverlet.collector.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<AssemblyTitle>coverlet.collector</AssemblyTitle>
@@ -15,6 +15,7 @@
1515
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs</TargetsForTfmSpecificContentInPackage>
1616
<!-- Open issue https://github.com/NuGet/Home/issues/8941 -->
1717
<NoWarn>$(NoWarn);NU5127</NoWarn>
18+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1819
</PropertyGroup>
1920

2021
<!-- Nuget package properties https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets -->

src/coverlet.console/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ public static async Task<int> Main(string[] args)
5353
new Option<bool>("--use-source-link", "Specifies whether to use SourceLink URIs in place of file system paths.") { Arity = ArgumentArity.Zero },
5454
new Option<string[]>("--does-not-return-attribute", "Attributes that mark methods that do not return"){Arity = ArgumentArity.ZeroOrMore},
5555
new Option<string>("--exclude-assemblies-without-sources", "Specifies behaviour of heuristic to ignore assemblies with missing source documents."){ Arity = ArgumentArity.ZeroOrOne }
56-
}.WithHandler(nameof(HandleCommandAsync));
56+
}.WithHandler(nameof(HandleCommand));
5757

5858
root.Description = "Cross platform .NET Core code coverage tool";
5959
return await root.InvokeAsync(args);
6060
}
61-
private static async Task<int> HandleCommandAsync(string moduleOrAppDirectory,
61+
private static Task<int> HandleCommand(string moduleOrAppDirectory,
6262
string target,
6363
string targetargs,
6464
string output,
@@ -308,20 +308,20 @@ string excludeAssembliesWithoutSources
308308
throw new Exception(exceptionMessageBuilder.ToString());
309309
}
310310

311-
return exitCode;
311+
return Task.FromResult(exitCode);
312312

313313

314314
}
315315

316316
catch (Win32Exception we) when (we.Source == "System.Diagnostics.Process")
317317
{
318318
logger.LogError($"Start process '{target}' failed with '{we.Message}'");
319-
return exitCode > 0 ? exitCode : (int)CommandExitCodes.Exception;
319+
return Task.FromResult(exitCode > 0 ? exitCode : (int)CommandExitCodes.Exception);
320320
}
321321
catch (Exception ex)
322322
{
323323
logger.LogError(ex.Message);
324-
return exitCode > 0 ? exitCode : (int)CommandExitCodes.Exception;
324+
return Task.FromResult(exitCode > 0 ? exitCode : (int)CommandExitCodes.Exception);
325325
}
326326

327327
}

src/coverlet.core/Reporters/CoberturaReporter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System;
55
using System.Collections.Generic;
6-
using System.Diagnostics;
76
using System.Globalization;
87
using System.IO;
98
using System.Linq;

src/coverlet.core/coverlet.core.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
55
<TargetFramework>netstandard2.0</TargetFramework>
66
<IsPackable>false</IsPackable>
7+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
78
</PropertyGroup>
89

910
<ItemGroup>

src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
@@ -15,6 +15,7 @@
1515
If you are packing with NuGet's MSBuild Pack target, you can set <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> in any PropertyGroup in your project file.
1616
-->
1717
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
18+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1819
</PropertyGroup>
1920

2021
<!-- Nuget package properties https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets -->

test/coverlet.collector.tests/coverlet.collector.tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="$(RepoRoot)src\coverlet.msbuild.tasks\coverlet.msbuild.props" />
33

44
<PropertyGroup>
55
<TargetFramework>net6.0</TargetFramework>
66
<IsPackable>false</IsPackable>
7+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
78
</PropertyGroup>
89

910
<ItemGroup>

test/coverlet.core.tests/Helpers/InstrumentationHelperTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Xunit;
77
using System.Collections.Generic;
88
using System.Linq;
9-
using Castle.Core.Internal;
109
using Moq;
1110
using Coverlet.Core.Abstractions;
1211
using Coverlet.Core.Enums;

test/coverlet.core.tests/Instrumentation/ModuleTrackerTemplateTests.cs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,24 @@ public void MutexBlocksMultipleWriters()
123123
FunctionExecutor.Run(async () =>
124124
{
125125
using var ctx = new TrackerContext();
126-
using (var mutex = new Mutex(
127-
true, Path.GetFileNameWithoutExtension(ModuleTrackerTemplate.HitsFilePath) + "_Mutex", out bool createdNew))
128-
{
129-
Assert.True(createdNew);
126+
using var mutex = new Mutex(
127+
true, Path.GetFileNameWithoutExtension(ModuleTrackerTemplate.HitsFilePath) + "_Mutex", out bool createdNew);
128+
Assert.True(createdNew);
130129

131-
ModuleTrackerTemplate.HitsArray = new[] { 0, 1, 2, 3 };
132-
var unloadTask = Task.Run(() => ModuleTrackerTemplate.UnloadModule(null, null));
130+
ModuleTrackerTemplate.HitsArray = new[] { 0, 1, 2, 3 };
131+
var unloadTask = Task.Run(() => ModuleTrackerTemplate.UnloadModule(null, null));
133132

134-
Assert.False(unloadTask.Wait(5));
133+
Assert.False(unloadTask.Wait(5));
135134

136-
WriteHitsFile(new[] { 0, 3, 2, 1 });
135+
WriteHitsFile(new[] { 0, 3, 2, 1 });
137136

138-
Assert.False(unloadTask.Wait(5));
137+
Assert.False(unloadTask.Wait(5));
139138

140-
mutex.ReleaseMutex();
141-
await unloadTask;
139+
mutex.ReleaseMutex();
140+
await unloadTask;
142141

143-
int[] expectedHitsArray = new[] { 0, 4, 4, 4 };
144-
Assert.Equal(expectedHitsArray, ReadHitsFile());
145-
}
142+
int[] expectedHitsArray = new[] { 0, 4, 4, 4 };
143+
Assert.Equal(expectedHitsArray, ReadHitsFile());
146144

147145
return 0;
148146
});

0 commit comments

Comments
 (0)