Cleanup extra qualification. Cleanup redundant casting. Cleanup usings. Set var suggestion to none.

This commit is contained in:
Michael Yanni 2023-11-10 17:23:47 -08:00
parent 67cbc0dd65
commit c42fb4c641
46 changed files with 11 additions and 114 deletions

View file

@ -41,7 +41,7 @@ dotnet_style_qualification_for_event = false:suggestion
# only use var when it's obvious what the variable type is # only use var when it's obvious what the variable type is
csharp_style_var_for_built_in_types = false:none csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = false:none csharp_style_var_when_type_is_apparent = false:none
csharp_style_var_elsewhere = false:suggestion csharp_style_var_elsewhere = false:none
# use language keywords instead of BCL types # use language keywords instead of BCL types
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion

View file

@ -6,7 +6,6 @@ using System.Collections.Generic;
using Microsoft.Build.Utilities; using Microsoft.Build.Utilities;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;
using System.IO; using System.IO;
using System.Linq;
using System.Text; using System.Text;
using Newtonsoft.Json; using Newtonsoft.Json;

View file

@ -1,10 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;
using Microsoft.Build.Utilities; using Microsoft.Build.Utilities;

View file

@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information. // See the LICENSE file in the project root for more information.
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;
@ -63,7 +62,7 @@ namespace Microsoft.DotNet.Build.Tasks
if (toolResult) if (toolResult)
{ {
var files = System.IO.Directory.GetFiles(Path.GetDirectoryName(TempOutputPath)); var files = Directory.GetFiles(Path.GetDirectoryName(TempOutputPath));
var dest = Path.GetDirectoryName(DestinationPath); var dest = Path.GetDirectoryName(DestinationPath);
// Copy both dll and pdb files to the destination folder // Copy both dll and pdb files to the destination folder
foreach(var file in files) foreach(var file in files)
@ -168,6 +167,6 @@ namespace Microsoft.DotNet.Build.Tasks
private string GetMissingDependenciesOk() => "-MissingDependenciesOK"; private string GetMissingDependenciesOk() => "-MissingDependenciesOK";
protected override void LogToolCommand(string message) => base.LogToolCommand($"{base.GetWorkingDirectory()}> {message}"); protected override void LogToolCommand(string message) => base.LogToolCommand($"{GetWorkingDirectory()}> {message}");
} }
} }

View file

@ -36,7 +36,7 @@ namespace Microsoft.DotNet.Cli.Build
public IEnumerable<string> GetEnvironmentVariableNamesToRemove() public IEnumerable<string> GetEnvironmentVariableNamesToRemove()
{ {
var allEnvironmentVariableNames = (IEnumerable<string>)Environment var allEnvironmentVariableNames = Environment
.GetEnvironmentVariables() .GetEnvironmentVariables()
.Keys .Keys
.Cast<string>(); .Cast<string>();

View file

@ -3,8 +3,6 @@
using System; using System;
using System.Security.Cryptography; using System.Security.Cryptography;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Microsoft.DotNet.Cli.Build namespace Microsoft.DotNet.Cli.Build
{ {

View file

@ -1,11 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;
using Microsoft.Build.Utilities; using Microsoft.Build.Utilities;
using NuGet.RuntimeModel; using NuGet.RuntimeModel;

View file

@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System; using System;
using System.IO;
using System.Linq; using System.Linq;
using System.Xml.Linq; using System.Xml.Linq;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;

View file

@ -1,14 +1,8 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;
using Microsoft.Build.Utilities; using Microsoft.Build.Utilities;
using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.Cli.Build namespace Microsoft.DotNet.Cli.Build
{ {

View file

@ -1,11 +1,8 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;
using Microsoft.Build.Utilities; using Microsoft.Build.Utilities;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;

View file

@ -131,6 +131,6 @@ namespace Microsoft.DotNet.Build.Tasks
return excludes; return excludes;
} }
protected override void LogToolCommand(string message) => base.LogToolCommand($"{base.GetWorkingDirectory()}> {message}"); protected override void LogToolCommand(string message) => base.LogToolCommand($"{GetWorkingDirectory()}> {message}");
} }
} }

View file

@ -1,10 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using Microsoft.Build.Framework; using Microsoft.Build.Framework;
using Microsoft.Build.Utilities; using Microsoft.Build.Utilities;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;

View file

@ -10,10 +10,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<FrameworkReference Update="Microsoft.NETCore.App" <FrameworkReference Update="Microsoft.NETCore.App" TargetingPackVersion="$(MicrosoftNETCoreAppRefPackageVersion)" RuntimeFrameworkVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)" />
TargetingPackVersion="$(MicrosoftNETCoreAppRefPackageVersion)"
RuntimeFrameworkVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
/>
<ProjectReference Include="..\SdkResolver\SdkResolver.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuildFromSource)' != 'true'" /> <ProjectReference Include="..\SdkResolver\SdkResolver.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<ProjectReference Include="..\VSTemplateLocator\VSTemplateLocator.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuildFromSource)' != 'true'" /> <ProjectReference Include="..\VSTemplateLocator\VSTemplateLocator.csproj" ReferenceOutputAssembly="false" Condition="'$(DotNetBuildFromSource)' != 'true'" />

