Add editorconfig, fix issues

This commit is contained in:
Matt Nadareski
2026-01-25 17:27:42 -05:00
parent 7058c7a150
commit 0d2f81773d
84 changed files with 407 additions and 244 deletions

View File

@@ -193,7 +193,7 @@ namespace ProtectionScan.Features
/// <param name="protections">Dictionary of protections found, if any</param>
private void WriteProtectionResults(string path, Dictionary<string, List<string>> protections)
{
if (protections == null)
if (protections is null)
{
Console.WriteLine($"No protections found for {path}");
return;
@@ -250,7 +250,7 @@ namespace ProtectionScan.Features
/// <param name="protections">Dictionary of protections found, if any</param>
private void WriteProtectionResultJson(string path, Dictionary<string, List<string>> protections)
{
if (protections == null)
if (protections is null)
{
Console.WriteLine($"No protections found for {path}");
return;

View File

@@ -20,7 +20,7 @@ namespace ProtectionScan
var commandSet = CreateCommands(mainFeature);
// If we have no args, show the help and quit
if (args == null || args.Length == 0)
if (args is null || args.Length == 0)
{
commandSet.OutputAllHelp();
return;

View File

@@ -36,7 +36,7 @@ namespace ProtectionScan
// Capture the current synchronization context.
// If there is no current context, we use a default instance targeting the ThreadPool.
_synchronizationContext = SynchronizationContext.Current ?? ProgressStatics.DefaultContext;
Debug.Assert(_synchronizationContext != null);
Debug.Assert(_synchronizationContext is not null);
_invokeHandlers = new SendOrPostCallback(InvokeHandlers);
}
@@ -70,7 +70,7 @@ namespace ProtectionScan
// an event handler is removed between now and then.
Action<T>? handler = _handler;
EventHandler<T>? changedEvent = ProgressChanged;
if (handler != null || changedEvent != null)
if (handler is not null || changedEvent is not null)
{
// Post the processing to the sync context.
// (If T is a value type, it will get boxed here.)