diff --git a/ConsoleInterface/Program.cs b/ConsoleInterface/Program.cs index bb72c00..b8696c9 100644 --- a/ConsoleInterface/Program.cs +++ b/ConsoleInterface/Program.cs @@ -1,6 +1,6 @@ -using System.IO; +using System.Collections.Generic; +using System.IO; using CommandLine; -using Image; using Image.Files; using Image.Output; using Microsoft.Extensions.Logging; @@ -20,7 +20,8 @@ namespace ConsoleInterface /// The console interface for the project and the main entrypoint. /// /// Command line provided args. - private static void Main(string[] args) + // ReSharper disable once UnusedMember.Local + private static void Main(IEnumerable args) { Parser.Default.ParseArguments(args).WithParsed(RunOptions); } diff --git a/ConsoleInterface/TaskExecutor.cs b/ConsoleInterface/TaskExecutor.cs index 310e339..9ed767f 100644 --- a/ConsoleInterface/TaskExecutor.cs +++ b/ConsoleInterface/TaskExecutor.cs @@ -91,7 +91,7 @@ namespace ConsoleInterface result.Wait(); var successTasks = tasks.Count(t => t.IsCompletedSuccessfully && t.Result); - var errorTasks = tasks.Count() - successTasks; + var errorTasks = tasks.Count - successTasks; Logger.LogInformation($"All tasks completed. Success: {successTasks}, Errors: {errorTasks}"); } } diff --git a/ImageCore.Tests/TestCompressor.cs b/ImageCore.Tests/TestCompressor.cs index 11dcba1..a82473e 100644 --- a/ImageCore.Tests/TestCompressor.cs +++ b/ImageCore.Tests/TestCompressor.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using Image; using Image.Compressor; using Xunit; diff --git a/ImageCore.Tests/TestLocalSystemFilesRetriever.cs b/ImageCore.Tests/TestLocalSystemFilesRetriever.cs index a181c40..1115342 100644 --- a/ImageCore.Tests/TestLocalSystemFilesRetriever.cs +++ b/ImageCore.Tests/TestLocalSystemFilesRetriever.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Image; using Image.Files; using Xunit; diff --git a/ImageCore/Compressor/LosslessCompressor.cs b/ImageCore/Compressor/LosslessCompressor.cs index 789a963..740f84d 100644 --- a/ImageCore/Compressor/LosslessCompressor.cs +++ b/ImageCore/Compressor/LosslessCompressor.cs @@ -7,7 +7,7 @@ namespace Image.Compressor /// public class LosslessCompressor : ICompressor { - public static readonly LosslessCompressor Instance; + public static readonly LosslessCompressor Instance = new LosslessCompressor(); private readonly ImageOptimizer _imageOptimizer; public LosslessCompressor() diff --git a/ImageCore/Compressor/NullCompressor.cs b/ImageCore/Compressor/NullCompressor.cs index 0966626..4045ab1 100644 --- a/ImageCore/Compressor/NullCompressor.cs +++ b/ImageCore/Compressor/NullCompressor.cs @@ -5,7 +5,7 @@ /// public class NullCompressor : ICompressor { - public static readonly NullCompressor Instance; + public static readonly NullCompressor Instance = new NullCompressor(); /// /// diff --git a/ImageCore/ImageCore.csproj b/ImageCore/ImageCore.csproj index d325666..666b158 100644 --- a/ImageCore/ImageCore.csproj +++ b/ImageCore/ImageCore.csproj @@ -3,6 +3,7 @@ Image net5.0;netstandard2.1 + 8.0 diff --git a/ImageCore/Output/KeepFilenameFormatter.cs b/ImageCore/Output/KeepFilenameFormatter.cs index 1f4c337..3ca403a 100644 --- a/ImageCore/Output/KeepFilenameFormatter.cs +++ b/ImageCore/Output/KeepFilenameFormatter.cs @@ -36,7 +36,7 @@ namespace Image.Output { Logger.LogDebug($"KeepFilenameFormatter - {_outputDirectory} - {initialFilePath}"); Guard.Against.NullOrEmpty(initialFilePath, nameof(initialFilePath)); - var fileName = Path.GetFileName(initialFilePath)?.Split('.')[0]; + var fileName = Path.GetFileName(initialFilePath).Split('.')[0]; var path = Path.Combine(_outputDirectory, $"{fileName}.jpg"); return path;