Skip to content

Commit cbe14cc

Browse files
Joseph SunJosephSun2003
Joseph Sun
authored andcommitted
Revert refactorings caught by Geotab Analyzers
1 parent 98f1f75 commit cbe14cc

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/coverlet.console/Program.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int Main(string[] args)
3434
var verbosity = new Option<LogLevel>(new[] { "--verbosity", "-v" }, () => LogLevel.Normal, "Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed.") { Arity = ArgumentArity.ZeroOrOne };
3535
var formats = new Option<string[]>(new[] { "--format", "-f" }, () => new[] { "json" }, "Format of the generated coverage report.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
3636
var threshold = new Option<string>("--threshold", "Exits with error if the coverage % is below value.") { Arity = ArgumentArity.ZeroOrOne };
37-
Option<List<string>> thresholdTypes = new Option<List<string>>("--threshold-type", () => new List<string>(new string[] { "line", "branch", "method" }), "Coverage type to apply the threshold to.").FromAmong("line", "branch", "method");
37+
var thresholdTypes = new Option<List<string>>("--threshold-type", () => new List<string>(new string[] { "line", "branch", "method" }), "Coverage type to apply the threshold to.").FromAmong("line", "branch", "method");
3838
var thresholdStat = new Option<ThresholdStatistic>("--threshold-stat", () => ThresholdStatistic.Minimum, "Coverage statistic used to enforce the threshold value.") { Arity = ArgumentArity.ZeroOrOne };
3939
var excludeFilters = new Option<string[]>("--exclude", "Filter expressions to exclude specific modules and types.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
4040
var includeFilters = new Option<string[]>("--include", "Filter expressions to include only specific modules and types.") { Arity = ArgumentArity.ZeroOrMore, AllowMultipleArgumentsPerToken = true };
@@ -109,7 +109,7 @@ static int Main(string[] args)
109109
if (string.IsNullOrEmpty(moduleOrAppDirectoryValue) || string.IsNullOrWhiteSpace(moduleOrAppDirectoryValue))
110110
throw new ArgumentException("No test assembly or application directory specified.");
111111

112-
int taskStatus = await HandleCommand(moduleOrAppDirectoryValue,
112+
var taskStatus = await HandleCommand(moduleOrAppDirectoryValue,
113113
targetValue,
114114
targsValue,
115115
outputValue,

src/coverlet.core/Coverage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public CoveragePrepareResult PrepareModules()
108108
_parameters.IncludeFilters = _parameters.IncludeFilters?.Where(f => _instrumentationHelper.IsValidFilterExpression(f)).ToArray();
109109

110110
IReadOnlyList<string> validModules = _instrumentationHelper.SelectModules(modules, _parameters.IncludeFilters, _parameters.ExcludeFilters).ToList();
111-
foreach (string excludedModule in modules.Except(validModules))
111+
foreach (var excludedModule in modules.Except(validModules))
112112
{
113113
_logger.LogVerbose($"Excluded module: '{excludedModule}'");
114114
}

test/coverlet.integration.tests/DeterministicBuild.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private static void DeleteTestIntermediateFiles(string testResultsPath)
300300
{
301301
if (Directory.Exists(testResultsPath))
302302
{
303-
var hdDirectory = new DirectoryInfo(testResultsPath);
303+
DirectoryInfo hdDirectory = new DirectoryInfo(testResultsPath);
304304

305305
// search for directory "In" which has second copy e.g. '_fv-az365-374_2023-10-10_14_26_42\In\fv-az365-374\coverage.json'
306306
DirectoryInfo[] intermediateFolder = hdDirectory.GetDirectories("In", SearchOption.AllDirectories);
@@ -316,7 +316,7 @@ private static void DeleteLogFiles(string directory)
316316
{
317317
if (Directory.Exists(directory))
318318
{
319-
var hdDirectory = new DirectoryInfo(directory);
319+
DirectoryInfo hdDirectory = new DirectoryInfo(directory);
320320
FileInfo[] filesInDir = hdDirectory.GetFiles("log.*.txt");
321321

322322
foreach (FileInfo foundFile in filesInDir)
@@ -344,7 +344,7 @@ private static void DeleteCoverageFiles(string directory)
344344
{
345345
if (Directory.Exists(directory))
346346
{
347-
var hdDirectory = new DirectoryInfo(directory);
347+
DirectoryInfo hdDirectory = new DirectoryInfo(directory);
348348
FileInfo[] filesInDir = hdDirectory.GetFiles("coverage.cobertura.xml");
349349

350350
foreach (FileInfo foundFile in filesInDir)

test/coverlet.tests.projectsample.aspmvcrazor/Program.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright (c) Toni Solarin-Sodara
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
4+
var builder = WebApplication.CreateBuilder(args);
55

66
// Add services to the container.
77
builder.Services.AddRazorPages();
88

9-
WebApplication app = builder.Build();
9+
var app = builder.Build();
1010

1111
// Configure the HTTP request pipeline.
1212
if (!app.Environment.IsDevelopment())

0 commit comments

Comments
 (0)