diff --git a/.editorconfig b/.editorconfig index b58f07026d..4ff8fa2a36 100644 --- a/.editorconfig +++ b/.editorconfig @@ -112,7 +112,9 @@ dotnet_diagnostic.IDE0032.severity = warning # not default, set in accord dotnet_style_readonly_field = true:warning # Parameter preferences -dotnet_code_quality_unused_parameters = all:suggestion +dotnet_code_quality_unused_parameters = all:warning +# IDE0060: Remove unused parameter +dotnet_diagnostic.IDE0060.severity = warning # Suppression preferences dotnet_remove_unnecessary_suppression_exclusions = none diff --git a/playground/TestPlatform.Playground/Program.cs b/playground/TestPlatform.Playground/Program.cs index 0732a347c8..4026e65d0e 100644 --- a/playground/TestPlatform.Playground/Program.cs +++ b/playground/TestPlatform.Playground/Program.cs @@ -20,7 +20,7 @@ namespace TestPlatform.Playground; internal class Program { - static void Main(string[] args) + static void Main() { // This project references TranslationLayer, vstest.console, TestHostProvider, testhost and MSTest1 projects, to make sure // we build all the dependencies of that are used to run tests via VSTestConsoleWrapper. It then copies the components from diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs index 6530060db7..ed724bc1fe 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs @@ -771,7 +771,9 @@ private static ICommunicationEndPoint SetCommunicationEndPoint(TestHostConnectio internal class MessageConverter { +#pragma warning disable IDE0060 // Remove unused parameter // TODO: Use or remove this parameter and the associated method internal static AttachDebuggerInfo ConvertToAttachDebuggerInfo(TestProcessAttachDebuggerPayload attachDebuggerPayload, Message message, int protocolVersion) +#pragma warning restore IDE0060 // Remove unused parameter { // There is nothing to do differently based on those versions. //var sourceVersion = GetVersion(message); @@ -784,8 +786,8 @@ internal static AttachDebuggerInfo ConvertToAttachDebuggerInfo(TestProcessAttach }; } - private static int GetVersion(Message message) - { - return (message as VersionedMessage)?.Version ?? 0; - } + //private static int GetVersion(Message message) + //{ + // return (message as VersionedMessage)?.Version ?? 0; + //} } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs index 8749e0a71a..b6af308c46 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; @@ -116,6 +117,7 @@ protected BaseRunTests( /// Publisher for test events. /// Platform Thread. /// Data Serializer for cloning TestCase and test results object. + [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Part of the public API")] protected BaseRunTests( IRequestData requestData, string? package, diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs b/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs index fa204d0664..0d787bdd5f 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Reflection; using System.Runtime.Serialization; @@ -384,6 +385,7 @@ public static bool TryUnregister(string id, out KeyValuePair + [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Part of the public API")] public static IEnumerable FilterCompatibleSources(Architecture chosenPlatform, Architecture defaultArchitecture, Framework chosenFramework, IDictionary sourcePlatforms, IDictionary sourceFrameworks, out string incompatibleSettingWarning) { incompatibleSettingWarning = string.Empty; diff --git a/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs b/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs index 5f1e32b437..4259cd5b45 100644 --- a/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs +++ b/src/vstest.console/Processors/ListFullyQualifiedTestsArgumentProcessor.cs @@ -134,7 +134,7 @@ internal ListFullyQualifiedTestsArgumentExecutor( _testRequestManager = testRequestManager; _runSettingsManager = runSettingsProvider; - _discoveryEventsRegistrar = new DiscoveryEventsRegistrar(output, _discoveredTests, _commandLineOptions); + _discoveryEventsRegistrar = new DiscoveryEventsRegistrar(_discoveredTests, _commandLineOptions); } #region IArgumentExecutor @@ -193,7 +193,7 @@ private class DiscoveryEventsRegistrar : ITestDiscoveryEventsRegistrar private readonly List _discoveredTests; private readonly CommandLineOptions _options; - public DiscoveryEventsRegistrar(IOutput output, List discoveredTests, CommandLineOptions cmdOptions) + public DiscoveryEventsRegistrar(List discoveredTests, CommandLineOptions cmdOptions) { _discoveredTests = discoveredTests; _options = cmdOptions;