Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE0060: Remove unused parameter #3854

Merged
merged 1 commit into from
Jul 18, 2022
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
4 changes: 3 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion playground/TestPlatform.Playground/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Evangelink marked this conversation as resolved.
Show resolved Hide resolved
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);
Expand All @@ -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)
Evangelink marked this conversation as resolved.
Show resolved Hide resolved
//{
// return (message as VersionedMessage)?.Version ?? 0;
//}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -116,6 +117,7 @@ protected BaseRunTests(
/// <param name="testEventsPublisher">Publisher for test events.</param>
/// <param name="platformThread">Platform Thread.</param>
/// <param name="dataSerializer">Data Serializer for cloning TestCase and test results object.</param>
[SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Part of the public API")]
protected BaseRunTests(
IRequestData requestData,
string? package,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -384,6 +385,7 @@ public static bool TryUnregister(string id, out KeyValuePair<TestProperty, HashS
return false;
}

[SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Part of the public API")]
public object GetRealObject(StreamingContext context)
{
var registeredProperty = Find(Id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ internal class VersionAttribute : Attribute
{
public string? Description { get; set; }

#pragma warning disable IDE0060 // Remove unused parameter // TODO: Do something with version or remove it
public VersionAttribute(int version)
#pragma warning restore IDE0060 // Remove unused parameter
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ public static bool TryGetFrameworkXml(XPathNavigator runSettingsNavigator, out s
/// Returns the sources matching the specified platform and framework settings.
/// For incompatible sources, warning is added to incompatibleSettingWarning.
/// </summary>
[SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Part of the public API")]
public static IEnumerable<string> FilterCompatibleSources(Architecture chosenPlatform, Architecture defaultArchitecture, Framework chosenFramework, IDictionary<string, Architecture> sourcePlatforms, IDictionary<string, Framework> sourceFrameworks, out string incompatibleSettingWarning)
{
incompatibleSettingWarning = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ internal ListFullyQualifiedTestsArgumentExecutor(
_testRequestManager = testRequestManager;

_runSettingsManager = runSettingsProvider;
_discoveryEventsRegistrar = new DiscoveryEventsRegistrar(output, _discoveredTests, _commandLineOptions);
_discoveryEventsRegistrar = new DiscoveryEventsRegistrar(_discoveredTests, _commandLineOptions);
}

#region IArgumentExecutor
Expand Down Expand Up @@ -193,7 +193,7 @@ private class DiscoveryEventsRegistrar : ITestDiscoveryEventsRegistrar
private readonly List<string> _discoveredTests;
private readonly CommandLineOptions _options;

public DiscoveryEventsRegistrar(IOutput output, List<string> discoveredTests, CommandLineOptions cmdOptions)
public DiscoveryEventsRegistrar(List<string> discoveredTests, CommandLineOptions cmdOptions)
{
_discoveredTests = discoveredTests;
_options = cmdOptions;
Expand Down