View file

@ -1,6 +1,5 @@
using FluentAssertions; using FluentAssertions;
using Microsoft.DotNet.Tools.Test.Utilities; using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
namespace EndToEnd namespace EndToEnd
{ {

View file

@ -1,10 +1,7 @@
using FluentAssertions; using FluentAssertions;
using Microsoft.DotNet.TestFramework; using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities; using Microsoft.DotNet.Tools.Test.Utilities;
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text;
namespace EndToEnd namespace EndToEnd
{ {

View file

@ -1,7 +1,3 @@
using System;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Microsoft.DotNet.TestFramework; using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities; using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit; using Xunit;

View file

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO; using System.IO;
using System.Xml.Linq; using System.Xml.Linq;
using EndToEnd; using EndToEnd;

View file

@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text;
using System.Xml.Linq; using System.Xml.Linq;
using Microsoft.DotNet.TestFramework; using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities; using Microsoft.DotNet.Tools.Test.Utilities;

View file

@ -1,9 +1,6 @@
using System; using System.IO;
using System.IO;
using System.Linq; using System.Linq;
using System.Xml.Linq;
using FluentAssertions; using FluentAssertions;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities; using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit; using Xunit;

View file

@ -3,12 +3,10 @@
using FluentAssertions; using FluentAssertions;
using FluentAssertions.Execution; using FluentAssertions.Execution;
using Microsoft.DotNet.Cli.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -1,11 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -3,12 +3,7 @@
using FluentAssertions; using FluentAssertions;
using FluentAssertions.Execution; using FluentAssertions.Execution;
using Microsoft.DotNet.Cli.Utils;
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -2,10 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -2,9 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using NuGet.Common; using NuGet.Common;

View file

@ -2,10 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using FluentAssertions; using FluentAssertions;
using FluentAssertions.Execution; using FluentAssertions.Execution;
using FluentAssertions.Primitives; using FluentAssertions.Primitives;

View file

@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public override CommandResult Execute(string args = "") public override CommandResult Execute(string args = "")
{ {
args = $"add {_projectName} reference {args}"; args = $"add {_projectName} reference {args}";
return base.ExecuteWithCapturedOutput(args); return ExecuteWithCapturedOutput(args);
} }
public AddReferenceCommand WithProject(string projectName) public AddReferenceCommand WithProject(string projectName)

View file

@ -1,9 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using System.Runtime.InteropServices;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -1,9 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using System.Runtime.InteropServices;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {
public class DotnetCommand : TestCommand public class DotnetCommand : TestCommand

View file

@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public override CommandResult Execute(string args = "") public override CommandResult Execute(string args = "")
{ {
args = $"list {_path} package {args}"; args = $"list {_path} package {args}";
return base.ExecuteWithCapturedOutput(args); return ExecuteWithCapturedOutput(args);
} }
public ListPackageCommand WithPath(string path) public ListPackageCommand WithPath(string path)

View file

@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public override CommandResult Execute(string args = "") public override CommandResult Execute(string args = "")
{ {
args = $"list {_projectName} reference {args}"; args = $"list {_projectName} reference {args}";
return base.ExecuteWithCapturedOutput(args); return ExecuteWithCapturedOutput(args);
} }
public ListReferenceCommand WithProject(string projectName) public ListReferenceCommand WithProject(string projectName)

View file

@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using Xunit;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities

View file

@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public override CommandResult Execute(string args = "") public override CommandResult Execute(string args = "")
{ {
args = $"remove {_projectName} reference {args}"; args = $"remove {_projectName} reference {args}";
return base.ExecuteWithCapturedOutput(args); return ExecuteWithCapturedOutput(args);
} }
public RemoveReferenceCommand WithProject(string projectName) public RemoveReferenceCommand WithProject(string projectName)

View file

@ -1,9 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using System.Runtime.InteropServices;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -6,9 +6,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities

View file

@ -1,13 +1,8 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.Cli.Utils;
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities namespace Microsoft.DotNet.Tools.Test.Utilities
{ {

View file

@ -1,7 +1,5 @@
using NuGet.Frameworks; using NuGet.Frameworks;
using System; using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.DotNet.Tools.Tests.Utilities namespace Microsoft.DotNet.Tools.Tests.Utilities
{ {

View file

@ -4,7 +4,6 @@
using System; using System;
using System.Text.Json; using System.Text.Json;
using System.IO; using System.IO;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.TestFramework namespace Microsoft.DotNet.TestFramework
{ {

View file

@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System; using System;
using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;

View file

@ -4,11 +4,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text; using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq; using System.Xml.Linq;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Common; using Microsoft.DotNet.Tools.Common;

View file

@ -1,13 +1,8 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.TestFramework namespace Microsoft.DotNet.TestFramework
{ {

View file

@ -1,14 +1,6 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.TestFramework namespace Microsoft.DotNet.TestFramework
{ {
public class TestAssetKinds public class TestAssetKinds

View file

@ -2,12 +2,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.TestFramework namespace Microsoft.DotNet.TestFramework
{ {

View file

@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.TestFramework; using Microsoft.DotNet.TestFramework;