From 368f3c9692a51795d4f89a46ff6061ded9109a11 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 17 Aug 2022 09:08:33 -0700 Subject: [PATCH] refactor: fix SA1518 (#208) --- .editorconfig | 4 ---- src/Microsoft.ComponentDetection.Common/AsyncExecution.cs | 2 +- src/Microsoft.ComponentDetection.Common/Column.cs | 2 +- .../DockerReference/DigestUtility.cs | 2 +- src/Microsoft.ComponentDetection.Common/FileUtilityService.cs | 2 +- .../ISafeFileEnumerableFactory.cs | 2 +- .../Telemetry/Records/LinuxContainerDetectorLayerAwareness.cs | 2 +- src/Microsoft.ComponentDetection.Common/VerbosityMode.cs | 2 +- .../WarnOnAlertSeverity.cs | 2 +- .../IFileUtilityService.cs | 2 +- .../IObservableDirectoryWalkerFactory.cs | 2 +- .../IndividualDetectorScanResult.cs | 2 +- .../TypedComponent/ComponentType.cs | 2 +- .../npm/NpmComponentUtilities.cs | 2 +- .../pip/IPythonCommandService.cs | 2 +- .../pip/IPythonResolver.cs | 2 +- .../pip/PythonNotFoundException.cs | 2 +- .../pip/PythonProject.cs | 2 +- .../pip/PythonProjectRelease.cs | 2 +- .../pip/PythonVersionComparer.cs | 2 +- .../pip/PythonVersionUtilities.cs | 2 +- .../ArgumentSets/BcdeDevArguments.cs | 2 +- .../Exceptions/InvalidDetectorCategoriesException.cs | 2 +- .../Exceptions/InvalidDetectorFilterException.cs | 2 +- .../Exceptions/NoDetectorsFoundException.cs | 2 +- 25 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.editorconfig b/.editorconfig index f0c78ba2..bd5fa622 100644 --- a/.editorconfig +++ b/.editorconfig @@ -583,10 +583,6 @@ dotnet_diagnostic.SA1500.severity = suggestion # Single-line comment should be preceded by blank line dotnet_diagnostic.SA1515.severity = suggestion -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1518.md -# File is required to end with a single newline character -dotnet_diagnostic.SA1518.severity = suggestion - # https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1600.md # Elements should be documented dotnet_diagnostic.SA1600.severity = suggestion diff --git a/src/Microsoft.ComponentDetection.Common/AsyncExecution.cs b/src/Microsoft.ComponentDetection.Common/AsyncExecution.cs index 3284f19f..074e53a5 100644 --- a/src/Microsoft.ComponentDetection.Common/AsyncExecution.cs +++ b/src/Microsoft.ComponentDetection.Common/AsyncExecution.cs @@ -39,4 +39,4 @@ namespace Microsoft.ComponentDetection.Common } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Common/Column.cs b/src/Microsoft.ComponentDetection.Common/Column.cs index 5d5ce986..5edba5d8 100644 --- a/src/Microsoft.ComponentDetection.Common/Column.cs +++ b/src/Microsoft.ComponentDetection.Common/Column.cs @@ -8,4 +8,4 @@ public string Format { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Common/DockerReference/DigestUtility.cs b/src/Microsoft.ComponentDetection.Common/DockerReference/DigestUtility.cs index c7c64e24..96c521a9 100644 --- a/src/Microsoft.ComponentDetection.Common/DockerReference/DigestUtility.cs +++ b/src/Microsoft.ComponentDetection.Common/DockerReference/DigestUtility.cs @@ -51,4 +51,4 @@ namespace Microsoft.ComponentDetection.Common return true; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Common/FileUtilityService.cs b/src/Microsoft.ComponentDetection.Common/FileUtilityService.cs index f61c9c62..eec5861e 100644 --- a/src/Microsoft.ComponentDetection.Common/FileUtilityService.cs +++ b/src/Microsoft.ComponentDetection.Common/FileUtilityService.cs @@ -32,4 +32,4 @@ namespace Microsoft.ComponentDetection.Common return new FileStream(fileName, FileMode.Open, FileAccess.Read); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Common/ISafeFileEnumerableFactory.cs b/src/Microsoft.ComponentDetection.Common/ISafeFileEnumerableFactory.cs index 6098a3ed..c1b6c814 100644 --- a/src/Microsoft.ComponentDetection.Common/ISafeFileEnumerableFactory.cs +++ b/src/Microsoft.ComponentDetection.Common/ISafeFileEnumerableFactory.cs @@ -14,4 +14,4 @@ namespace Microsoft.ComponentDetection.Common /// A FileInfo enumerable that should be iterated over, containing all valid files given the input patterns and directory exclusions. IEnumerable CreateSafeFileEnumerable(DirectoryInfo directory, IEnumerable searchPatterns, ExcludeDirectoryPredicate directoryExclusionPredicate); } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Common/Telemetry/Records/LinuxContainerDetectorLayerAwareness.cs b/src/Microsoft.ComponentDetection.Common/Telemetry/Records/LinuxContainerDetectorLayerAwareness.cs index bef3b31f..0d630b9d 100644 --- a/src/Microsoft.ComponentDetection.Common/Telemetry/Records/LinuxContainerDetectorLayerAwareness.cs +++ b/src/Microsoft.ComponentDetection.Common/Telemetry/Records/LinuxContainerDetectorLayerAwareness.cs @@ -14,4 +14,4 @@ namespace Microsoft.ComponentDetection.Common.Telemetry.Records public string BaseImageLayerMessage { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Common/VerbosityMode.cs b/src/Microsoft.ComponentDetection.Common/VerbosityMode.cs index feb5dfc9..20812983 100644 --- a/src/Microsoft.ComponentDetection.Common/VerbosityMode.cs +++ b/src/Microsoft.ComponentDetection.Common/VerbosityMode.cs @@ -6,4 +6,4 @@ Normal = 1, Verbose = 2, } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Common/WarnOnAlertSeverity.cs b/src/Microsoft.ComponentDetection.Common/WarnOnAlertSeverity.cs index e2eb23ad..7f000a2f 100644 --- a/src/Microsoft.ComponentDetection.Common/WarnOnAlertSeverity.cs +++ b/src/Microsoft.ComponentDetection.Common/WarnOnAlertSeverity.cs @@ -8,4 +8,4 @@ Medium = 3, Low = 4, } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Contracts/IFileUtilityService.cs b/src/Microsoft.ComponentDetection.Contracts/IFileUtilityService.cs index 2a058296..5daf881a 100644 --- a/src/Microsoft.ComponentDetection.Contracts/IFileUtilityService.cs +++ b/src/Microsoft.ComponentDetection.Contracts/IFileUtilityService.cs @@ -15,4 +15,4 @@ namespace Microsoft.ComponentDetection.Contracts Stream MakeFileStream(string fileName); } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Contracts/IObservableDirectoryWalkerFactory.cs b/src/Microsoft.ComponentDetection.Contracts/IObservableDirectoryWalkerFactory.cs index 45c7c927..aab4dc20 100644 --- a/src/Microsoft.ComponentDetection.Contracts/IObservableDirectoryWalkerFactory.cs +++ b/src/Microsoft.ComponentDetection.Contracts/IObservableDirectoryWalkerFactory.cs @@ -13,4 +13,4 @@ namespace Microsoft.ComponentDetection.Contracts IObservable GetFilteredComponentStreamObservable(DirectoryInfo root, IEnumerable patterns, IComponentRecorder componentRecorder); } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Contracts/IndividualDetectorScanResult.cs b/src/Microsoft.ComponentDetection.Contracts/IndividualDetectorScanResult.cs index 160f685d..8486156d 100644 --- a/src/Microsoft.ComponentDetection.Contracts/IndividualDetectorScanResult.cs +++ b/src/Microsoft.ComponentDetection.Contracts/IndividualDetectorScanResult.cs @@ -14,4 +14,4 @@ namespace Microsoft.ComponentDetection.Contracts public Dictionary AdditionalTelemetryDetails { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Contracts/TypedComponent/ComponentType.cs b/src/Microsoft.ComponentDetection.Contracts/TypedComponent/ComponentType.cs index 70e4c904..b4d7e716 100644 --- a/src/Microsoft.ComponentDetection.Contracts/TypedComponent/ComponentType.cs +++ b/src/Microsoft.ComponentDetection.Contracts/TypedComponent/ComponentType.cs @@ -54,4 +54,4 @@ namespace Microsoft.ComponentDetection.Contracts.TypedComponent [EnumMember] DockerReference = 16, } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Detectors/npm/NpmComponentUtilities.cs b/src/Microsoft.ComponentDetection.Detectors/npm/NpmComponentUtilities.cs index a41d6568..4e5ddfab 100644 --- a/src/Microsoft.ComponentDetection.Detectors/npm/NpmComponentUtilities.cs +++ b/src/Microsoft.ComponentDetection.Detectors/npm/NpmComponentUtilities.cs @@ -169,4 +169,4 @@ namespace Microsoft.ComponentDetection.Detectors.Npm || UnsafeCharactersRegex.IsMatch(name)); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/IPythonCommandService.cs b/src/Microsoft.ComponentDetection.Detectors/pip/IPythonCommandService.cs index fa841fde..b4b7d5fb 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/IPythonCommandService.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/IPythonCommandService.cs @@ -10,4 +10,4 @@ namespace Microsoft.ComponentDetection.Detectors.Pip Task> ParseFile(string path, string pythonPath = null); } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/IPythonResolver.cs b/src/Microsoft.ComponentDetection.Detectors/pip/IPythonResolver.cs index 1a86ce8b..f66c48c9 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/IPythonResolver.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/IPythonResolver.cs @@ -12,4 +12,4 @@ namespace Microsoft.ComponentDetection.Detectors.Pip /// The root packages, with dependencies associated as children. Task> ResolveRoots(IList initialPackages); } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/PythonNotFoundException.cs b/src/Microsoft.ComponentDetection.Detectors/pip/PythonNotFoundException.cs index eacc9be3..2f5c2971 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/PythonNotFoundException.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/PythonNotFoundException.cs @@ -5,4 +5,4 @@ namespace Microsoft.ComponentDetection.Detectors.Pip public class PythonNotFoundException : Exception { } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/PythonProject.cs b/src/Microsoft.ComponentDetection.Detectors/pip/PythonProject.cs index 4664e04a..4a947607 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/PythonProject.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/PythonProject.cs @@ -9,4 +9,4 @@ namespace Microsoft.ComponentDetection.Detectors.Pip { public Dictionary> Releases { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/PythonProjectRelease.cs b/src/Microsoft.ComponentDetection.Detectors/pip/PythonProjectRelease.cs index d6a9c624..853c4f54 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/PythonProjectRelease.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/PythonProjectRelease.cs @@ -17,4 +17,4 @@ namespace Microsoft.ComponentDetection.Detectors.Pip public Uri Url { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/PythonVersionComparer.cs b/src/Microsoft.ComponentDetection.Detectors/pip/PythonVersionComparer.cs index 6e73594c..144fd1f5 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/PythonVersionComparer.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/PythonVersionComparer.cs @@ -12,4 +12,4 @@ namespace Microsoft.ComponentDetection.Detectors.Pip return xVer.CompareTo(yVer); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/PythonVersionUtilities.cs b/src/Microsoft.ComponentDetection.Detectors/pip/PythonVersionUtilities.cs index 08b49d5f..f7daf33c 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/PythonVersionUtilities.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/PythonVersionUtilities.cs @@ -137,4 +137,4 @@ namespace Microsoft.ComponentDetection.Detectors.Pip } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Orchestrator/ArgumentSets/BcdeDevArguments.cs b/src/Microsoft.ComponentDetection.Orchestrator/ArgumentSets/BcdeDevArguments.cs index 1aae6903..8bb8c274 100644 --- a/src/Microsoft.ComponentDetection.Orchestrator/ArgumentSets/BcdeDevArguments.cs +++ b/src/Microsoft.ComponentDetection.Orchestrator/ArgumentSets/BcdeDevArguments.cs @@ -9,4 +9,4 @@ namespace Microsoft.ComponentDetection.Orchestrator.ArgumentSets { // TODO: Add option to specify download directory for GH database } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/InvalidDetectorCategoriesException.cs b/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/InvalidDetectorCategoriesException.cs index 4f545e36..5220ff67 100644 --- a/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/InvalidDetectorCategoriesException.cs +++ b/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/InvalidDetectorCategoriesException.cs @@ -25,4 +25,4 @@ namespace Microsoft.ComponentDetection.Orchestrator.Exceptions { } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/InvalidDetectorFilterException.cs b/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/InvalidDetectorFilterException.cs index f44b4e9f..09aea24b 100644 --- a/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/InvalidDetectorFilterException.cs +++ b/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/InvalidDetectorFilterException.cs @@ -25,4 +25,4 @@ namespace Microsoft.ComponentDetection.Orchestrator.Exceptions { } } -} \ No newline at end of file +} diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/NoDetectorsFoundException.cs b/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/NoDetectorsFoundException.cs index 3f558fd5..e4a8af90 100644 --- a/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/NoDetectorsFoundException.cs +++ b/src/Microsoft.ComponentDetection.Orchestrator/Exceptions/NoDetectorsFoundException.cs @@ -26,4 +26,4 @@ namespace Microsoft.ComponentDetection.Orchestrator.Exceptions { } } -} \ No newline at end of file +}