Skip to content

Commit

Permalink
Enable nullable on Public API
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Jun 24, 2022
1 parent e120d2b commit c483f4f
Show file tree
Hide file tree
Showing 53 changed files with 1,173 additions and 1,139 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ dotnet_diagnostic.CA1041.severity = warning # not default, increased severity to
# CA1837: Use Environment.ProcessId instead of Process.GetCurrentProcess().Id
dotnet_diagnostic.CA1837.severity = warning # not default, increased severity to ensure it is applied

# RS0041: Public members should not use oblivious types
# TODO: Move resx as internal OR use new resx generator (nullable aware) when available
dotnet_diagnostic.RS0041.severity = none # not default, decreased severity because of public resources (resx) not being nullable aware

#### C# Coding Conventions ####

# var preferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Microsoft.VisualStudio.TestPlatform.Common.RequestData.ProtocolConfig.get -> Mic
Microsoft.VisualStudio.TestPlatform.Common.RequestData.ProtocolConfig.set -> void
Microsoft.VisualStudio.TestPlatform.Common.RequestData.RequestData() -> void
Microsoft.VisualStudio.TestPlatform.Common.RunSettings
Microsoft.VisualStudio.TestPlatform.Common.RunSettings.GetSettings(string! settingsName) -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.ISettingsProvider?
Microsoft.VisualStudio.TestPlatform.Common.RunSettings.GetSettings(string? settingsName) -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.ISettingsProvider?
Microsoft.VisualStudio.TestPlatform.Common.RunSettings.InitializeSettingsProviders(string! settings) -> void
Microsoft.VisualStudio.TestPlatform.Common.RunSettings.LoadSettingsXml(string! settings) -> void
Microsoft.VisualStudio.TestPlatform.Common.RunSettings.RunSettings() -> void
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.TestPlatform.Common/RunSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public RunSettings()
/// </summary>
/// <param name="settingsName">Name of the settings section to get.</param>
/// <returns>The settings provider for the settings or null if one was not found.</returns>
public ISettingsProvider? GetSettings(string settingsName)
public ISettingsProvider? GetSettings(string? settingsName)
{
if (settingsName.IsNullOrWhiteSpace())
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput
Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.Write(string? message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level) -> void
Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.WriteLine(string? message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level) -> void
Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.SetupListener(System.Diagnostics.TraceListener! listener) -> void
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.SetupRemoteEqtTraceListeners(System.AppDomain! childDomain) -> void
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.SetupListener(System.Diagnostics.TraceListener? listener) -> void
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.SetupRemoteEqtTraceListeners(System.AppDomain? childDomain) -> void
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.get -> System.Diagnostics.TraceLevel
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.set -> void
static Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.Instance.get -> Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput
Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.Write(string? message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level) -> void
Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.WriteLine(string? message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level) -> void
Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.SetupListener(System.Diagnostics.TraceListener! listener) -> void
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.SetupRemoteEqtTraceListeners(System.AppDomain! childDomain) -> void
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.SetupListener(System.Diagnostics.TraceListener? listener) -> void
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.SetupRemoteEqtTraceListeners(System.AppDomain? childDomain) -> void
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.get -> System.Diagnostics.TraceLevel
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.set -> void
static Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.Instance.get -> Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput!
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public static class EqtTrace
private static readonly IPlatformEqtTrace TraceImpl = new PlatformEqtTrace();

#if NETFRAMEWORK
public static void SetupRemoteEqtTraceListeners(AppDomain childDomain)
public static void SetupRemoteEqtTraceListeners(AppDomain? childDomain)
{
TraceImpl.SetupRemoteEqtTraceListeners(childDomain);
}

public static void SetupListener(TraceListener listener)
public static void SetupListener(TraceListener? listener)
{
TraceImpl.SetupListener(listener);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public interface IFrameworkHandle : ITestExecutionRecorder, IMessageLogger
/// <param name="arguments">Command line arguments the process should be launched with.</param>
/// <param name="environmentVariables">Environment variables to be set in target process</param>
/// <returns>Process ID of the started process.</returns>
int LaunchProcessWithDebuggerAttached(string filePath, string workingDirectory, string arguments, IDictionary<string, string?> environmentVariables);
int LaunchProcessWithDebuggerAttached(string filePath, string? workingDirectory, string? arguments, IDictionary<string, string?>? environmentVariables);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface IRunSettings
/// </summary>
/// <param name="settingsName">Name of the settings section to get.</param>
/// <returns>The settings provider for the settings or null if one was not found.</returns>
ISettingsProvider? GetSettings(string settingsName);
ISettingsProvider? GetSettings(string? settingsName);

/// <summary>
/// Settings used for this run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ public interface ITestCaseFilterExpression
/// <summary>
/// Matched test case with test case filtering criteria.
/// </summary>
bool MatchTestCase(TestCase testCase, Func<string, object> propertyValueProvider);
bool MatchTestCase(TestCase testCase, Func<string, object?> propertyValueProvider);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public TestRunCompleteEventArgs(
bool isCanceled,
bool isAborted,
Exception? error,
Collection<AttachmentSet> attachmentSets,
Collection<AttachmentSet>? attachmentSets,
TimeSpan elapsedTime)
: this(
stats,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ public interface IDiscoveryRequest : IRequest
/// <summary>
/// Handler for notifying discovery process is started
/// </summary>
event EventHandler<DiscoveryStartEventArgs> OnDiscoveryStart;
event EventHandler<DiscoveryStartEventArgs>? OnDiscoveryStart;

/// <summary>
/// Handler for notifying discovery process is complete
/// </summary>
event EventHandler<DiscoveryCompleteEventArgs> OnDiscoveryComplete;
event EventHandler<DiscoveryCompleteEventArgs>? OnDiscoveryComplete;

/// <summary>
/// Handler for notifying when newly found tests are available for UI to fetch.
/// </summary>
event EventHandler<DiscoveredTestsEventArgs> OnDiscoveredTests;
event EventHandler<DiscoveredTestsEventArgs>? OnDiscoveredTests;

/// <summary>
/// Handler for receiving error during fetching/execution. This is used for when abnormal error
/// occurs; equivalent of IRunMessageLogger in the current RockSteady core
/// </summary>
event EventHandler<TestRunMessageEventArgs> OnDiscoveryMessage;
event EventHandler<TestRunMessageEventArgs>? OnDiscoveryMessage;

/// <summary>
/// Gets the discovery criterion.
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.TestPlatform.ObjectModel/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static class Constants
/// </summary>
public static readonly string DefaultResultsDirectory =
#if NETSTANDARD1_0
Path.Combine(".", ResultsDirectoryName);
Path.Combine(".", ResultsDirectoryName);
#else
Path.Combine(Directory.GetCurrentDirectory(), ResultsDirectoryName);
#endif
Expand Down
Loading

0 comments on commit c483f4f

Please sign in to comment.