diff --git a/.editorconfig b/.editorconfig index c2c0b3e71..378f83d75 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# reference:https://raw.githubusercontent.com/meziantou/Meziantou.DotNet.CodingStandard/refs/heads/main/.editorconfig +# reference:https://raw.githubusercontent.com/meziantou/Meziantou.DotNet.CodingStandard/refs/heads/main/.editorconfig # Schema: http://EditorConfig.org # Docs: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference @@ -41,7 +41,6 @@ insert_final_newline = true # endreference [*.cs] -dotnet_diagnostic.IDE0058.severity = none dotnet_diagnostic.IDE0303.severity = none dotnet_diagnostic.CA1508.severity = none dotnet_diagnostic.CA2000.severity = none diff --git a/Directory.Build.props b/Directory.Build.props index 70297f456..fa20c6b33 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,7 +11,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/global.json b/global.json index e7a1b53ab..7d0d05b7d 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "9.0.304", + "version": "10.0.100-rc.2.25502.107", "rollForward": "latestPatch" }, "msbuild-sdks": { - "Meziantou.NET.Sdk": "1.0.9", - "Meziantou.NET.Sdk.Test": "1.0.9", - "Meziantou.NET.Sdk.Web": "1.0.9" + "Meziantou.NET.Sdk": "1.0.38", + "Meziantou.NET.Sdk.Test": "1.0.38", + "Meziantou.NET.Sdk.Web": "1.0.38" } } diff --git a/src/DocumentationGenerator/DocumentationGenerator.csproj b/src/DocumentationGenerator/DocumentationGenerator.csproj index 42fa597dd..759553d17 100644 --- a/src/DocumentationGenerator/DocumentationGenerator.csproj +++ b/src/DocumentationGenerator/DocumentationGenerator.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/DocumentationGenerator/Program.cs b/src/DocumentationGenerator/Program.cs index a17664828..d6c7aad06 100644 --- a/src/DocumentationGenerator/Program.cs +++ b/src/DocumentationGenerator/Program.cs @@ -2,8 +2,6 @@ #pragma warning disable CA1849 #pragma warning disable MA0004 #pragma warning disable MA0009 -using System.Globalization; -using System.Text; using System.Text.Encodings.Web; using System.Text.RegularExpressions; using Meziantou.Framework; diff --git a/src/ListDotNetTypes/ListDotNetTypes.csproj b/src/ListDotNetTypes/ListDotNetTypes.csproj index 2348a2ee0..e37b0a6b6 100644 --- a/src/ListDotNetTypes/ListDotNetTypes.csproj +++ b/src/ListDotNetTypes/ListDotNetTypes.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/Meziantou.Analyzer.CodeFixers/Internals/FixAllContextHelper.cs b/src/Meziantou.Analyzer.CodeFixers/Internals/FixAllContextHelper.cs index 05507550e..bc720e4b7 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Internals/FixAllContextHelper.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Internals/FixAllContextHelper.cs @@ -1,13 +1,10 @@ -// File initially copied from +// File initially copied from // https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/4d9b3e3bb785a55f73b3029a843f0c0b73cc9ea7/StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/Helpers/FixAllContextHelper.cs // Original copyright statement: // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Collections.Concurrent; using System.Collections.Immutable; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeFixes; @@ -40,9 +37,7 @@ public static async Task p.Language == project.Language) - .ToImmutableArray(); + projectsToFix = ImmutableArray.Empty.AddRange(project.Solution.Projects.Where(p => p.Language == project.Language)); var diagnostics = new ConcurrentDictionary>(); var tasks = new Task[projectsToFix.Length]; diff --git a/src/Meziantou.Analyzer.CodeFixers/Meziantou.Analyzer.CodeFixers.csproj b/src/Meziantou.Analyzer.CodeFixers/Meziantou.Analyzer.CodeFixers.csproj index 6dc7ebe5a..9befcd77f 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Meziantou.Analyzer.CodeFixers.csproj +++ b/src/Meziantou.Analyzer.CodeFixers/Meziantou.Analyzer.CodeFixers.csproj @@ -1,6 +1,6 @@  - net9.0;netstandard2.0 + net10.0;netstandard2.0 false 1.0.1 bin\$(RoslynVersion)\ diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/AbstractTypesShouldNotHaveConstructorsFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/AbstractTypesShouldNotHaveConstructorsFixer.cs index ed0b65fc0..03c8175e8 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/AbstractTypesShouldNotHaveConstructorsFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/AbstractTypesShouldNotHaveConstructorsFixer.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/ArgumentExceptionShouldSpecifyArgumentNameFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/ArgumentExceptionShouldSpecifyArgumentNameFixer.cs index 0f93ecedf..296fdd478 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/ArgumentExceptionShouldSpecifyArgumentNameFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/ArgumentExceptionShouldSpecifyArgumentNameFixer.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidComparisonWithBoolConstantFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidComparisonWithBoolConstantFixer.cs index f95de44bf..509d89b7e 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidComparisonWithBoolConstantFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidComparisonWithBoolConstantFixer.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidUsingRedundantElseFixAllProvider.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidUsingRedundantElseFixAllProvider.cs index fbea59859..eff033980 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidUsingRedundantElseFixAllProvider.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidUsingRedundantElseFixAllProvider.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Threading.Tasks; +using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidUsingRedundantElseFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidUsingRedundantElseFixer.cs index 41ecc4cab..1d6af4791 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidUsingRedundantElseFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/AvoidUsingRedundantElseFixer.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/ClassMustBeSealedFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/ClassMustBeSealedFixer.cs index f6effc163..91e7e4f0f 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/ClassMustBeSealedFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/ClassMustBeSealedFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/CommaFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/CommaFixer.cs index 8a8a9b8cb..ee1bcd259 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/CommaFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/CommaFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotRemoveOriginalExceptionFromThrowStatementFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotRemoveOriginalExceptionFromThrowStatementFixer.cs index 6f49e947f..30a2d196e 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotRemoveOriginalExceptionFromThrowStatementFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotRemoveOriginalExceptionFromThrowStatementFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseBlockingCallInAsyncContextFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseBlockingCallInAsyncContextFixer.cs index 1f2bb7431..03b5b6ee8 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseBlockingCallInAsyncContextFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseBlockingCallInAsyncContextFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityComparerDefaultOfStringFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityComparerDefaultOfStringFixer.cs index c2b7abbe4..c5dd8ed3b 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityComparerDefaultOfStringFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityComparerDefaultOfStringFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityOperatorsForSpanOfCharFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityOperatorsForSpanOfCharFixer.cs index d8971b883..b22f331fd 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityOperatorsForSpanOfCharFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseEqualityOperatorsForSpanOfCharFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseStringGetHashCodeFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseStringGetHashCodeFixer.cs index b30907044..557b297c1 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseStringGetHashCodeFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/DoNotUseStringGetHashCodeFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/EqualityShouldBeCorrectlyImplementedFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/EqualityShouldBeCorrectlyImplementedFixer.cs index d5bf6ae52..35faf59d5 100755 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/EqualityShouldBeCorrectlyImplementedFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/EqualityShouldBeCorrectlyImplementedFixer.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/EventsShouldHaveProperArgumentsFixer.MA0091.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/EventsShouldHaveProperArgumentsFixer.MA0091.cs index 64403be22..41fea353c 100755 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/EventsShouldHaveProperArgumentsFixer.MA0091.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/EventsShouldHaveProperArgumentsFixer.MA0091.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/MakeClassStaticFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/MakeClassStaticFixer.cs index bb33b0e11..257af17de 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/MakeClassStaticFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/MakeClassStaticFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/MakeInterpolatedStringFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/MakeInterpolatedStringFixer.cs index 686320aba..68f8b550d 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/MakeInterpolatedStringFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/MakeInterpolatedStringFixer.cs @@ -1,15 +1,11 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Editing; -using Microsoft.CodeAnalysis.Formatting; namespace Meziantou.Analyzer.Rules; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/MakeMemberReadOnlyFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/MakeMemberReadOnlyFixer.cs index aadb5961c..d2641b635 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/MakeMemberReadOnlyFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/MakeMemberReadOnlyFixer.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/MakeMethodStaticFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/MakeMethodStaticFixer.cs index 61377f1c6..25b50cdb7 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/MakeMethodStaticFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/MakeMethodStaticFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; @@ -27,7 +25,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); var nodeToFix = root?.FindNode(context.Span, getInnermostNodeForTie: true); - if (nodeToFix is MethodDeclarationSyntax || nodeToFix is PropertyDeclarationSyntax) + if (nodeToFix is MethodDeclarationSyntax or PropertyDeclarationSyntax) { var title = "Add static modifier"; var codeAction = CodeAction.Create( diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/MarkAttributesWithAttributeUsageAttributeFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/MarkAttributesWithAttributeUsageAttributeFixer.cs index 1b65d702f..0e5d8263f 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/MarkAttributesWithAttributeUsageAttributeFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/MarkAttributesWithAttributeUsageAttributeFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/MethodOverridesShouldNotChangeParameterDefaultsFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/MethodOverridesShouldNotChangeParameterDefaultsFixer.cs index 9f4cacafc..e25fc5d91 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/MethodOverridesShouldNotChangeParameterDefaultsFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/MethodOverridesShouldNotChangeParameterDefaultsFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/NamedParameterFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/NamedParameterFixer.cs index 7f5f3d965..62cb60762 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/NamedParameterFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/NamedParameterFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/NotPatternShouldBeParenthesizedCodeFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/NotPatternShouldBeParenthesizedCodeFixer.cs index 7723ec7d8..3e7befa46 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/NotPatternShouldBeParenthesizedCodeFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/NotPatternShouldBeParenthesizedCodeFixer.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeGuidCreationFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeGuidCreationFixer.cs index b415af910..c021b4926 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeGuidCreationFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeGuidCreationFixer.cs @@ -1,9 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Net.NetworkInformation; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeLinqUsageFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeLinqUsageFixer.cs index f120f2ad0..69f5ba2a8 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeLinqUsageFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeLinqUsageFixer.cs @@ -1,10 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Globalization; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeStartsWithFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeStartsWithFixer.cs index c45b71c81..519118127 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeStartsWithFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeStartsWithFixer.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeStringBuilderUsageFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeStringBuilderUsageFixer.cs index 2802ed8eb..82f170a6c 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeStringBuilderUsageFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/OptimizeStringBuilderUsageFixer.cs @@ -1,11 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; @@ -260,7 +254,7 @@ private static async Task ReplaceStringFormatWithAppendFormat(Document var stringFormatOperation = (IInvocationOperation)operation.Arguments[0].Value; var newExpression = generator.InvocationExpression(generator.MemberAccessExpression(operation.GetChildOperations().First().Syntax, "AppendFormat"), - stringFormatOperation.Arguments.Select(a => a.Syntax).ToArray()); + [.. stringFormatOperation.Arguments.Select(a => a.Syntax)]); if (isAppendLine) { @@ -285,7 +279,7 @@ private static async Task ReplaceStringJoinWithAppendJoin(Document doc var stringFormatOperation = (IInvocationOperation)operation.Arguments[0].Value; var newExpression = generator.InvocationExpression(generator.MemberAccessExpression(operation.GetChildOperations().First().Syntax, "AppendJoin"), - stringFormatOperation.Arguments.Select(a => a.Syntax).ToArray()); + [.. stringFormatOperation.Arguments.Select(a => a.Syntax)]); if (isAppendLine) { diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/ParameterAttributeForRazorComponentFixer.AddParameterAttribute.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/ParameterAttributeForRazorComponentFixer.AddParameterAttribute.cs index 8f9f2083f..cada87ffd 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/ParameterAttributeForRazorComponentFixer.AddParameterAttribute.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/ParameterAttributeForRazorComponentFixer.AddParameterAttribute.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/PreserveParamsOnOverrideFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/PreserveParamsOnOverrideFixer.cs index 38827a6cc..68215a8bd 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/PreserveParamsOnOverrideFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/PreserveParamsOnOverrideFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/RemoveEmptyStatementFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/RemoveEmptyStatementFixer.cs index 210b68ec9..0ab4a6538 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/RemoveEmptyStatementFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/RemoveEmptyStatementFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/RemoveUselessToStringFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/RemoveUselessToStringFixer.cs index e90ca3b40..b93d475ef 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/RemoveUselessToStringFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/RemoveUselessToStringFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/ReplaceEnumToStringWithNameofFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/ReplaceEnumToStringWithNameofFixer.cs index e6a11beaa..8000eb42f 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/ReplaceEnumToStringWithNameofFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/ReplaceEnumToStringWithNameofFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/ReturnTaskFromResultInsteadOfReturningNullFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/ReturnTaskFromResultInsteadOfReturningNullFixer.cs index c65422c63..6fd24d1ac 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/ReturnTaskFromResultInsteadOfReturningNullFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/ReturnTaskFromResultInsteadOfReturningNullFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/SimplifyCallerArgumentExpressionFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/SimplifyCallerArgumentExpressionFixer.cs index ae4e15a0e..36b349316 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/SimplifyCallerArgumentExpressionFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/SimplifyCallerArgumentExpressionFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; @@ -24,7 +22,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); var nodeToFix = root?.FindNode(context.Span, getInnermostNodeForTie: false); - if (nodeToFix is null || nodeToFix is not ArgumentSyntax) + if (nodeToFix is null or not ArgumentSyntax) return; var title = "Remove argument"; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/StringShouldNotContainsNonDeterministicEndOfLineFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/StringShouldNotContainsNonDeterministicEndOfLineFixer.cs index 1d4449751..94bb91ea1 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/StringShouldNotContainsNonDeterministicEndOfLineFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/StringShouldNotContainsNonDeterministicEndOfLineFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasCancellationTokenFixer_Argument.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasCancellationTokenFixer_Argument.cs index 1212d8caf..75ad0f949 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasCancellationTokenFixer_Argument.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasCancellationTokenFixer_Argument.cs @@ -1,8 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasCancellationTokenFixer_AwaitForEach.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasCancellationTokenFixer_AwaitForEach.cs index 47159c904..e086f4f72 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasCancellationTokenFixer_AwaitForEach.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasCancellationTokenFixer_AwaitForEach.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasTimeProviderFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasTimeProviderFixer.cs index 1ffc923d5..a3612b84a 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasTimeProviderFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseAnOverloadThatHasTimeProviderFixer.cs @@ -1,15 +1,11 @@ using System.Collections.Immutable; using System.Composition; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Editing; -using Microsoft.CodeAnalysis.Operations; namespace Meziantou.Analyzer.Rules; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseArrayEmptyFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseArrayEmptyFixer.cs index 68168ee3f..f2611affc 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseArrayEmptyFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseArrayEmptyFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseConfigureAwaitFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseConfigureAwaitFixer.cs index 1008d7c2b..46ca11b9b 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseConfigureAwaitFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseConfigureAwaitFixer.cs @@ -1,8 +1,5 @@ using System.Collections.Immutable; using System.Composition; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseDateTimeUnixEpochFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseDateTimeUnixEpochFixer.cs index 416e70d70..99729b805 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseDateTimeUnixEpochFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseDateTimeUnixEpochFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseEventArgsEmptyFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseEventArgsEmptyFixer.cs index b2b152ba6..a9d595756 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseEventArgsEmptyFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseEventArgsEmptyFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseGuidEmptyFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseGuidEmptyFixer.cs index 218771a22..e960c5780 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseGuidEmptyFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseGuidEmptyFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseIsPatternInsteadOfSequenceEqualFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseIsPatternInsteadOfSequenceEqualFixer.cs index d18e6bd0f..1dcf08310 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseIsPatternInsteadOfSequenceEqualFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseIsPatternInsteadOfSequenceEqualFixer.cs @@ -1,12 +1,10 @@ -using Microsoft.CodeAnalysis.CodeFixes; +using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis; using System.Composition; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Operations; using System.Collections.Immutable; -using System.Threading.Tasks; -using System.Threading; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedFixer.cs index 650ae32fa..17a246222 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseLangwordInXmlCommentFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseLangwordInXmlCommentFixer.cs index 496506a19..622d09a0e 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseLangwordInXmlCommentFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseLangwordInXmlCommentFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingForEqualityComparisonsFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingForEqualityComparisonsFixer.cs index fdda62f39..f64fc7443 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingForEqualityComparisonsFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingForEqualityComparisonsFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingInsteadOfHasvalueFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingInsteadOfHasvalueFixer.cs index c0b9a9cb7..086d58618 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingInsteadOfHasvalueFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UsePatternMatchingInsteadOfHasvalueFixer.cs @@ -1,4 +1,4 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; @@ -71,7 +71,7 @@ private static (SyntaxNode Node, bool Negate) GetNodeToReplace(IOperation operat } } - if (operation.Parent is IIsPatternOperation { Pattern: IConstantPatternOperation { Value: ILiteralOperation { ConstantValue: { Value: bool value } } } }) + if (operation.Parent is IIsPatternOperation { Pattern: IConstantPatternOperation { Value: ILiteralOperation { ConstantValue.Value: bool value } } }) { if (value) { diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseRegexSourceGeneratorFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseRegexSourceGeneratorFixer.cs index d6e93ba25..8a239a48a 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseRegexSourceGeneratorFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseRegexSourceGeneratorFixer.cs @@ -1,10 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Globalization; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; @@ -117,13 +112,13 @@ private static async Task ConvertToSourceGenerator(Document document, TryParseInt32(properties, UseRegexSourceGeneratorAnalyzerCommon.RegexOptionsIndexName), TryParseInt32(properties, UseRegexSourceGeneratorAnalyzerCommon.RegexTimeoutIndexName), }; - foreach (var index in indices.Where(value => value is not null).OrderByDescending(value => value)) + foreach (var index in indices.Where(value => value is not null).OrderDescending()) { arguments = arguments.RemoveAt(index.GetValueOrDefault()); } var createRegexMethod = generator.InvocationExpression(generator.IdentifierName(methodName)); - var method = generator.InvocationExpression(generator.MemberAccessExpression(createRegexMethod, invocationOperation.TargetMethod.Name), arguments.Select(arg => arg.Syntax).ToArray()); + var method = generator.InvocationExpression(generator.MemberAccessExpression(createRegexMethod, invocationOperation.TargetMethod.Name), [.. arguments.Select(arg => arg.Syntax)]); newTypeDeclaration = newTypeDeclaration.ReplaceNode(nodeToFix, method); } diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringComparerFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringComparerFixer.cs index e101c81e0..692bcc988 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringComparerFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringComparerFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringComparisonFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringComparisonFixer.cs index d16eb0c12..1e8a3ef22 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringComparisonFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringComparisonFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringCreateInsteadOfFormattableStringFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringCreateInsteadOfFormattableStringFixer.cs index 1d1803793..6a3415a88 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringCreateInsteadOfFormattableStringFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringCreateInsteadOfFormattableStringFixer.cs @@ -1,7 +1,5 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringEqualsFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringEqualsFixer.cs index ea8e163af..0e6baa656 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringEqualsFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStringEqualsFixer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Composition; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStructLayoutAttributeFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStructLayoutAttributeFixer.cs index 9cc33dcd1..4cf70f633 100644 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/UseStructLayoutAttributeFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/UseStructLayoutAttributeFixer.cs @@ -1,8 +1,6 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Composition; using System.Runtime.InteropServices; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer.CodeFixers/Rules/ValidateArgumentsCorrectlyFixer.cs b/src/Meziantou.Analyzer.CodeFixers/Rules/ValidateArgumentsCorrectlyFixer.cs index 58f24c40f..356cc333f 100755 --- a/src/Meziantou.Analyzer.CodeFixers/Rules/ValidateArgumentsCorrectlyFixer.cs +++ b/src/Meziantou.Analyzer.CodeFixers/Rules/ValidateArgumentsCorrectlyFixer.cs @@ -1,10 +1,5 @@ -using System.Collections.Generic; using System.Collections.Immutable; using System.Composition; -using System.Globalization; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; diff --git a/src/Meziantou.Analyzer/Configurations/AnalyzerOptionsExtensions.cs b/src/Meziantou.Analyzer/Configurations/AnalyzerOptionsExtensions.cs index 587cf09b9..62a783b61 100644 --- a/src/Meziantou.Analyzer/Configurations/AnalyzerOptionsExtensions.cs +++ b/src/Meziantou.Analyzer/Configurations/AnalyzerOptionsExtensions.cs @@ -1,6 +1,3 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Internals/AwaitableTypes.cs b/src/Meziantou.Analyzer/Internals/AwaitableTypes.cs index 4367fc391..e84d58931 100644 --- a/src/Meziantou.Analyzer/Internals/AwaitableTypes.cs +++ b/src/Meziantou.Analyzer/Internals/AwaitableTypes.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Threading; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Operations; diff --git a/src/Meziantou.Analyzer/Internals/ConcurrentHashSet.cs b/src/Meziantou.Analyzer/Internals/ConcurrentHashSet.cs index 2fec8bc50..04ffa7ae3 100644 --- a/src/Meziantou.Analyzer/Internals/ConcurrentHashSet.cs +++ b/src/Meziantou.Analyzer/Internals/ConcurrentHashSet.cs @@ -1,6 +1,5 @@ -using System.Collections.Concurrent; +using System.Collections.Concurrent; using System.Collections; -using System.Collections.Generic; namespace Meziantou.Analyzer.Internals; internal sealed class ConcurrentHashSet : ICollection, IReadOnlyCollection diff --git a/src/Meziantou.Analyzer/Internals/ContextExtensions.cs b/src/Meziantou.Analyzer/Internals/ContextExtensions.cs index 63a6353fc..008d45bbf 100755 --- a/src/Meziantou.Analyzer/Internals/ContextExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/ContextExtensions.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Immutable; using System.Data; -using System.Linq; -using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Operations; diff --git a/src/Meziantou.Analyzer/Internals/CultureSensitiveFormattingContext.cs b/src/Meziantou.Analyzer/Internals/CultureSensitiveFormattingContext.cs index c0c04845b..8385ee765 100755 --- a/src/Meziantou.Analyzer/Internals/CultureSensitiveFormattingContext.cs +++ b/src/Meziantou.Analyzer/Internals/CultureSensitiveFormattingContext.cs @@ -1,7 +1,4 @@ -using System; -using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Operations; namespace Meziantou.Analyzer.Internals; diff --git a/src/Meziantou.Analyzer/Internals/CultureSensitiveOptions.cs b/src/Meziantou.Analyzer/Internals/CultureSensitiveOptions.cs index 299820934..23775661e 100644 --- a/src/Meziantou.Analyzer/Internals/CultureSensitiveOptions.cs +++ b/src/Meziantou.Analyzer/Internals/CultureSensitiveOptions.cs @@ -1,5 +1,3 @@ -using System; - namespace Meziantou.Analyzer.Internals; [Flags] diff --git a/src/Meziantou.Analyzer/Internals/DiagnosticFieldReportOptions.cs b/src/Meziantou.Analyzer/Internals/DiagnosticFieldReportOptions.cs index 5d63e67b3..137b10914 100644 --- a/src/Meziantou.Analyzer/Internals/DiagnosticFieldReportOptions.cs +++ b/src/Meziantou.Analyzer/Internals/DiagnosticFieldReportOptions.cs @@ -1,5 +1,3 @@ -using System; - namespace Meziantou.Analyzer.Internals; [Flags] diff --git a/src/Meziantou.Analyzer/Internals/DiagnosticInvocationReportOptions.cs b/src/Meziantou.Analyzer/Internals/DiagnosticInvocationReportOptions.cs index 6aa0e8d2e..c0305c169 100644 --- a/src/Meziantou.Analyzer/Internals/DiagnosticInvocationReportOptions.cs +++ b/src/Meziantou.Analyzer/Internals/DiagnosticInvocationReportOptions.cs @@ -1,5 +1,3 @@ -using System; - namespace Meziantou.Analyzer.Internals; [Flags] diff --git a/src/Meziantou.Analyzer/Internals/DiagnosticMethodReportOptions.cs b/src/Meziantou.Analyzer/Internals/DiagnosticMethodReportOptions.cs index 71c283848..617c53a81 100644 --- a/src/Meziantou.Analyzer/Internals/DiagnosticMethodReportOptions.cs +++ b/src/Meziantou.Analyzer/Internals/DiagnosticMethodReportOptions.cs @@ -1,5 +1,3 @@ -using System; - namespace Meziantou.Analyzer.Internals; [Flags] diff --git a/src/Meziantou.Analyzer/Internals/DiagnosticParameterReportOptions.cs b/src/Meziantou.Analyzer/Internals/DiagnosticParameterReportOptions.cs index 8d05bac6b..d4303c0b0 100644 --- a/src/Meziantou.Analyzer/Internals/DiagnosticParameterReportOptions.cs +++ b/src/Meziantou.Analyzer/Internals/DiagnosticParameterReportOptions.cs @@ -1,5 +1,3 @@ -using System; - namespace Meziantou.Analyzer.Internals; [Flags] diff --git a/src/Meziantou.Analyzer/Internals/DiagnosticPropertyReportOptions.cs b/src/Meziantou.Analyzer/Internals/DiagnosticPropertyReportOptions.cs index 135b05bf8..5769c25aa 100644 --- a/src/Meziantou.Analyzer/Internals/DiagnosticPropertyReportOptions.cs +++ b/src/Meziantou.Analyzer/Internals/DiagnosticPropertyReportOptions.cs @@ -1,5 +1,3 @@ -using System; - namespace Meziantou.Analyzer.Internals; [Flags] diff --git a/src/Meziantou.Analyzer/Internals/DiagnosticReporter.cs b/src/Meziantou.Analyzer/Internals/DiagnosticReporter.cs index c9f275f9a..ab2fb63fe 100644 --- a/src/Meziantou.Analyzer/Internals/DiagnosticReporter.cs +++ b/src/Meziantou.Analyzer/Internals/DiagnosticReporter.cs @@ -1,5 +1,3 @@ -using System; -using System.Threading; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Internals/EnumerableExtensions.cs b/src/Meziantou.Analyzer/Internals/EnumerableExtensions.cs index c9675124b..90c9d4689 100644 --- a/src/Meziantou.Analyzer/Internals/EnumerableExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/EnumerableExtensions.cs @@ -1,7 +1,3 @@ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; - namespace Meziantou.Analyzer.Internals; internal static class EnumerableExtensions diff --git a/src/Meziantou.Analyzer/Internals/HashSetExtensions.cs b/src/Meziantou.Analyzer/Internals/HashSetExtensions.cs index 9c0bfb38d..abe543055 100644 --- a/src/Meziantou.Analyzer/Internals/HashSetExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/HashSetExtensions.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace Meziantou.Analyzer.Internals; internal static class HashSetExtensions { diff --git a/src/Meziantou.Analyzer/Internals/ListExtensions.cs b/src/Meziantou.Analyzer/Internals/ListExtensions.cs index bf5425f5a..3672a9087 100644 --- a/src/Meziantou.Analyzer/Internals/ListExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/ListExtensions.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace Meziantou.Analyzer.Internals; internal static class ListExtensions diff --git a/src/Meziantou.Analyzer/Internals/LocationExtensions.cs b/src/Meziantou.Analyzer/Internals/LocationExtensions.cs index 34a01931b..5daea14f8 100644 --- a/src/Meziantou.Analyzer/Internals/LocationExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/LocationExtensions.cs @@ -1,4 +1,3 @@ -using System.Threading; using Microsoft.CodeAnalysis; namespace Meziantou.Analyzer.Internals; diff --git a/src/Meziantou.Analyzer/Internals/MethodSymbolExtensions.cs b/src/Meziantou.Analyzer/Internals/MethodSymbolExtensions.cs index 824476c75..e39e60bdc 100755 --- a/src/Meziantou.Analyzer/Internals/MethodSymbolExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/MethodSymbolExtensions.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.CodeAnalysis; namespace Meziantou.Analyzer.Internals; diff --git a/src/Meziantou.Analyzer/Internals/ObjectPool.cs b/src/Meziantou.Analyzer/Internals/ObjectPool.cs index e00cc1170..f9670c314 100644 --- a/src/Meziantou.Analyzer/Internals/ObjectPool.cs +++ b/src/Meziantou.Analyzer/Internals/ObjectPool.cs @@ -1,9 +1,6 @@ #pragma warning disable MA0048 // File name must match type name #pragma warning disable RS1035 // Do not use APIs banned for analyzers using System.Collections.Concurrent; -using System.Threading; -using System; -using System.Text; namespace Meziantou.Analyzer.Internals; @@ -128,7 +125,7 @@ public DefaultObjectPool(IPooledObjectPolicy policy, int maximumRetained) public override T Get() { var item = FastItem; - if (item == null || Interlocked.CompareExchange(ref FastItem, null, item) != item) + if (item == null || Interlocked.CompareExchange(ref FastItem, value: null, item) != item) { if (Items.TryDequeue(out item)) { diff --git a/src/Meziantou.Analyzer/Internals/OperationExtensions.cs b/src/Meziantou.Analyzer/Internals/OperationExtensions.cs index b877367c8..4e0174886 100644 --- a/src/Meziantou.Analyzer/Internals/OperationExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/OperationExtensions.cs @@ -1,7 +1,3 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Internals/OverloadFinder.cs b/src/Meziantou.Analyzer/Internals/OverloadFinder.cs index a89847cbd..a1ca6eeb8 100644 --- a/src/Meziantou.Analyzer/Internals/OverloadFinder.cs +++ b/src/Meziantou.Analyzer/Internals/OverloadFinder.cs @@ -1,5 +1,4 @@ using System.Collections.Immutable; -using System.Linq; using Microsoft.CodeAnalysis; namespace Meziantou.Analyzer.Internals; @@ -64,7 +63,7 @@ public bool HasOverloadWithAdditionalParameterOfType( if (additionalParameterTypes is null) return null; - additionalParameterTypes = additionalParameterTypes.Where(type => type is not null).ToArray(); + additionalParameterTypes = [.. additionalParameterTypes.Where(type => type is not null)]; if (additionalParameterTypes.Length == 0) return null; diff --git a/src/Meziantou.Analyzer/Internals/StringExtensions.cs b/src/Meziantou.Analyzer/Internals/StringExtensions.cs index 1b3a2b5fa..6ad4921a6 100644 --- a/src/Meziantou.Analyzer/Internals/StringExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/StringExtensions.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Meziantou.Analyzer.Internals; diff --git a/src/Meziantou.Analyzer/Internals/SuppressorHelpers.cs b/src/Meziantou.Analyzer/Internals/SuppressorHelpers.cs index e8c94012f..c84d26a98 100644 --- a/src/Meziantou.Analyzer/Internals/SuppressorHelpers.cs +++ b/src/Meziantou.Analyzer/Internals/SuppressorHelpers.cs @@ -1,4 +1,3 @@ -using System.Threading; using Microsoft.CodeAnalysis; namespace Meziantou.Analyzer.Internals; diff --git a/src/Meziantou.Analyzer/Internals/SymbolExtensions.cs b/src/Meziantou.Analyzer/Internals/SymbolExtensions.cs index 4452256d4..acaf0eb44 100644 --- a/src/Meziantou.Analyzer/Internals/SymbolExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/SymbolExtensions.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading; using Microsoft.CodeAnalysis; namespace Meziantou.Analyzer.Internals; @@ -20,9 +17,7 @@ public static bool IsVisibleOutsideOfAssembly([NotNullWhen(true)] this ISymbol? if (symbol is null) return false; - if (symbol.DeclaredAccessibility != Accessibility.Public && - symbol.DeclaredAccessibility != Accessibility.Protected && - symbol.DeclaredAccessibility != Accessibility.ProtectedOrInternal) + if (symbol.DeclaredAccessibility is not Accessibility.Public and not Accessibility.Protected and not Accessibility.ProtectedOrInternal) { return false; } diff --git a/src/Meziantou.Analyzer/Internals/SyntaxNodeExtensions.cs b/src/Meziantou.Analyzer/Internals/SyntaxNodeExtensions.cs index f4c37cc7c..5018b7c03 100644 --- a/src/Meziantou.Analyzer/Internals/SyntaxNodeExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/SyntaxNodeExtensions.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using Microsoft.CodeAnalysis; namespace Meziantou.Analyzer.Internals; diff --git a/src/Meziantou.Analyzer/Internals/SyntaxTokenListExtensions.cs b/src/Meziantou.Analyzer/Internals/SyntaxTokenListExtensions.cs index 486dcbf66..e3b366030 100644 --- a/src/Meziantou.Analyzer/Internals/SyntaxTokenListExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/SyntaxTokenListExtensions.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/Meziantou.Analyzer/Internals/TimeSpanOperation.cs b/src/Meziantou.Analyzer/Internals/TimeSpanOperation.cs index 2c0400917..8b424cd89 100644 --- a/src/Meziantou.Analyzer/Internals/TimeSpanOperation.cs +++ b/src/Meziantou.Analyzer/Internals/TimeSpanOperation.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Operations; diff --git a/src/Meziantou.Analyzer/Internals/TypeSymbolExtensions.cs b/src/Meziantou.Analyzer/Internals/TypeSymbolExtensions.cs index 7e26287d8..98ca2e8d1 100755 --- a/src/Meziantou.Analyzer/Internals/TypeSymbolExtensions.cs +++ b/src/Meziantou.Analyzer/Internals/TypeSymbolExtensions.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; using Microsoft.CodeAnalysis; namespace Meziantou.Analyzer.Internals; diff --git a/src/Meziantou.Analyzer/Meziantou.Analyzer.csproj b/src/Meziantou.Analyzer/Meziantou.Analyzer.csproj index 57b7855b8..6df946162 100644 --- a/src/Meziantou.Analyzer/Meziantou.Analyzer.csproj +++ b/src/Meziantou.Analyzer/Meziantou.Analyzer.csproj @@ -1,6 +1,6 @@  - net9.0;netstandard2.0 + net10.0;netstandard2.0 false 1.0.1 diff --git a/src/Meziantou.Analyzer/RuleIdentifiers.cs b/src/Meziantou.Analyzer/RuleIdentifiers.cs index 0afe37099..64a7420b3 100755 --- a/src/Meziantou.Analyzer/RuleIdentifiers.cs +++ b/src/Meziantou.Analyzer/RuleIdentifiers.cs @@ -1,5 +1,3 @@ -using System.Globalization; - namespace Meziantou.Analyzer; internal static class RuleIdentifiers diff --git a/src/Meziantou.Analyzer/Rules/AddOverloadWithSpanOrMemoryAnalyzer.cs b/src/Meziantou.Analyzer/Rules/AddOverloadWithSpanOrMemoryAnalyzer.cs index cfe6041fb..b99a1ded4 100644 --- a/src/Meziantou.Analyzer/Rules/AddOverloadWithSpanOrMemoryAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/AddOverloadWithSpanOrMemoryAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzer.cs index c7e3e5978..ce48df78c 100644 --- a/src/Meziantou.Analyzer/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzer.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; -using System.Threading; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Rules/AvoidClosureWhenUsingConcurrentDictionaryAnalyzer.cs b/src/Meziantou.Analyzer/Rules/AvoidClosureWhenUsingConcurrentDictionaryAnalyzer.cs index a4e7e39e2..76c458135 100644 --- a/src/Meziantou.Analyzer/Rules/AvoidClosureWhenUsingConcurrentDictionaryAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/AvoidClosureWhenUsingConcurrentDictionaryAnalyzer.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Rules/AvoidComparisonWithBoolConstantAnalyzer.cs b/src/Meziantou.Analyzer/Rules/AvoidComparisonWithBoolConstantAnalyzer.cs index e796aff50..1a63feb50 100644 --- a/src/Meziantou.Analyzer/Rules/AvoidComparisonWithBoolConstantAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/AvoidComparisonWithBoolConstantAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Globalization; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Rules/AvoidUsingRedundantElseAnalyzer.cs b/src/Meziantou.Analyzer/Rules/AvoidUsingRedundantElseAnalyzer.cs index aa8978e5a..12a631959 100644 --- a/src/Meziantou.Analyzer/Rules/AvoidUsingRedundantElseAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/AvoidUsingRedundantElseAnalyzer.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/Meziantou.Analyzer/Rules/AvoidUsingRedundantElseAnalyzerCommon.cs b/src/Meziantou.Analyzer/Rules/AvoidUsingRedundantElseAnalyzerCommon.cs index 90a6f036d..62cd72d74 100644 --- a/src/Meziantou.Analyzer/Rules/AvoidUsingRedundantElseAnalyzerCommon.cs +++ b/src/Meziantou.Analyzer/Rules/AvoidUsingRedundantElseAnalyzerCommon.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Rules/AwaitTaskBeforeDisposingResourcesAnalyzer.cs b/src/Meziantou.Analyzer/Rules/AwaitTaskBeforeDisposingResourcesAnalyzer.cs index cf336ae25..35b612378 100644 --- a/src/Meziantou.Analyzer/Rules/AwaitTaskBeforeDisposingResourcesAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/AwaitTaskBeforeDisposingResourcesAnalyzer.cs @@ -1,6 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; -using System.Threading.Tasks; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/ClassMustBeSealedAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ClassMustBeSealedAnalyzer.cs index b225dadad..db3c9aded 100644 --- a/src/Meziantou.Analyzer/Rules/ClassMustBeSealedAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ClassMustBeSealedAnalyzer.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; -using System.Threading; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; @@ -113,7 +110,7 @@ private bool IsPotentialSealed(AnalyzerOptions options, INamedTypeSymbol symbol, if (symbol.GetMembers().Any(member => member.IsVirtual) && !SealedClassWithVirtualMember(options, symbol)) return false; - var canBeInheritedOutsideOfAssembly = symbol.IsVisibleOutsideOfAssembly() && symbol.GetMembers().OfType().Where(member => member.MethodKind is MethodKind.Constructor).Any(member => member.IsVisibleOutsideOfAssembly()); + var canBeInheritedOutsideOfAssembly = symbol.IsVisibleOutsideOfAssembly() && symbol.GetMembers().OfType().Any(member => member.MethodKind is MethodKind.Constructor && member.IsVisibleOutsideOfAssembly()); if (canBeInheritedOutsideOfAssembly && !PublicClassShouldBeSealed(options, symbol)) return false; diff --git a/src/Meziantou.Analyzer/Rules/ConstructorArgumentParametersShouldExistInConstructorsAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ConstructorArgumentParametersShouldExistInConstructorsAnalyzer.cs index c2bd3d39d..7dfcff417 100644 --- a/src/Meziantou.Analyzer/Rules/ConstructorArgumentParametersShouldExistInConstructorsAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ConstructorArgumentParametersShouldExistInConstructorsAnalyzer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/DebuggerDisplayAttributeShouldContainValidExpressionsAnalyzer.cs b/src/Meziantou.Analyzer/Rules/DebuggerDisplayAttributeShouldContainValidExpressionsAnalyzer.cs index 5437e8209..d4611f279 100644 --- a/src/Meziantou.Analyzer/Rules/DebuggerDisplayAttributeShouldContainValidExpressionsAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/DebuggerDisplayAttributeShouldContainValidExpressionsAnalyzer.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; -using System.Diagnostics.SymbolStore; -using System.Globalization; -using System.Linq; -using System.Linq.Expressions; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -209,7 +203,7 @@ private static bool IsValid(Compilation compilation, ISymbol rootSymbol, List.Result), StringComparison.Ordinal)) + if (string.Equals(operation.Property.Name, nameof(Task<>.Result), StringComparison.Ordinal)) { if (operation.Member.ContainingType.OriginalDefinition.IsEqualToAny(TaskOfTSymbol, ValueTaskOfTSymbol)) { diff --git a/src/Meziantou.Analyzer/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzer.cs b/src/Meziantou.Analyzer/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzer.cs index f6b659bae..c990a6ca5 100644 --- a/src/Meziantou.Analyzer/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzer.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; @@ -34,7 +32,7 @@ public override void Initialize(AnalysisContext context) private static void Analyze(OperationAnalysisContext context) { var operation = (IPropertyReferenceOperation)context.Operation; - if (!string.Equals(operation.Member.Name, nameof(EqualityComparer.Default), StringComparison.Ordinal)) + if (!string.Equals(operation.Member.Name, nameof(EqualityComparer<>.Default), StringComparison.Ordinal)) return; var equalityComparerSymbol = context.Compilation.GetBestTypeByMetadataName("System.Collections.Generic.EqualityComparer`1"); diff --git a/src/Meziantou.Analyzer/Rules/DoNotUseEqualityOperatorsForSpanOfCharAnalyzer.cs b/src/Meziantou.Analyzer/Rules/DoNotUseEqualityOperatorsForSpanOfCharAnalyzer.cs index 14182096a..3918b8a5b 100644 --- a/src/Meziantou.Analyzer/Rules/DoNotUseEqualityOperatorsForSpanOfCharAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/DoNotUseEqualityOperatorsForSpanOfCharAnalyzer.cs @@ -1,4 +1,4 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -45,8 +45,7 @@ private sealed class AnalyzerContext(Compilation compilation, params INamedTypeS public void AnalyzeBinaryOperator(OperationAnalysisContext context) { var operation = (IBinaryOperation)context.Operation; - if (operation.OperatorKind == BinaryOperatorKind.Equals || - operation.OperatorKind == BinaryOperatorKind.NotEquals) + if (operation.OperatorKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals) { if (!IsSpanOfString(operation.LeftOperand.Type) || !IsSpanOfString(operation.RightOperand.Type)) return; diff --git a/src/Meziantou.Analyzer/Rules/DoNotUseServerCertificateValidationCallbackAnalyzer.cs b/src/Meziantou.Analyzer/Rules/DoNotUseServerCertificateValidationCallbackAnalyzer.cs index 8872aff55..21e59824b 100644 --- a/src/Meziantou.Analyzer/Rules/DoNotUseServerCertificateValidationCallbackAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/DoNotUseServerCertificateValidationCallbackAnalyzer.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/DoNotUseToStringIfObjectAnalyzer.cs b/src/Meziantou.Analyzer/Rules/DoNotUseToStringIfObjectAnalyzer.cs index 6cf2a2abe..08851be2e 100644 --- a/src/Meziantou.Analyzer/Rules/DoNotUseToStringIfObjectAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/DoNotUseToStringIfObjectAnalyzer.cs @@ -1,6 +1,5 @@ -using System.Collections.Concurrent; +using System.Collections.Concurrent; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzer.cs b/src/Meziantou.Analyzer/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzer.cs index 2627802d9..c176ed5f4 100644 --- a/src/Meziantou.Analyzer/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzer.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Concurrent; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/DontUseDangerousThreadingMethodsAnalyzer.cs b/src/Meziantou.Analyzer/Rules/DontUseDangerousThreadingMethodsAnalyzer.cs index 692f0ba53..94f591293 100644 --- a/src/Meziantou.Analyzer/Rules/DontUseDangerousThreadingMethodsAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/DontUseDangerousThreadingMethodsAnalyzer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/DotNotUseNameFromBCLAnalyzer.cs b/src/Meziantou.Analyzer/Rules/DotNotUseNameFromBCLAnalyzer.cs index f68e1ca8f..2b447aece 100644 --- a/src/Meziantou.Analyzer/Rules/DotNotUseNameFromBCLAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/DotNotUseNameFromBCLAnalyzer.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.IO; using System.Text.RegularExpressions; -using System.Threading; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/EmbedCaughtExceptionAsInnerExceptionAnalyzer.cs b/src/Meziantou.Analyzer/Rules/EmbedCaughtExceptionAsInnerExceptionAnalyzer.cs index e4e5f71a3..dbd71a21f 100644 --- a/src/Meziantou.Analyzer/Rules/EmbedCaughtExceptionAsInnerExceptionAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/EmbedCaughtExceptionAsInnerExceptionAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/EqualityShouldBeCorrectlyImplementedAnalyzer.cs b/src/Meziantou.Analyzer/Rules/EqualityShouldBeCorrectlyImplementedAnalyzer.cs index 4ae180f8e..bc7cc5b37 100644 --- a/src/Meziantou.Analyzer/Rules/EqualityShouldBeCorrectlyImplementedAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/EqualityShouldBeCorrectlyImplementedAnalyzer.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/EventsShouldHaveProperArgumentsAnalyzer.cs b/src/Meziantou.Analyzer/Rules/EventsShouldHaveProperArgumentsAnalyzer.cs index 9ad51062c..56b08eb5c 100644 --- a/src/Meziantou.Analyzer/Rules/EventsShouldHaveProperArgumentsAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/EventsShouldHaveProperArgumentsAnalyzer.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Threading; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/FileNameMustMatchTypeNameAnalyzer.cs b/src/Meziantou.Analyzer/Rules/FileNameMustMatchTypeNameAnalyzer.cs index a94bb667a..d4aff6895 100644 --- a/src/Meziantou.Analyzer/Rules/FileNameMustMatchTypeNameAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/FileNameMustMatchTypeNameAnalyzer.cs @@ -1,7 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Globalization; -using System.Linq; using System.Text.RegularExpressions; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -113,7 +110,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context) continue; // Type{T} - if (fileName.Equals((symbolName + '{' + string.Join(",", symbol.TypeParameters.Select(t => t.Name)) + '}').AsSpan(), StringComparison.OrdinalIgnoreCase)) + if (fileName.Equals((symbolName + '{' + string.Join(',', symbol.TypeParameters.Select(t => t.Name)) + '}').AsSpan(), StringComparison.OrdinalIgnoreCase)) continue; } diff --git a/src/Meziantou.Analyzer/Rules/FixToDoAnalyzer.cs b/src/Meziantou.Analyzer/Rules/FixToDoAnalyzer.cs index 8756ae248..623725c76 100644 --- a/src/Meziantou.Analyzer/Rules/FixToDoAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/FixToDoAnalyzer.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/Meziantou.Analyzer/Rules/LocalVariablesShouldNotHideSymbolsAnalyzer.cs b/src/Meziantou.Analyzer/Rules/LocalVariablesShouldNotHideSymbolsAnalyzer.cs index bf71d28d7..d35e926e3 100644 --- a/src/Meziantou.Analyzer/Rules/LocalVariablesShouldNotHideSymbolsAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/LocalVariablesShouldNotHideSymbolsAnalyzer.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Threading; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/Meziantou.Analyzer/Rules/LoggerParameterTypeAnalyzer.cs b/src/Meziantou.Analyzer/Rules/LoggerParameterTypeAnalyzer.cs index 78194787b..887636734 100644 --- a/src/Meziantou.Analyzer/Rules/LoggerParameterTypeAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/LoggerParameterTypeAnalyzer.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Globalization; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Operations; -using System.Diagnostics.CodeAnalysis; -using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; -using System.IO; using Microsoft.CodeAnalysis.Text; using Meziantou.Analyzer.Configurations; using Microsoft.CodeAnalysis.CSharp; @@ -213,7 +207,7 @@ LoggerConfigurationFile LoadConfiguration() if (attribute.ConstructorArguments is [{ Type.SpecialType: SpecialType.System_String, IsNull: false, Value: string name }, TypedConstant { Kind: TypedConstantKind.Array } types]) { - configuration[name] = types.Values.Select(v => v.Value as ITypeSymbol).WhereNotNull().ToArray(); + configuration[name] = [.. types.Values.Select(v => v.Value as ITypeSymbol).WhereNotNull()]; } } } @@ -335,7 +329,7 @@ public void AnalyzeInvocationDeclaration(OperationAnalysisContext context) return; formatExpression = arg.Value; - argumentTypes = operation.TargetMethod.TypeArguments.Select((arg, index) => ((ITypeSymbol?)arg, GetSyntaxNode(operation, index))).ToArray(); + argumentTypes = [.. operation.TargetMethod.TypeArguments.Select((arg, index) => ((ITypeSymbol?)arg, GetSyntaxNode(operation, index)))]; static SyntaxNode GetSyntaxNode(IOperation operation, int index) { @@ -364,7 +358,7 @@ static SyntaxNode GetSyntaxNode(IOperation operation, int index) { if (argument.ArgumentKind == ArgumentKind.ParamArray && argument.Value is IArrayCreationOperation arrayCreation && arrayCreation.Initializer is not null) { - argumentTypes = arrayCreation.Initializer.ElementValues.Select(v => (v.UnwrapImplicitConversionOperations().Type, v.Syntax)).ToArray(); + argumentTypes = [.. arrayCreation.Initializer.ElementValues.Select(v => (v.UnwrapImplicitConversionOperations().Type, v.Syntax))]; } } } @@ -384,13 +378,13 @@ static SyntaxNode GetSyntaxNode(IOperation operation, int index) if (argument.ArgumentKind == ArgumentKind.ParamArray && argument.Value is IArrayCreationOperation arrayCreation && arrayCreation.Initializer is not null) { - argumentTypes = arrayCreation.Initializer.ElementValues.Select(v => (v.UnwrapImplicitConversionOperations().Type, v.Syntax)).ToArray(); + argumentTypes = [.. arrayCreation.Initializer.ElementValues.Select(v => (v.UnwrapImplicitConversionOperations().Type, v.Syntax))]; } } if (operation.Arguments.Length >= templateIndex && argumentTypes is null) { - argumentTypes = operation.Arguments.Skip(templateIndex + 1).Select(v => (v.Value.UnwrapImplicitConversionOperations().Type, v.Syntax)).ToArray(); + argumentTypes = [.. operation.Arguments.Skip(templateIndex + 1).Select(v => (v.Value.UnwrapImplicitConversionOperations().Type, v.Syntax))]; } } diff --git a/src/Meziantou.Analyzer/Rules/MakeClassStaticAnalyzer.cs b/src/Meziantou.Analyzer/Rules/MakeClassStaticAnalyzer.cs index f9ac25851..e7245ed14 100644 --- a/src/Meziantou.Analyzer/Rules/MakeClassStaticAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/MakeClassStaticAnalyzer.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; -using System.Threading; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/MakeInterpolatedStringAnalyzer.cs b/src/Meziantou.Analyzer/Rules/MakeInterpolatedStringAnalyzer.cs index c0b0970d2..964722007 100644 --- a/src/Meziantou.Analyzer/Rules/MakeInterpolatedStringAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/MakeInterpolatedStringAnalyzer.cs @@ -1,11 +1,9 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Operations; namespace Meziantou.Analyzer.Rules; diff --git a/src/Meziantou.Analyzer/Rules/MakeMemberReadOnlyAnalyzer.cs b/src/Meziantou.Analyzer/Rules/MakeMemberReadOnlyAnalyzer.cs index e8428ad9a..0ab470e45 100644 --- a/src/Meziantou.Analyzer/Rules/MakeMemberReadOnlyAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/MakeMemberReadOnlyAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/Meziantou.Analyzer/Rules/MakeMethodStaticAnalyzer.cs b/src/Meziantou.Analyzer/Rules/MakeMethodStaticAnalyzer.cs index 012da045b..604807716 100644 --- a/src/Meziantou.Analyzer/Rules/MakeMethodStaticAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/MakeMethodStaticAnalyzer.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/Meziantou.Analyzer/Rules/MethodOverridesShouldNotChangeParameterDefaultsAnalyzer.cs b/src/Meziantou.Analyzer/Rules/MethodOverridesShouldNotChangeParameterDefaultsAnalyzer.cs index fc6b663a6..d5601a4ab 100644 --- a/src/Meziantou.Analyzer/Rules/MethodOverridesShouldNotChangeParameterDefaultsAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/MethodOverridesShouldNotChangeParameterDefaultsAnalyzer.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Threading; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -99,6 +97,6 @@ private static string GetParameterDisplayValue(IParameterSymbol parameter) return "null"; } - return FormattableString.Invariant($"'{parameter.ExplicitDefaultValue}'"); + return string.Create(CultureInfo.InvariantCulture, $"'{parameter.ExplicitDefaultValue}'"); } } diff --git a/src/Meziantou.Analyzer/Rules/MethodShouldNotBeTooLongAnalyzer.cs b/src/Meziantou.Analyzer/Rules/MethodShouldNotBeTooLongAnalyzer.cs index d24fbe85a..9b30e3bd2 100644 --- a/src/Meziantou.Analyzer/Rules/MethodShouldNotBeTooLongAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/MethodShouldNotBeTooLongAnalyzer.cs @@ -1,6 +1,4 @@ -using System.Collections.Immutable; -using System.Globalization; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; @@ -161,7 +159,7 @@ bool ShouldDescendIntoChildren(SyntaxNode node) static bool IsCountableStatement(StatementSyntax statement) { - if (statement is BlockSyntax || statement is LocalFunctionStatementSyntax) + if (statement is BlockSyntax or LocalFunctionStatementSyntax) return false; return true; diff --git a/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs b/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs index e574dcb1c..58b34cc81 100644 --- a/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/NamedParameterAnalyzer.cs b/src/Meziantou.Analyzer/Rules/NamedParameterAnalyzer.cs index 55096749b..9fcbbde2d 100644 --- a/src/Meziantou.Analyzer/Rules/NamedParameterAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/NamedParameterAnalyzer.cs @@ -1,11 +1,7 @@ -using System; using System.Collections.Immutable; -using System.Globalization; using System.Linq.Expressions; using System.Reflection; using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; @@ -36,29 +32,29 @@ public override void Initialize(AnalysisContext context) context.EnableConcurrentExecution(); context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None); - context.RegisterCompilationStartAction(compilationContext => + context.RegisterCompilationStartAction(context => { - var callerMustUseNamedArgumentType = compilationContext.Compilation.GetBestTypeByMetadataName("Meziantou.Analyzer.Annotations.RequireNamedArgumentAttribute"); - - var objectType = compilationContext.Compilation.GetSpecialType(SpecialType.System_Object); - var taskTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.Task"); - var taskGenericTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.Task`1"); - var valueTaskTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.ValueTask"); - var valueTaskGenericTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.ValueTask`1"); - var taskCompletionSourceType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.TaskCompletionSource`1"); - var methodBaseTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Reflection.MethodBase"); - var fieldInfoTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Reflection.FieldInfo"); - var propertyInfoTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Reflection.PropertyInfo"); - var msTestAssertTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("Microsoft.VisualStudio.TestTools.UnitTesting.Assert"); - var nunitAssertTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("NUnit.Framework.Assert"); - var xunitAssertTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("Xunit.Assert"); - var keyValuePairTokenType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Collection.Generic.KeyValuePair`2"); - var propertyBuilderType = compilationContext.Compilation.GetBestTypeByMetadataName("Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder`1"); - var syntaxNodeType = compilationContext.Compilation.GetBestTypeByMetadataName("Microsoft.CodeAnalysis.SyntaxNode"); - var expressionType = compilationContext.Compilation.GetBestTypeByMetadataName("System.Linq.Expressions.Expression"); - var operationUtilities = new OperationUtilities(compilationContext.Compilation); - - compilationContext.RegisterSyntaxNodeAction(syntaxContext => + var callerMustUseNamedArgumentType = context.Compilation.GetBestTypeByMetadataName("Meziantou.Analyzer.Annotations.RequireNamedArgumentAttribute"); + + var objectType = context.Compilation.GetSpecialType(SpecialType.System_Object); + var taskTokenType = context.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.Task"); + var taskGenericTokenType = context.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.Task`1"); + var valueTaskTokenType = context.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.ValueTask"); + var valueTaskGenericTokenType = context.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.ValueTask`1"); + var taskCompletionSourceType = context.Compilation.GetBestTypeByMetadataName("System.Threading.Tasks.TaskCompletionSource`1"); + var methodBaseTokenType = context.Compilation.GetBestTypeByMetadataName("System.Reflection.MethodBase"); + var fieldInfoTokenType = context.Compilation.GetBestTypeByMetadataName("System.Reflection.FieldInfo"); + var propertyInfoTokenType = context.Compilation.GetBestTypeByMetadataName("System.Reflection.PropertyInfo"); + var msTestAssertTokenType = context.Compilation.GetBestTypeByMetadataName("Microsoft.VisualStudio.TestTools.UnitTesting.Assert"); + var nunitAssertTokenType = context.Compilation.GetBestTypeByMetadataName("NUnit.Framework.Assert"); + var xunitAssertTokenType = context.Compilation.GetBestTypeByMetadataName("Xunit.Assert"); + var keyValuePairTokenType = context.Compilation.GetBestTypeByMetadataName("System.Collection.Generic.KeyValuePair`2"); + var propertyBuilderType = context.Compilation.GetBestTypeByMetadataName("Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder`1"); + var syntaxNodeType = context.Compilation.GetBestTypeByMetadataName("Microsoft.CodeAnalysis.SyntaxNode"); + var expressionType = context.Compilation.GetBestTypeByMetadataName("System.Linq.Expressions.Expression"); + var operationUtilities = new OperationUtilities(context.Compilation); + + context.RegisterSyntaxNodeAction(syntaxContext => { var argument = (ArgumentSyntax)syntaxContext.Node; if (argument.NameColon is not null) @@ -220,10 +216,10 @@ bool IsParams(SyntaxNode node) if (IsMethod(invokedMethodSymbol, valueTaskTokenType, nameof(Task.FromResult))) return; - if (IsMethod(invokedMethodSymbol, taskCompletionSourceType, nameof(TaskCompletionSource.SetResult))) + if (IsMethod(invokedMethodSymbol, taskCompletionSourceType, nameof(TaskCompletionSource<>.SetResult))) return; - if (IsMethod(invokedMethodSymbol, taskCompletionSourceType, nameof(TaskCompletionSource.TrySetResult))) + if (IsMethod(invokedMethodSymbol, taskCompletionSourceType, nameof(TaskCompletionSource<>.TrySetResult))) return; if (IsMethod(invokedMethodSymbol, methodBaseTokenType, nameof(MethodBase.Invoke)) && argumentIndex == 0) diff --git a/src/Meziantou.Analyzer/Rules/NonFlagsEnumsShouldNotBeMarkedWithFlagsAttributeAnalyzer.cs b/src/Meziantou.Analyzer/Rules/NonFlagsEnumsShouldNotBeMarkedWithFlagsAttributeAnalyzer.cs index 337ba18b5..3f6131d35 100644 --- a/src/Meziantou.Analyzer/Rules/NonFlagsEnumsShouldNotBeMarkedWithFlagsAttributeAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/NonFlagsEnumsShouldNotBeMarkedWithFlagsAttributeAnalyzer.cs @@ -1,7 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; -using System.Linq; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/NullableAttributeUsageAnalyzer.cs b/src/Meziantou.Analyzer/Rules/NullableAttributeUsageAnalyzer.cs index c65cfef48..b301b9aa5 100644 --- a/src/Meziantou.Analyzer/Rules/NullableAttributeUsageAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/NullableAttributeUsageAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/OptimizeLinqUsageAnalyzer.cs b/src/Meziantou.Analyzer/Rules/OptimizeLinqUsageAnalyzer.cs index b6c59ee93..3e9df6661 100755 --- a/src/Meziantou.Analyzer/Rules/OptimizeLinqUsageAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/OptimizeLinqUsageAnalyzer.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Globalization; -using System.Linq; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; @@ -10,7 +6,6 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Operations; -using static System.FormattableString; namespace Meziantou.Analyzer.Rules; @@ -566,7 +561,7 @@ private void OptimizeCountUsage(OperationAnalysisContext context, IInvocationOpe // expr.Count() == 1 if (!HasTake(operation, ExtensionMethodOwnerTypes)) { - message = Invariant($"Replace 'Count() == {value}' with 'Take({value + 1}).Count() == {value}'"); + message = string.Create(CultureInfo.InvariantCulture, $"Replace 'Count() == {value}' with 'Take({value + 1}).Count() == {value}'"); properties = CreateProperties(OptimizeLinqUsageData.UseTakeAndCount); } } @@ -591,7 +586,7 @@ private void OptimizeCountUsage(OperationAnalysisContext context, IInvocationOpe // expr.Count() != 1 if (!HasTake(operation, ExtensionMethodOwnerTypes)) { - message = Invariant($"Replace 'Count() != {value}' with 'Take({value + 1}).Count() != {value}'"); + message = string.Create(CultureInfo.InvariantCulture, $"Replace 'Count() != {value}' with 'Take({value + 1}).Count() != {value}'"); properties = CreateProperties(OptimizeLinqUsageData.UseTakeAndCount); } } @@ -614,7 +609,7 @@ private void OptimizeCountUsage(OperationAnalysisContext context, IInvocationOpe else { // expr.Count() < 10 - message = Invariant($"Replace 'Count() < {value}' with 'Skip({value - 1}).Any() == false'"); + message = string.Create(CultureInfo.InvariantCulture, $"Replace 'Count() < {value}' with 'Skip({value - 1}).Any() == false'"); properties = CreateProperties(OptimizeLinqUsageData.UseSkipAndNotAny) .Add("SkipMinusOne", value: ""); } @@ -637,7 +632,7 @@ private void OptimizeCountUsage(OperationAnalysisContext context, IInvocationOpe else { // expr.Count() < 10 - message = Invariant($"Replace 'Count() <= {value}' with 'Skip({value}).Any() == false'"); + message = string.Create(CultureInfo.InvariantCulture, $"Replace 'Count() <= {value}' with 'Skip({value}).Any() == false'"); properties = CreateProperties(OptimizeLinqUsageData.UseSkipAndNotAny); } @@ -659,7 +654,7 @@ private void OptimizeCountUsage(OperationAnalysisContext context, IInvocationOpe else { // expr.Count() > 1 - message = Invariant($"Replace 'Count() > {value}' with 'Skip({value}).Any()'"); + message = string.Create(CultureInfo.InvariantCulture, $"Replace 'Count() > {value}' with 'Skip({value}).Any()'"); properties = CreateProperties(OptimizeLinqUsageData.UseSkipAndAny); } @@ -681,7 +676,7 @@ private void OptimizeCountUsage(OperationAnalysisContext context, IInvocationOpe else { // expr.Count() >= 2 - message = Invariant($"Replace 'Count() >= {value}' with 'Skip({value - 1}).Any()'"); + message = string.Create(CultureInfo.InvariantCulture, $"Replace 'Count() >= {value}' with 'Skip({value - 1}).Any()'"); properties = CreateProperties(OptimizeLinqUsageData.UseSkipAndAny) .Add("SkipMinusOne", value: ""); } diff --git a/src/Meziantou.Analyzer/Rules/OptimizeStartsWithAnalyzer.cs b/src/Meziantou.Analyzer/Rules/OptimizeStartsWithAnalyzer.cs index fbe6b2a3c..e58bd3328 100644 --- a/src/Meziantou.Analyzer/Rules/OptimizeStartsWithAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/OptimizeStartsWithAnalyzer.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/OptimizeStringBuilderUsageAnalyzer.cs b/src/Meziantou.Analyzer/Rules/OptimizeStringBuilderUsageAnalyzer.cs index 704cdaf39..87e352dff 100644 --- a/src/Meziantou.Analyzer/Rules/OptimizeStringBuilderUsageAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/OptimizeStringBuilderUsageAnalyzer.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; -using System.Text; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/OptimizeStringBuilderUsageAnalyzerCommon.cs b/src/Meziantou.Analyzer/Rules/OptimizeStringBuilderUsageAnalyzerCommon.cs index 4e0cb48db..aede1967e 100644 --- a/src/Meziantou.Analyzer/Rules/OptimizeStringBuilderUsageAnalyzerCommon.cs +++ b/src/Meziantou.Analyzer/Rules/OptimizeStringBuilderUsageAnalyzerCommon.cs @@ -1,4 +1,3 @@ -using System.Text; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Operations; diff --git a/src/Meziantou.Analyzer/Rules/ParameterAttributeForRazorComponentAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ParameterAttributeForRazorComponentAnalyzer.cs index cbb6d2d9f..92c7bbe16 100644 --- a/src/Meziantou.Analyzer/Rules/ParameterAttributeForRazorComponentAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ParameterAttributeForRazorComponentAnalyzer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/PreferReturningCollectionAbstractionInsteadOfImplementationAnalyzer.cs b/src/Meziantou.Analyzer/Rules/PreferReturningCollectionAbstractionInsteadOfImplementationAnalyzer.cs index c825703c4..e7529139b 100644 --- a/src/Meziantou.Analyzer/Rules/PreferReturningCollectionAbstractionInsteadOfImplementationAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/PreferReturningCollectionAbstractionInsteadOfImplementationAnalyzer.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/PreserveParamsOnOverrideAnalyzer.cs b/src/Meziantou.Analyzer/Rules/PreserveParamsOnOverrideAnalyzer.cs index 97a8626b0..13a683730 100644 --- a/src/Meziantou.Analyzer/Rules/PreserveParamsOnOverrideAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/PreserveParamsOnOverrideAnalyzer.cs @@ -1,6 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; -using System.Threading; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Rules/PrimaryConstructorParameterShouldBeReadOnlyAnalyzer.cs b/src/Meziantou.Analyzer/Rules/PrimaryConstructorParameterShouldBeReadOnlyAnalyzer.cs index 2f9e203c0..d1fe35838 100644 --- a/src/Meziantou.Analyzer/Rules/PrimaryConstructorParameterShouldBeReadOnlyAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/PrimaryConstructorParameterShouldBeReadOnlyAnalyzer.cs @@ -1,8 +1,5 @@ -#if CSHARP12_OR_GREATER -using System.Collections.Generic; +#if CSHARP12_OR_GREATER using System.Collections.Immutable; -using System.Linq; -using System.Threading; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Rules/ProcessStartAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ProcessStartAnalyzer.cs index 7e7004f5d..a4d04bcbb 100644 --- a/src/Meziantou.Analyzer/Rules/ProcessStartAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ProcessStartAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Rules/RegexUsageAnalyzerBase.cs b/src/Meziantou.Analyzer/Rules/RegexUsageAnalyzerBase.cs index 82d116daf..efc755700 100644 --- a/src/Meziantou.Analyzer/Rules/RegexUsageAnalyzerBase.cs +++ b/src/Meziantou.Analyzer/Rules/RegexUsageAnalyzerBase.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Linq; using System.Text.RegularExpressions; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/RemoveEmptyBlockAnalyzer.cs b/src/Meziantou.Analyzer/Rules/RemoveEmptyBlockAnalyzer.cs index 4ce5f33ec..6a796856a 100644 --- a/src/Meziantou.Analyzer/Rules/RemoveEmptyBlockAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/RemoveEmptyBlockAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; diff --git a/src/Meziantou.Analyzer/Rules/RemoveUselessToStringAnalyzer.cs b/src/Meziantou.Analyzer/Rules/RemoveUselessToStringAnalyzer.cs index 1158626e5..393c6c0fd 100644 --- a/src/Meziantou.Analyzer/Rules/RemoveUselessToStringAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/RemoveUselessToStringAnalyzer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzer.cs index da33d4c78..37e8e0fea 100644 --- a/src/Meziantou.Analyzer/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzerCommon.cs b/src/Meziantou.Analyzer/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzerCommon.cs index 651ad3d69..573123d98 100644 --- a/src/Meziantou.Analyzer/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzerCommon.cs +++ b/src/Meziantou.Analyzer/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzerCommon.cs @@ -1,4 +1,3 @@ -using System.Threading; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/SequenceNumberMustBeAConstantAnalyzer.cs b/src/Meziantou.Analyzer/Rules/SequenceNumberMustBeAConstantAnalyzer.cs index 156615735..c5ce14105 100644 --- a/src/Meziantou.Analyzer/Rules/SequenceNumberMustBeAConstantAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/SequenceNumberMustBeAConstantAnalyzer.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/SimplifyCallerArgumentExpressionAnalyzer.cs b/src/Meziantou.Analyzer/Rules/SimplifyCallerArgumentExpressionAnalyzer.cs index 0a0900fd2..c9ca2a036 100644 --- a/src/Meziantou.Analyzer/Rules/SimplifyCallerArgumentExpressionAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/SimplifyCallerArgumentExpressionAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/ThrowIfNullWithNonNullableInstanceAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ThrowIfNullWithNonNullableInstanceAnalyzer.cs index c5c46c6ed..234730919 100644 --- a/src/Meziantou.Analyzer/Rules/ThrowIfNullWithNonNullableInstanceAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ThrowIfNullWithNonNullableInstanceAnalyzer.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/TypeNameMustNotMatchNamespaceAnalyzer.cs b/src/Meziantou.Analyzer/Rules/TypeNameMustNotMatchNamespaceAnalyzer.cs index 65d665803..da2e21caa 100644 --- a/src/Meziantou.Analyzer/Rules/TypeNameMustNotMatchNamespaceAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/TypeNameMustNotMatchNamespaceAnalyzer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/UseAnOverloadThatHasCancellationTokenAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseAnOverloadThatHasCancellationTokenAnalyzer.cs index f6604a136..a34712da4 100644 --- a/src/Meziantou.Analyzer/Rules/UseAnOverloadThatHasCancellationTokenAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseAnOverloadThatHasCancellationTokenAnalyzer.cs @@ -1,13 +1,7 @@ -using System; using System.Collections.Concurrent; -using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; using System.Runtime.InteropServices; -using System.Threading; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; @@ -242,7 +236,7 @@ public void AnalyzeLoop(OperationAnalysisContext context) .Add("ParameterIndex", parameterInfo.ParameterIndex.ToString(CultureInfo.InvariantCulture)) .Add("ParameterName", parameterInfo.Name) .Add("ParameterIsEnumeratorCancellation", parameterInfo.HasEnumeratorCancellationAttribute.ToString()) - .Add("CancellationTokens", string.Join(",", cancellationTokens)); + .Add("CancellationTokens", string.Join(',', cancellationTokens)); } private List? GetMembers(ITypeSymbol symbol, int maxDepth) @@ -297,7 +291,7 @@ public void AnalyzeLoop(OperationAnalysisContext context) { foreach (var objectMember in typeMembers) { - result.Add(Prepend(member, objectMember).ToArray()); + result.Add([.. Prepend(member, objectMember)]); } } } @@ -376,9 +370,9 @@ static bool AreAllSymbolsAccessibleFromOperation(IEnumerable symbols, I static string ComputeFullPath(string? prefix, IEnumerable symbols) { if (prefix is null) - return string.Join(".", symbols.Select(symbol => symbol.Name)); + return string.Join('.', symbols.Select(symbol => symbol.Name)); - var suffix = string.Join(".", symbols.Select(symbol => symbol.Name)); + var suffix = string.Join('.', symbols.Select(symbol => symbol.Name)); if (string.IsNullOrEmpty(suffix)) return prefix; diff --git a/src/Meziantou.Analyzer/Rules/UseAnOverloadThatHasTimeProviderAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseAnOverloadThatHasTimeProviderAnalyzer.cs index b79caa083..db7c11eeb 100644 --- a/src/Meziantou.Analyzer/Rules/UseAnOverloadThatHasTimeProviderAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseAnOverloadThatHasTimeProviderAnalyzer.cs @@ -1,18 +1,9 @@ -using System; using System.Collections.Concurrent; -using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; using System.Runtime.InteropServices; -using System.Threading; -using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Operations; @@ -147,7 +138,7 @@ public void AnalyzeInvocation(OperationAnalysisContext context) return ImmutableDictionary.Create() .Add("ParameterIndex", parameterInfo.ParameterIndex.ToString(CultureInfo.InvariantCulture)) .Add("ParameterName", parameterInfo.Name) - .Add("Paths", string.Join(",", cancellationTokens)); + .Add("Paths", string.Join(',', cancellationTokens)); } private List? GetMembers(ITypeSymbol symbol, int maxDepth) @@ -199,7 +190,7 @@ public void AnalyzeInvocation(OperationAnalysisContext context) { foreach (var objectMember in typeMembers) { - result.Add(Prepend(member, objectMember).ToArray()); + result.Add([.. Prepend(member, objectMember)]); } } } @@ -270,9 +261,9 @@ static bool AreAllSymbolsAccessibleFromOperation(IEnumerable symbols, I static string ComputeFullPath(string? prefix, IEnumerable symbols) { if (prefix is null) - return string.Join(".", symbols.Select(symbol => symbol.Name)); + return string.Join('.', symbols.Select(symbol => symbol.Name)); - var suffix = string.Join(".", symbols.Select(symbol => symbol.Name)); + var suffix = string.Join('.', symbols.Select(symbol => symbol.Name)); if (string.IsNullOrEmpty(suffix)) return prefix; diff --git a/src/Meziantou.Analyzer/Rules/UseArrayEmptyAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseArrayEmptyAnalyzer.cs index 3f4390f13..54275f555 100644 --- a/src/Meziantou.Analyzer/Rules/UseArrayEmptyAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseArrayEmptyAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/src/Meziantou.Analyzer/Rules/UseConfigureAwaitAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseConfigureAwaitAnalyzer.cs index e78f5709d..95a204bc6 100644 --- a/src/Meziantou.Analyzer/Rules/UseConfigureAwaitAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseConfigureAwaitAnalyzer.cs @@ -1,7 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Linq; -using System.Threading; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/UseContainsKeyInsteadOfTryGetValueAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseContainsKeyInsteadOfTryGetValueAnalyzer.cs index 7ba4d8acf..6b8819c01 100644 --- a/src/Meziantou.Analyzer/Rules/UseContainsKeyInsteadOfTryGetValueAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseContainsKeyInsteadOfTryGetValueAnalyzer.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/UseDateTimeUnixEpochAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseDateTimeUnixEpochAnalyzer.cs index 16cf8550c..59ddad120 100644 --- a/src/Meziantou.Analyzer/Rules/UseDateTimeUnixEpochAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseDateTimeUnixEpochAnalyzer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/UseEqualsMethodInsteadOfOperatorAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseEqualsMethodInsteadOfOperatorAnalyzer.cs index d275ca796..8d808d8e9 100644 --- a/src/Meziantou.Analyzer/Rules/UseEqualsMethodInsteadOfOperatorAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseEqualsMethodInsteadOfOperatorAnalyzer.cs @@ -1,5 +1,4 @@ using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/UseEventHandlerOfTAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseEventHandlerOfTAnalyzer.cs index 01c9c59c4..1749b4d9c 100644 --- a/src/Meziantou.Analyzer/Rules/UseEventHandlerOfTAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseEventHandlerOfTAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/UseIFormatProviderAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseIFormatProviderAnalyzer.cs index 5136e300b..c0ca66197 100644 --- a/src/Meziantou.Analyzer/Rules/UseIFormatProviderAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseIFormatProviderAnalyzer.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Collections.Immutable; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; diff --git a/src/Meziantou.Analyzer/Rules/UseIsPatternInsteadOfSequenceEqualAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseIsPatternInsteadOfSequenceEqualAnalyzer.cs index 98869c111..05358e2cd 100644 --- a/src/Meziantou.Analyzer/Rules/UseIsPatternInsteadOfSequenceEqualAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseIsPatternInsteadOfSequenceEqualAnalyzer.cs @@ -1,9 +1,7 @@ -using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis; using System.Collections.Immutable; using Microsoft.CodeAnalysis.Operations; -using System.Linq; -using System; using Meziantou.Analyzer.Internals; namespace Meziantou.Analyzer.Rules; diff --git a/src/Meziantou.Analyzer/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedAnalyzer.cs index 4429aad5e..6b1d20c6b 100644 --- a/src/Meziantou.Analyzer/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedAnalyzer.cs @@ -1,4 +1,4 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -73,7 +73,7 @@ static bool IsValueUsed(IInvocationOperation operation) parent = parent.Parent; } - if (parent is null || parent is IBlockOperation || parent is IExpressionStatementOperation) + if (parent is null or IBlockOperation or IExpressionStatementOperation) return false; return true; diff --git a/src/Meziantou.Analyzer/Rules/UseLangwordInXmlCommentAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseLangwordInXmlCommentAnalyzer.cs index 1dc30feac..75bd486ce 100644 --- a/src/Meziantou.Analyzer/Rules/UseLangwordInXmlCommentAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseLangwordInXmlCommentAnalyzer.cs @@ -1,9 +1,7 @@ -using System; using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Syntax; -using System.Collections.Generic; using Meziantou.Analyzer.Internals; using System.Linq.Expressions; diff --git a/src/Meziantou.Analyzer/Rules/UseOperatingSystemInsteadOfRuntimeInformationAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseOperatingSystemInsteadOfRuntimeInformationAnalyzer.cs index ea9aad65f..2055b50a4 100644 --- a/src/Meziantou.Analyzer/Rules/UseOperatingSystemInsteadOfRuntimeInformationAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseOperatingSystemInsteadOfRuntimeInformationAnalyzer.cs @@ -1,4 +1,4 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -27,7 +27,7 @@ public override void Initialize(AnalysisContext context) context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); context.RegisterCompilationStartAction(context => { - var isOSPlatformSymbol = DocumentationCommentId.GetFirstSymbolForDeclarationId("M:System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform)", context.Compilation) as IMethodSymbol; + var isOSPlatformSymbol = DocumentationCommentId.GetFirstSymbolForDeclarationId("M:System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform)", context.Compilation); var osPlatformSymbol = context.Compilation.GetBestTypeByMetadataName("System.Runtime.InteropServices.OSPlatform"); var operatingSystemSymbol = DocumentationCommentId.GetFirstSymbolForDeclarationId("M:System.OperatingSystem.IsWindows", context.Compilation); if (isOSPlatformSymbol is null || operatingSystemSymbol is null || !context.Compilation.IsSymbolAccessibleWithin(operatingSystemSymbol, context.Compilation.Assembly) || osPlatformSymbol is null) @@ -37,7 +37,7 @@ public override void Initialize(AnalysisContext context) }); } - private static void AnalyzeInvocation(OperationAnalysisContext context, IMethodSymbol runtimeInformationSymbol, INamedTypeSymbol osPlatformSymbol) + private static void AnalyzeInvocation(OperationAnalysisContext context, ISymbol runtimeInformationSymbol, INamedTypeSymbol osPlatformSymbol) { var operation = (IInvocationOperation)context.Operation; if (operation.Arguments.Length == 1 && SymbolEqualityComparer.Default.Equals(runtimeInformationSymbol, operation.TargetMethod)) diff --git a/src/Meziantou.Analyzer/Rules/UsePatternMatchingForEqualityComparisonsAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UsePatternMatchingForEqualityComparisonsAnalyzer.cs index a79e4f4ee..99457e55f 100644 --- a/src/Meziantou.Analyzer/Rules/UsePatternMatchingForEqualityComparisonsAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UsePatternMatchingForEqualityComparisonsAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/UsePatternMatchingInsteadOfHasValueAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UsePatternMatchingInsteadOfHasValueAnalyzer.cs index 72bc9720a..5939523d9 100644 --- a/src/Meziantou.Analyzer/Rules/UsePatternMatchingInsteadOfHasValueAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UsePatternMatchingInsteadOfHasValueAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/UseRegexSourceGeneratorAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseRegexSourceGeneratorAnalyzer.cs index bee638a32..2e4abd8c7 100644 --- a/src/Meziantou.Analyzer/Rules/UseRegexSourceGeneratorAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseRegexSourceGeneratorAnalyzer.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Globalization; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/UseStringComparerAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseStringComparerAnalyzer.cs index 9cb952b86..c04e42f34 100644 --- a/src/Meziantou.Analyzer/Rules/UseStringComparerAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseStringComparerAnalyzer.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; using Meziantou.Analyzer.Configurations; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/UseStringComparisonAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseStringComparisonAnalyzer.cs index 795f6e7a1..d1ccde79f 100644 --- a/src/Meziantou.Analyzer/Rules/UseStringComparisonAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseStringComparisonAnalyzer.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; diff --git a/src/Meziantou.Analyzer/Rules/UseStringCreateInsteadOfFormattableStringAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseStringCreateInsteadOfFormattableStringAnalyzer.cs index 7d4110303..a13020c5c 100644 --- a/src/Meziantou.Analyzer/Rules/UseStringCreateInsteadOfFormattableStringAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseStringCreateInsteadOfFormattableStringAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/UseStringEqualsAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseStringEqualsAnalyzer.cs index f6ee18eec..5f37a6d29 100644 --- a/src/Meziantou.Analyzer/Rules/UseStringEqualsAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseStringEqualsAnalyzer.cs @@ -1,4 +1,4 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -36,8 +36,7 @@ public override void Initialize(AnalysisContext context) private static void AnalyzeInvocation(OperationAnalysisContext context, OperationUtilities operationUtilities) { var operation = (IBinaryOperation)context.Operation; - if (operation.OperatorKind == BinaryOperatorKind.Equals || - operation.OperatorKind == BinaryOperatorKind.NotEquals) + if (operation.OperatorKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals) { if (operation.LeftOperand.Type.IsString() && operation.RightOperand.Type.IsString()) { diff --git a/src/Meziantou.Analyzer/Rules/UseStructLayoutAttributeAnalyzer.cs b/src/Meziantou.Analyzer/Rules/UseStructLayoutAttributeAnalyzer.cs index 67a128f1e..b12de10c8 100644 --- a/src/Meziantou.Analyzer/Rules/UseStructLayoutAttributeAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/UseStructLayoutAttributeAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.Linq; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/src/Meziantou.Analyzer/Rules/ValidateArgumentsCorrectlyAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ValidateArgumentsCorrectlyAnalyzer.cs index 21b5187b4..6b68e77a1 100755 --- a/src/Meziantou.Analyzer/Rules/ValidateArgumentsCorrectlyAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ValidateArgumentsCorrectlyAnalyzer.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; using System.Collections.Immutable; -using System.Globalization; -using System.Linq; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -153,7 +150,7 @@ private static bool FilterDescendants(SyntaxNode node) if (operation is IMethodBodyOperation) break; - if (operation.Parent is not null && operation.Parent is IBlockOperation) + if (operation.Parent is IBlockOperation) { if (operation.Parent.Parent is IMethodBodyOperation) break; diff --git a/src/Meziantou.Analyzer/Rules/ValueReturnedByStreamReadShouldBeUsedAnalyzer.cs b/src/Meziantou.Analyzer/Rules/ValueReturnedByStreamReadShouldBeUsedAnalyzer.cs index 1c2a1ac11..359d9a27e 100644 --- a/src/Meziantou.Analyzer/Rules/ValueReturnedByStreamReadShouldBeUsedAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/ValueReturnedByStreamReadShouldBeUsedAnalyzer.cs @@ -1,5 +1,4 @@ -using System.Collections.Immutable; -using System.IO; +using System.Collections.Immutable; using Meziantou.Analyzer.Internals; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -41,7 +40,7 @@ private static void AnalyzeOperation(OperationAnalysisContext context, INamedTyp { var invocation = (IInvocationOperation)context.Operation; var targetMethod = invocation.TargetMethod; - if (targetMethod.Name != nameof(Stream.Read) && targetMethod.Name != nameof(Stream.ReadAsync)) + if (targetMethod.Name is not nameof(Stream.Read) and not nameof(Stream.ReadAsync)) return; if (!targetMethod.ContainingType.IsOrInheritFrom(streamSymbol)) @@ -53,7 +52,7 @@ private static void AnalyzeOperation(OperationAnalysisContext context, INamedTyp parent = parent.Parent; } - if (parent is null || parent is IBlockOperation || parent is IExpressionStatementOperation) + if (parent is null or IBlockOperation or IExpressionStatementOperation) { context.ReportDiagnostic(Rule, invocation, targetMethod.Name); } diff --git a/tests/Meziantou.Analyzer.Test/Helpers/DiagnosticResult.cs b/tests/Meziantou.Analyzer.Test/Helpers/DiagnosticResult.cs index 263fc6b9d..7dd208779 100755 --- a/tests/Meziantou.Analyzer.Test/Helpers/DiagnosticResult.cs +++ b/tests/Meziantou.Analyzer.Test/Helpers/DiagnosticResult.cs @@ -1,16 +1,13 @@ -using System.Collections.Generic; using Microsoft.CodeAnalysis; namespace Meziantou.Analyzer.Test.Helpers; public sealed class DiagnosticResult { - private IReadOnlyList? _locations; - public IReadOnlyList Locations { - get => _locations ??= []; - set => _locations = value; + get => field ??= []; + set; } public DiagnosticSeverity? Severity { get; set; } diff --git a/tests/Meziantou.Analyzer.Test/Helpers/DiagnosticResultLocation.cs b/tests/Meziantou.Analyzer.Test/Helpers/DiagnosticResultLocation.cs index e1b6bd662..31e30c237 100644 --- a/tests/Meziantou.Analyzer.Test/Helpers/DiagnosticResultLocation.cs +++ b/tests/Meziantou.Analyzer.Test/Helpers/DiagnosticResultLocation.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Meziantou.Analyzer.Test.Helpers; diff --git a/tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.Validation.cs b/tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.Validation.cs index 6210a9d82..ec978770e 100755 --- a/tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.Validation.cs +++ b/tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.Validation.cs @@ -58,14 +58,14 @@ private void VerifyDiagnosticResults(IEnumerable actualResults, ILis var expectedCount = expectedResults.Count; if (DefaultAnalyzerId is not null) { - actualResults = actualResults.Where(diagnostic => diagnostic.Id == DefaultAnalyzerId).ToArray(); + actualResults = [.. actualResults.Where(diagnostic => diagnostic.Id == DefaultAnalyzerId)]; } var actualCount = actualResults.Count(); if (expectedCount != actualCount) { - var diagnosticsOutput = actualResults.Any() ? FormatDiagnostics(analyzers, actualResults.ToArray()) : " NONE."; + var diagnosticsOutput = actualResults.Any() ? FormatDiagnostics(analyzers, [.. actualResults]) : " NONE."; Assert.Fail($"Mismatch between number of diagnostics returned, expected \"{expectedCount.ToString(CultureInfo.InvariantCulture)}\" actual \"{actualCount.ToString(CultureInfo.InvariantCulture)}\"\r\n\r\nDiagnostics:\r\n{diagnosticsOutput}\r\n"); } @@ -474,7 +474,7 @@ private async Task VerifyFix(IList analyzers, CodeFixProvide { if (!codeFixProvider.FixableDiagnosticIds.Any(id => string.Equals(diagnostic.Id, id, StringComparison.Ordinal))) { - Assert.Fail($"The CodeFixProvider is not valid for the DiagnosticAnalyzer. DiagnosticId: {diagnostic.Id}, Supported diagnostics: {string.Join(",", codeFixProvider.FixableDiagnosticIds)}"); + Assert.Fail($"The CodeFixProvider is not valid for the DiagnosticAnalyzer. DiagnosticId: {diagnostic.Id}, Supported diagnostics: {string.Join(',', codeFixProvider.FixableDiagnosticIds)}"); } } diff --git a/tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.cs b/tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.cs index 9f9814b2f..aafb16eb8 100755 --- a/tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.cs +++ b/tests/Meziantou.Analyzer.Test/Helpers/ProjectBuilder.cs @@ -1,24 +1,15 @@ -using System; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; using System.IO.Compression; -using System.Linq; using System.Reflection; using System.Reflection.Metadata; using System.Reflection.PortableExecutable; using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using Meziantou.Analyzer.Annotations; -using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Diagnostics; -using Xunit; namespace TestHelper; @@ -37,11 +28,11 @@ public sealed partial class ProjectBuilder public bool IsValidFixCode { get; private set; } = true; public LanguageVersion LanguageVersion { get; private set; } = LanguageVersion.Latest; public TargetFramework TargetFramework { get; private set; } = TargetFramework.NetStandard2_0; - public IList References { get; } = new List(); - public IList ApiReferences { get; } = new List(); - public IList DiagnosticAnalyzer { get; } = new List(); + public IList References { get; } = []; + public IList ApiReferences { get; } = []; + public IList DiagnosticAnalyzer { get; } = []; public CodeFixProvider? CodeFixProvider { get; private set; } - public IList ExpectedDiagnosticResults { get; } = new List(); + public IList ExpectedDiagnosticResults { get; } = []; public string? ExpectedFixedCode { get; private set; } public int? CodeFixIndex { get; private set; } public bool UseBatchFixer { get; private set; } @@ -50,13 +41,8 @@ public sealed partial class ProjectBuilder private static async Task GetNuGetReferences(string packageName, string version, params string[] paths) { - var bytes = Encoding.UTF8.GetBytes(packageName + '@' + version + ':' + string.Join(",", paths)); -#if NET8_0_OR_GREATER + var bytes = Encoding.UTF8.GetBytes(packageName + '@' + version + ':' + string.Join(',', paths)); var hash = SHA256.HashData(bytes); -#else - using var sha256 = SHA256.Create(); - var hash = sha256.ComputeHash(bytes); -#endif var key = Convert.ToBase64String(hash).Replace('/', '_'); var task = NuGetPackagesCache.GetOrAdd(key, _ => new Lazy>(Download)); return await task.Value.ConfigureAwait(false); @@ -71,13 +57,13 @@ async Task Download() var tempFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); Directory.CreateDirectory(tempFolder); - using var stream = await SharedHttpClient.Instance.GetStreamAsync(new Uri($"https://www.nuget.org/api/v2/package/{packageName}/{version}")).ConfigureAwait(false); - using var zip = new ZipArchive(stream, ZipArchiveMode.Read); + await using var stream = await SharedHttpClient.Instance.GetStreamAsync(new Uri($"https://www.nuget.org/api/v2/package/{packageName}/{version}")).ConfigureAwait(false); + await using var zip = new ZipArchive(stream, ZipArchiveMode.Read); var hasEntry = false; foreach (var entry in zip.Entries.Where(file => paths.Any(path => file.FullName.StartsWith(path, StringComparison.Ordinal)))) { - entry.ExtractToFile(Path.Combine(tempFolder, entry.Name), overwrite: true); + await entry.ExtractToFileAsync(Path.Combine(tempFolder, entry.Name), overwrite: true); hasEntry = true; } diff --git a/tests/Meziantou.Analyzer.Test/Helpers/SharedHttpClient.cs b/tests/Meziantou.Analyzer.Test/Helpers/SharedHttpClient.cs index 2205fdd93..e52799156 100644 --- a/tests/Meziantou.Analyzer.Test/Helpers/SharedHttpClient.cs +++ b/tests/Meziantou.Analyzer.Test/Helpers/SharedHttpClient.cs @@ -1,8 +1,3 @@ -using System; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; - namespace Meziantou.Analyzer.Test.Helpers; internal static class SharedHttpClient { diff --git a/tests/Meziantou.Analyzer.Test/Helpers/TestAnalyzerConfigOptionsProvider.cs b/tests/Meziantou.Analyzer.Test/Helpers/TestAnalyzerConfigOptionsProvider.cs index ed39d17e3..13598b4b5 100644 --- a/tests/Meziantou.Analyzer.Test/Helpers/TestAnalyzerConfigOptionsProvider.cs +++ b/tests/Meziantou.Analyzer.Test/Helpers/TestAnalyzerConfigOptionsProvider.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; diff --git a/tests/Meziantou.Analyzer.Test/Meziantou.Analyzer.Test.csproj b/tests/Meziantou.Analyzer.Test/Meziantou.Analyzer.Test.csproj index 5499be778..61aa0ceec 100644 --- a/tests/Meziantou.Analyzer.Test/Meziantou.Analyzer.Test.csproj +++ b/tests/Meziantou.Analyzer.Test/Meziantou.Analyzer.Test.csproj @@ -1,11 +1,10 @@  - + - - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Meziantou.Analyzer.Test/RuleHelpUri.cs b/tests/Meziantou.Analyzer.Test/RuleHelpUri.cs index 798fd5565..58d2cbf57 100755 --- a/tests/Meziantou.Analyzer.Test/RuleHelpUri.cs +++ b/tests/Meziantou.Analyzer.Test/RuleHelpUri.cs @@ -1,7 +1,5 @@ -using System; using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis.Diagnostics; -using Xunit; namespace Meziantou.Analyzer.Test; public sealed class RuleHelpUri diff --git a/tests/Meziantou.Analyzer.Test/Rules/AbstractTypesShouldNotHaveConstructorsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AbstractTypesShouldNotHaveConstructorsAnalyzerTests.cs index 7ae5ae76c..13c912acb 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/AbstractTypesShouldNotHaveConstructorsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AbstractTypesShouldNotHaveConstructorsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/AddOverloadWithSpanOrMemoryAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AddOverloadWithSpanOrMemoryAnalyzerTests.cs index da5de3b87..3f5c99881 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/AddOverloadWithSpanOrMemoryAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AddOverloadWithSpanOrMemoryAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/AnonymousDelegatesShouldNotBeUsedToUnsubscribeFromEventsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AnonymousDelegatesShouldNotBeUsedToUnsubscribeFromEventsAnalyzerTests.cs index deb81ffab..34df77417 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/AnonymousDelegatesShouldNotBeUsedToUnsubscribeFromEventsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AnonymousDelegatesShouldNotBeUsedToUnsubscribeFromEventsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzerTests.cs index 2c70c8da2..a8be3f61f 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzer_UseNameofTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzer_UseNameofTests.cs index ed19c7004..67c56cf0b 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzer_UseNameofTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ArgumentExceptionShouldSpecifyArgumentNameAnalyzer_UseNameofTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/AttributeNameShouldEndWithAttributeAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AttributeNameShouldEndWithAttributeAnalyzerTests.cs index df2ba3bfa..d8c24b70e 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/AttributeNameShouldEndWithAttributeAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AttributeNameShouldEndWithAttributeAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/AvoidComparisonWithBoolConstantAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AvoidComparisonWithBoolConstantAnalyzerTests.cs index b34629e2b..1d9ef66eb 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/AvoidComparisonWithBoolConstantAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AvoidComparisonWithBoolConstantAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/AvoidLockingOnPubliclyAccessibleInstanceAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AvoidLockingOnPubliclyAccessibleInstanceAnalyzerTests.cs index 295e60692..3e73ce4e8 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/AvoidLockingOnPubliclyAccessibleInstanceAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AvoidLockingOnPubliclyAccessibleInstanceAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/AvoidUsingRedundantElseAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AvoidUsingRedundantElseAnalyzerTests.cs index 5d9d4f889..057e95790 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/AvoidUsingRedundantElseAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AvoidUsingRedundantElseAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/AwaitAwaitableMethodInSyncMethodAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AwaitAwaitableMethodInSyncMethodAnalyzerTests.cs index 6b2ba0464..2bd34ebc0 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/AwaitAwaitableMethodInSyncMethodAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AwaitAwaitableMethodInSyncMethodAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class AwaitAwaitableMethodInSyncMethodAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/AwaitTaskBeforeDisposingResourcesAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/AwaitTaskBeforeDisposingResourcesAnalyzerTests.cs index 3450721ac..1f257d022 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/AwaitTaskBeforeDisposingResourcesAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/AwaitTaskBeforeDisposingResourcesAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/BothSideOfTheConditionAreIdenticalAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/BothSideOfTheConditionAreIdenticalAnalyzerTests.cs index 1e1f8c05e..ceaca8870 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/BothSideOfTheConditionAreIdenticalAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/BothSideOfTheConditionAreIdenticalAnalyzerTests.cs @@ -1,6 +1,5 @@ using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ClassMustBeSealedAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ClassMustBeSealedAnalyzerTests.cs index f5e9e1549..bbb0f1bfc 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/ClassMustBeSealedAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ClassMustBeSealedAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/CommaAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/CommaAnalyzerTests.cs index 046e34c53..a818f4ecb 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/CommaAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/CommaAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ConcurrentDictionaryMustPreventClosureWhenAccessingTheKeyAnalyzerTests_MA0105.cs b/tests/Meziantou.Analyzer.Test/Rules/ConcurrentDictionaryMustPreventClosureWhenAccessingTheKeyAnalyzerTests_MA0105.cs index c1d9c09c2..98f9cf475 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ConcurrentDictionaryMustPreventClosureWhenAccessingTheKeyAnalyzerTests_MA0105.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ConcurrentDictionaryMustPreventClosureWhenAccessingTheKeyAnalyzerTests_MA0105.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ConcurrentDictionaryMustPreventClosureWhenAccessingTheKeyAnalyzerTests_MA0106.cs b/tests/Meziantou.Analyzer.Test/Rules/ConcurrentDictionaryMustPreventClosureWhenAccessingTheKeyAnalyzerTests_MA0106.cs index b895b8133..95dd3a44e 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ConcurrentDictionaryMustPreventClosureWhenAccessingTheKeyAnalyzerTests_MA0106.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ConcurrentDictionaryMustPreventClosureWhenAccessingTheKeyAnalyzerTests_MA0106.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ConstructorArgumentParametersShouldExistInConstructorsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ConstructorArgumentParametersShouldExistInConstructorsAnalyzerTests.cs index 578f916b3..ae8d09585 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ConstructorArgumentParametersShouldExistInConstructorsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ConstructorArgumentParametersShouldExistInConstructorsAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DeclareTypesInNamespacesAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DeclareTypesInNamespacesAnalyzerTests.cs index f24253e80..ee41c2927 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DeclareTypesInNamespacesAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DeclareTypesInNamespacesAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotCallVirtualMethodInConstructorAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotCallVirtualMethodInConstructorAnalyzerTests.cs index a95a5aaea..99300b12a 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotCallVirtualMethodInConstructorAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotCallVirtualMethodInConstructorAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotCompareDateTimeWithDateTimeOffsetAnalyzerTests_MA0132.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotCompareDateTimeWithDateTimeOffsetAnalyzerTests_MA0132.cs index deb348729..ee6089adc 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotCompareDateTimeWithDateTimeOffsetAnalyzerTests_MA0132.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotCompareDateTimeWithDateTimeOffsetAnalyzerTests_MA0132.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotCompareDateTimeWithDateTimeOffsetAnalyzerTests_MA0133.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotCompareDateTimeWithDateTimeOffsetAnalyzerTests_MA0133.cs index 7581f47c7..a99ba464c 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotCompareDateTimeWithDateTimeOffsetAnalyzerTests_MA0133.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotCompareDateTimeWithDateTimeOffsetAnalyzerTests_MA0133.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotDeclareStaticMembersOnGenericTypesTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotDeclareStaticMembersOnGenericTypesTests.cs index fdc649b64..c4913ec82 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotDeclareStaticMembersOnGenericTypesTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotDeclareStaticMembersOnGenericTypesTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotLogClassifiedDataAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotLogClassifiedDataAnalyzerTests.cs index 0a84535a1..0f085143e 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotLogClassifiedDataAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotLogClassifiedDataAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class DoNotLogClassifiedDataAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotNaNInComparisonsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotNaNInComparisonsAnalyzerTests.cs index 7677dfd44..4700f13a0 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotNaNInComparisonsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotNaNInComparisonsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotOverwriteRazorComponentParameterValueTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotOverwriteRazorComponentParameterValueTests.cs index 92cce5079..5a69dab7f 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotOverwriteRazorComponentParameterValueTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotOverwriteRazorComponentParameterValueTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public class DoNotOverwriteRazorComponentParameterValueTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseApplicationExceptionAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseApplicationExceptionAnalyzerTests.cs index 7e7812429..12f7e7b1d 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseApplicationExceptionAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseApplicationExceptionAnalyzerTests.cs @@ -1,8 +1,6 @@ -#pragma warning disable CA1030 // Use events where appropriate -using System.Threading.Tasks; +#pragma warning disable CA1030 // Use events where appropriate using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseNotImplementedExceptionAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseNotImplementedExceptionAnalyzerTests.cs index 5d2568ef3..53c4426c7 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseNotImplementedExceptionAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseNotImplementedExceptionAnalyzerTests.cs @@ -1,8 +1,6 @@ -#pragma warning disable CA1030 // Use events where appropriate -using System.Threading.Tasks; +#pragma warning disable CA1030 // Use events where appropriate using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseReservedExceptionTypeAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseReservedExceptionTypeAnalyzerTests.cs index dfd5d8c4e..a29ad5dbb 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseReservedExceptionTypeAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotRaiseReservedExceptionTypeAnalyzerTests.cs @@ -1,8 +1,6 @@ -#pragma warning disable CA1030 // Use events where appropriate -using System.Threading.Tasks; +#pragma warning disable CA1030 // Use events where appropriate using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotRemoveOriginalExceptionFromThrowStatementAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotRemoveOriginalExceptionFromThrowStatementAnalyzerTests.cs index 56cdf7018..354b95e37 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotRemoveOriginalExceptionFromThrowStatementAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotRemoveOriginalExceptionFromThrowStatementAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotThrowFromFinalizerAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotThrowFromFinalizerAnalyzerTests.cs index e146bbe7c..e048d14da 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotThrowFromFinalizerAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotThrowFromFinalizerAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotThrowFromFinallyBlockAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotThrowFromFinallyBlockAnalyzerTests.cs index 9aa4ec830..0d3903dd1 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotThrowFromFinallyBlockAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotThrowFromFinallyBlockAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseAsyncDelegateForSyncDelegateAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseAsyncDelegateForSyncDelegateAnalyzerTests.cs index 8d79ec491..8994cafb7 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseAsyncDelegateForSyncDelegateAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseAsyncDelegateForSyncDelegateAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseAsyncVoidAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseAsyncVoidAnalyzerTests.cs index 6e569baa9..3108adb5e 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseAsyncVoidAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseAsyncVoidAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class DoNotUseAsyncVoidAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseBlockingCallInAsyncContextAnalyzer_AsyncContextTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseBlockingCallInAsyncContextAnalyzer_AsyncContextTests.cs index b22d7995b..0bfd6fa22 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseBlockingCallInAsyncContextAnalyzer_AsyncContextTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseBlockingCallInAsyncContextAnalyzer_AsyncContextTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseBlockingCallInAsyncContextAnalyzer_NonAsyncContextTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseBlockingCallInAsyncContextAnalyzer_NonAsyncContextTests.cs index 6ded213e2..b6616fd6a 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseBlockingCallInAsyncContextAnalyzer_NonAsyncContextTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseBlockingCallInAsyncContextAnalyzer_NonAsyncContextTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseDefaultEqualsOnValueTypeAnalyzer_EqualsTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseDefaultEqualsOnValueTypeAnalyzer_EqualsTests.cs index b3e7c067c..3c3712254 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseDefaultEqualsOnValueTypeAnalyzer_EqualsTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseDefaultEqualsOnValueTypeAnalyzer_EqualsTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseDefaultEqualsOnValueTypeAnalyzer_HashSetTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseDefaultEqualsOnValueTypeAnalyzer_HashSetTests.cs index 2434024a1..9c5b533de 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseDefaultEqualsOnValueTypeAnalyzer_HashSetTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseDefaultEqualsOnValueTypeAnalyzer_HashSetTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; @@ -137,7 +135,7 @@ await CreateProjectBuilder() [InlineData("System.Collections.Immutable.ImmutableSortedDictionary.Create()")] public async Task GetHashCode_Enum(string text) { - string sourceCode = @" + var sourceCode = @" enum Test { A, diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzerTests.cs index b99b6c7ad..cb84d5469 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseEqualityComparerDefaultOfStringAnalyzerTests.cs @@ -1,6 +1,5 @@ -using Meziantou.Analyzer.Rules; +using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseEqualityOperatorsForSpanOfCharAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseEqualityOperatorsForSpanOfCharAnalyzerTests.cs index 50a14f8b1..d949f2b1a 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseEqualityOperatorsForSpanOfCharAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseEqualityOperatorsForSpanOfCharAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseFinalizerAnalyzerTests.cs.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseFinalizerAnalyzerTests.cs.cs index ae836e46f..9c7da5f19 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseFinalizerAnalyzerTests.cs.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseFinalizerAnalyzerTests.cs.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseImplicitCultureSensitiveToStringAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseImplicitCultureSensitiveToStringAnalyzerTests.cs index ebd461e1d..ddb800385 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseImplicitCultureSensitiveToStringAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseImplicitCultureSensitiveToStringAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseServerCertificateValidationCallbackAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseServerCertificateValidationCallbackAnalyzerTests.cs index 34d6db3c1..de73622be 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseServerCertificateValidationCallbackAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseServerCertificateValidationCallbackAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseStringGetHashCodeAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseStringGetHashCodeAnalyzerTests.cs index 340de04e7..94246d64b 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseStringGetHashCodeAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseStringGetHashCodeAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseToStringIfObjectAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseToStringIfObjectAnalyzerTests.cs index 44896853e..2e31120fe 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseToStringIfObjectAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseToStringIfObjectAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class DoNotUseToStringIfObjectAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzerTests.cs index 9497fbcfb..c7f95187a 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseUnknownParameterForRazorComponentAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public class DoNotUseUnknownParameterForRazorComponentAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseZeroToInitializeAnEnumValueTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseZeroToInitializeAnEnumValueTests.cs index 153cad8a1..f82d690a5 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DoNotUseZeroToInitializeAnEnumValueTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DoNotUseZeroToInitializeAnEnumValueTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DontTagInstanceFieldsWithThreadStaticAttributeAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DontTagInstanceFieldsWithThreadStaticAttributeAnalyzerTests.cs index 64b54cb3e..9efe002a9 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DontTagInstanceFieldsWithThreadStaticAttributeAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DontTagInstanceFieldsWithThreadStaticAttributeAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DontUseDangerousThreadingMethodsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DontUseDangerousThreadingMethodsAnalyzerTests.cs index 120cb9f18..623fbb62c 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DontUseDangerousThreadingMethodsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DontUseDangerousThreadingMethodsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/DotNotUseNameFromBCLAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/DotNotUseNameFromBCLAnalyzerTests.cs index 85f439fc1..c21481d03 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/DotNotUseNameFromBCLAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/DotNotUseNameFromBCLAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/EmbedCaughtExceptionAsInnerExceptionAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/EmbedCaughtExceptionAsInnerExceptionAnalyzerTests.cs index 6a132298e..117112ef3 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/EmbedCaughtExceptionAsInnerExceptionAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/EmbedCaughtExceptionAsInnerExceptionAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0077Tests.cs b/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0077Tests.cs index eec477130..9ce592e15 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0077Tests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0077Tests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0094Tests.cs b/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0094Tests.cs index 7fa46ba4a..6f4ae45e6 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0094Tests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0094Tests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0097Tests.cs b/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0097Tests.cs index f7a26cea5..7b26c4251 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0097Tests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/EqualityShouldBeCorrectlyImplementedAnalyzerMA0097Tests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/EventArgsNameShouldEndWithEventArgsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/EventArgsNameShouldEndWithEventArgsAnalyzerTests.cs index 182bdf3e8..22468579a 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/EventArgsNameShouldEndWithEventArgsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/EventArgsNameShouldEndWithEventArgsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/EventsShouldHaveProperArgumentsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/EventsShouldHaveProperArgumentsAnalyzerTests.cs index ccff4fcbf..0857bd5fb 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/EventsShouldHaveProperArgumentsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/EventsShouldHaveProperArgumentsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ExceptionNameShouldEndWithExceptionAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ExceptionNameShouldEndWithExceptionAnalyzerTests.cs index 6955ea2fc..b762b10fa 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ExceptionNameShouldEndWithExceptionAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ExceptionNameShouldEndWithExceptionAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/FileNameMustMatchTypeNameAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/FileNameMustMatchTypeNameAnalyzerTests.cs index 2a007dbfb..132ac8fb2 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/FileNameMustMatchTypeNameAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/FileNameMustMatchTypeNameAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/FixToDoAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/FixToDoAnalyzerTests.cs index 9c1eae619..1b7571379 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/FixToDoAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/FixToDoAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/IfElseBranchesAreIdenticalAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/IfElseBranchesAreIdenticalAnalyzerTests.cs index be68da77f..73f52b768 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/IfElseBranchesAreIdenticalAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/IfElseBranchesAreIdenticalAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class IfElseBranchesAreIdenticalAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/JSInteropMustNotBeUsedInOnInitializedAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/JSInteropMustNotBeUsedInOnInitializedAnalyzerTests.cs index b8d3bea5a..4945a241c 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/JSInteropMustNotBeUsedInOnInitializedAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/JSInteropMustNotBeUsedInOnInitializedAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class JSInteropMustNotBeUsedInOnInitializedAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/JSInvokableMethodsMustBePublicAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/JSInvokableMethodsMustBePublicAnalyzerTests.cs index af85b4998..cf4573e92 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/JSInvokableMethodsMustBePublicAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/JSInvokableMethodsMustBePublicAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public class JSInvokableMethodsMustBePublicAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/LocalVariablesShouldNotHideSymbolsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/LocalVariablesShouldNotHideSymbolsAnalyzerTests.cs index 5272f92fe..f01082df5 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/LocalVariablesShouldNotHideSymbolsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/LocalVariablesShouldNotHideSymbolsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/LoggerParameterTypeAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/LoggerParameterTypeAnalyzerTests.cs index c03775935..a30bdedcb 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/LoggerParameterTypeAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/LoggerParameterTypeAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class LoggerParameterTypeAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/LoggerParameterTypeAnalyzer_SerilogTests.cs b/tests/Meziantou.Analyzer.Test/Rules/LoggerParameterTypeAnalyzer_SerilogTests.cs index 6b7d51e2f..80dce8f5a 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/LoggerParameterTypeAnalyzer_SerilogTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/LoggerParameterTypeAnalyzer_SerilogTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class LoggerParameterTypeAnalyzer_SerilogTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/MakeClassStaticAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/MakeClassStaticAnalyzerTests.cs index 134755c18..45e5f9904 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/MakeClassStaticAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MakeClassStaticAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/MakeInterpolatedStringAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/MakeInterpolatedStringAnalyzerTests.cs index cf5cbd5e3..6ed027b3d 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MakeInterpolatedStringAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MakeInterpolatedStringAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class MakeInterpolatedStringAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/MakeMemberReadOnlyAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/MakeMemberReadOnlyAnalyzerTests.cs index 2470110e2..c095d31fe 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MakeMemberReadOnlyAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MakeMemberReadOnlyAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/MakeMethodStaticAnalyzerTests_Methods.cs b/tests/Meziantou.Analyzer.Test/Rules/MakeMethodStaticAnalyzerTests_Methods.cs index 5725b0d37..d3eef532f 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MakeMethodStaticAnalyzerTests_Methods.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MakeMethodStaticAnalyzerTests_Methods.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/MakeMethodStaticAnalyzerTests_Properties.cs b/tests/Meziantou.Analyzer.Test/Rules/MakeMethodStaticAnalyzerTests_Properties.cs index f5538726f..3cddc5e68 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MakeMethodStaticAnalyzerTests_Properties.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MakeMethodStaticAnalyzerTests_Properties.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/MarkAttributesWithAttributeUsageAttributeTests.cs b/tests/Meziantou.Analyzer.Test/Rules/MarkAttributesWithAttributeUsageAttributeTests.cs index 4c8d577d9..e1f58925d 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MarkAttributesWithAttributeUsageAttributeTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MarkAttributesWithAttributeUsageAttributeTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/MethodOverridesShouldNotChangeParameterDefaultsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/MethodOverridesShouldNotChangeParameterDefaultsAnalyzerTests.cs index 527e64061..d006e5439 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MethodOverridesShouldNotChangeParameterDefaultsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MethodOverridesShouldNotChangeParameterDefaultsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/MethodShouldNotBeTooLongAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/MethodShouldNotBeTooLongAnalyzerTests.cs index c07b3559e..f7dc9a6e3 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MethodShouldNotBeTooLongAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MethodShouldNotBeTooLongAnalyzerTests.cs @@ -1,10 +1,7 @@ -using System.Linq; -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs index 8082d72ca..6dc62d9dd 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/NamedParameterAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/NamedParameterAnalyzerTests.cs index 5a2e07d4a..c3b8ea651 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/NamedParameterAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/NamedParameterAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/NonConstantStaticFieldsShouldNotBeVisibleAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/NonConstantStaticFieldsShouldNotBeVisibleAnalyzerTests.cs index b2a74114b..75e0f3a81 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/NonConstantStaticFieldsShouldNotBeVisibleAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/NonConstantStaticFieldsShouldNotBeVisibleAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/NonFlagsEnumsShouldNotBeMarkedWithFlagsAttributeAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/NonFlagsEnumsShouldNotBeMarkedWithFlagsAttributeAnalyzerTests.cs index e53791d3b..f460a4998 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/NonFlagsEnumsShouldNotBeMarkedWithFlagsAttributeAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/NonFlagsEnumsShouldNotBeMarkedWithFlagsAttributeAnalyzerTests.cs @@ -1,9 +1,5 @@ -using System; -using System.Globalization; -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/NotPatternShouldBeParenthesizedAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/NotPatternShouldBeParenthesizedAnalyzerTests.cs index bfda10593..2c95d3bff 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/NotPatternShouldBeParenthesizedAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/NotPatternShouldBeParenthesizedAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class NotPatternShouldBeParenthesizedAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/NullableAttributeUsageAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/NullableAttributeUsageAnalyzerTests.cs index e95098f9d..eb7aa1cbe 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/NullableAttributeUsageAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/NullableAttributeUsageAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ObjectGetTypeOnTypeInstanceAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ObjectGetTypeOnTypeInstanceAnalyzerTests.cs index 0a49c5fe7..bca6eb9d8 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ObjectGetTypeOnTypeInstanceAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ObjectGetTypeOnTypeInstanceAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class ObjectGetTypeOnTypeInstanceAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/ObsoleteAttributesShouldIncludeExplanationsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ObsoleteAttributesShouldIncludeExplanationsAnalyzerTests.cs index 680c70532..aa6d44b39 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ObsoleteAttributesShouldIncludeExplanationsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ObsoleteAttributesShouldIncludeExplanationsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeGuidParsingAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeGuidParsingAnalyzerTests.cs index 276825e1d..f1efc2ca6 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeGuidParsingAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeGuidParsingAnalyzerTests.cs @@ -1,6 +1,5 @@ -using Meziantou.Analyzer.Rules; +using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerCombineLinqMethodsTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerCombineLinqMethodsTests.cs index cbcea8940..3f8cde808 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerCombineLinqMethodsTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerCombineLinqMethodsTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerCountTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerCountTests.cs index 640f4121e..8d33f2480 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerCountTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerCountTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerDuplicateOrderByTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerDuplicateOrderByTests.cs index da273a768..29df870d7 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerDuplicateOrderByTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerDuplicateOrderByTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerOrderTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerOrderTests.cs index 27c88ac7c..5bfdd169c 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerOrderTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerOrderTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseCastInsteadOfSelectTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseCastInsteadOfSelectTests.cs index 364d753ba..d5d08253a 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseCastInsteadOfSelectTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseCastInsteadOfSelectTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseCountInsteadOfAnyTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseCountInsteadOfAnyTests.cs index 31a4d2a4d..794f4ffde 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseCountInsteadOfAnyTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseCountInsteadOfAnyTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseDirectMethodsTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseDirectMethodsTests.cs index 947f01801..a786ba1b0 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseDirectMethodsTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseDirectMethodsTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseIndexerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseIndexerTests.cs index cc0bafdcc..32351a65d 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseIndexerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerUseIndexerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerWhereBeforeOrderByTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerWhereBeforeOrderByTests.cs index 7f1a4d9f3..e902c0d42 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerWhereBeforeOrderByTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeLinqUsageAnalyzerWhereBeforeOrderByTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeStartsWithAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeStartsWithAnalyzerTests.cs index 483d79a2e..8197538d7 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeStartsWithAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeStartsWithAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptimizeStringBuilderUsageAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptimizeStringBuilderUsageAnalyzerTests.cs index 3144ba2d3..125172cd3 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/OptimizeStringBuilderUsageAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptimizeStringBuilderUsageAnalyzerTests.cs @@ -1,9 +1,6 @@ -using System.Collections.Generic; -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptionalParametersAttributeAnalyzerMA0087Tests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptionalParametersAttributeAnalyzerMA0087Tests.cs index ef8d81d4b..50fa4ebbc 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptionalParametersAttributeAnalyzerMA0087Tests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptionalParametersAttributeAnalyzerMA0087Tests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/OptionalParametersAttributeAnalyzerMA0088Tests.cs b/tests/Meziantou.Analyzer.Test/Rules/OptionalParametersAttributeAnalyzerMA0088Tests.cs index 79317ad8d..6283c8214 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/OptionalParametersAttributeAnalyzerMA0088Tests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/OptionalParametersAttributeAnalyzerMA0088Tests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ParameterAttributeForRazorComponentAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ParameterAttributeForRazorComponentAnalyzerTests.cs index 98be9fc9b..d0f0fe163 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ParameterAttributeForRazorComponentAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ParameterAttributeForRazorComponentAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class ParameterAttributeForRazorComponentAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/PreferReturningCollectionAbstractionInsteadOfImplementationAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/PreferReturningCollectionAbstractionInsteadOfImplementationAnalyzerTests.cs index 2f9eff6ab..18e78bca6 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/PreferReturningCollectionAbstractionInsteadOfImplementationAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/PreferReturningCollectionAbstractionInsteadOfImplementationAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/PreserveParamsOnOverrideAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/PreserveParamsOnOverrideAnalyzerTests.cs index 85df9fa25..7dbc35f32 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/PreserveParamsOnOverrideAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/PreserveParamsOnOverrideAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/PrimaryConstructorParameterShouldBeReadOnlyAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/PrimaryConstructorParameterShouldBeReadOnlyAnalyzerTests.cs index 109597abe..0bbb2895a 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/PrimaryConstructorParameterShouldBeReadOnlyAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/PrimaryConstructorParameterShouldBeReadOnlyAnalyzerTests.cs @@ -1,8 +1,6 @@ -#if CSHARP12_OR_GREATER -using System.Threading.Tasks; +#if CSHARP12_OR_GREATER using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ProcessStartAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ProcessStartAnalyzerTests.cs index 86af3dda2..2bd8279b0 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ProcessStartAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ProcessStartAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/RemoveEmptyBlockAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/RemoveEmptyBlockAnalyzerTests.cs index d3ac9b81e..dee74ff53 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/RemoveEmptyBlockAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/RemoveEmptyBlockAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/RemoveEmptyStatementAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/RemoveEmptyStatementAnalyzerTests.cs index e07f182c9..5225dd400 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/RemoveEmptyStatementAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/RemoveEmptyStatementAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/RemoveUselessToStringAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/RemoveUselessToStringAnalyzerTests.cs index f9e5e5844..9f94c0647 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/RemoveUselessToStringAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/RemoveUselessToStringAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ReplaceEnumToStringWithNameofAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ReplaceEnumToStringWithNameofAnalyzerTests.cs index 89521f5f5..e2a1650c4 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ReplaceEnumToStringWithNameofAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ReplaceEnumToStringWithNameofAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzerTests.cs index beb309f03..65829c319 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ReturnTaskFromResultInsteadOfReturningNullAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/SequenceNumberMustBeAConstantAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/SequenceNumberMustBeAConstantAnalyzerTests.cs index 2c81091a7..a42e7b721 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/SequenceNumberMustBeAConstantAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/SequenceNumberMustBeAConstantAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class SequenceNumberMustBeAConstantAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/SimplifyCallerArgumentExpressionAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/SimplifyCallerArgumentExpressionAnalyzerTests.cs index 41892daff..db6108871 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/SimplifyCallerArgumentExpressionAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/SimplifyCallerArgumentExpressionAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/StringShouldNotContainsNonDeterministicEndOfLineAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/StringShouldNotContainsNonDeterministicEndOfLineAnalyzerTests.cs index 9f2ae2d3f..2a7edb2a9 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/StringShouldNotContainsNonDeterministicEndOfLineAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/StringShouldNotContainsNonDeterministicEndOfLineAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/TaskInUsingAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/TaskInUsingAnalyzerTests.cs index 8d8abd054..ecef195ec 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/TaskInUsingAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/TaskInUsingAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class TaskInUsingAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/ThrowIfNullWithNonNullableInstanceAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ThrowIfNullWithNonNullableInstanceAnalyzerTests.cs index 9c95bb25e..d67c79273 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ThrowIfNullWithNonNullableInstanceAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ThrowIfNullWithNonNullableInstanceAnalyzerTests.cs @@ -1,9 +1,7 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class ThrowIfNullWithNonNullableInstanceAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/TypeCannotBeUsedInAnAttributeParameterAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/TypeCannotBeUsedInAnAttributeParameterAnalyzerTests.cs index d54f03ee2..dd257e4c9 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/TypeCannotBeUsedInAnAttributeParameterAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/TypeCannotBeUsedInAnAttributeParameterAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class TypeCannotBeUsedInAnAttributeParameterAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/TypeNameMustNotMatchNamespaceAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/TypeNameMustNotMatchNamespaceAnalyzerTests.cs index 30f67d339..e3c0c11c2 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/TypeNameMustNotMatchNamespaceAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/TypeNameMustNotMatchNamespaceAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/TypesShouldNotExtendSystemApplicationExceptionAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/TypesShouldNotExtendSystemApplicationExceptionAnalyzerTests.cs index cfb3ac995..8c5e35c3d 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/TypesShouldNotExtendSystemApplicationExceptionAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/TypesShouldNotExtendSystemApplicationExceptionAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseAnOverloadThatHasCancellationTokenAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseAnOverloadThatHasCancellationTokenAnalyzerTests.cs index 17a1d0232..2045cd25c 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseAnOverloadThatHasCancellationTokenAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseAnOverloadThatHasCancellationTokenAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseAnOverloadThatHasTimeProviderAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseAnOverloadThatHasTimeProviderAnalyzerTests.cs index 230853b92..5d2a1ea32 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseAnOverloadThatHasTimeProviderAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseAnOverloadThatHasTimeProviderAnalyzerTests.cs @@ -1,9 +1,7 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseArrayEmptyAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseArrayEmptyAnalyzerTests.cs index c913d71df..b20752aec 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseArrayEmptyAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseArrayEmptyAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseConfigureAwaitAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseConfigureAwaitAnalyzerTests.cs index f4037ca9e..aa8a7196c 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseConfigureAwaitAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseConfigureAwaitAnalyzerTests.cs @@ -1,9 +1,7 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseContainsKeyInsteadOfTryGetValueAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseContainsKeyInsteadOfTryGetValueAnalyzerTests.cs index e243ea97b..6a54e6116 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseContainsKeyInsteadOfTryGetValueAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseContainsKeyInsteadOfTryGetValueAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class UseContainsKeyInsteadOfTryGetValueAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseDateTimeUnixEpochAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseDateTimeUnixEpochAnalyzerTests.cs index 0df6798a0..9d0472e08 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseDateTimeUnixEpochAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseDateTimeUnixEpochAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public class UseDateTimeUnixEpochAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseEqualsMethodInsteadOfOperatorAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseEqualsMethodInsteadOfOperatorAnalyzerTests.cs index 59c3356ad..1e89f92e6 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseEqualsMethodInsteadOfOperatorAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseEqualsMethodInsteadOfOperatorAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public class UseEqualsMethodInsteadOfOperatorAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseEventArgsEmptyAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseEventArgsEmptyAnalyzerTests.cs index c31168c8b..fe2eda71c 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseEventArgsEmptyAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseEventArgsEmptyAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseEventHandlerOfTAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseEventHandlerOfTAnalyzerTests.cs index b28f81309..db5f742da 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseEventHandlerOfTAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseEventHandlerOfTAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseGuidEmptyAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseGuidEmptyAnalyzerTests.cs index e7c22ade2..982e305f5 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseGuidEmptyAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseGuidEmptyAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseIFormatProviderAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseIFormatProviderAnalyzerTests.cs index 5e335e8b7..9b24b4ce6 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseIFormatProviderAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseIFormatProviderAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseIsPatternInsteadOfSequenceEqualAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseIsPatternInsteadOfSequenceEqualAnalyzerTests.cs index e700596f3..78b391d0b 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseIsPatternInsteadOfSequenceEqualAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseIsPatternInsteadOfSequenceEqualAnalyzerTests.cs @@ -1,9 +1,7 @@ -#if CSHARP11_OR_GREATER -using System.Threading.Tasks; +#if CSHARP11_OR_GREATER using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class UseIsPatternInsteadOfSequenceEqualAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedTests.cs index 99c36b040..b12d43a69 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public class UseJSRuntimeInvokeVoidAsyncWhenReturnValueIsNotUsedTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseLangwordInXmlCommentAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseLangwordInXmlCommentAnalyzerTests.cs index c5ce3b1fc..e9de2f750 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseLangwordInXmlCommentAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseLangwordInXmlCommentAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class UseLangwordInXmlCommentAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseLazyInitializerEnsureInitializeAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseLazyInitializerEnsureInitializeAnalyzerTests.cs index 96aa4a0a5..a1ea3aa74 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseLazyInitializerEnsureInitializeAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseLazyInitializerEnsureInitializeAnalyzerTests.cs @@ -1,7 +1,6 @@ using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseOperatingSystemInsteadOfRuntimeInformationAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseOperatingSystemInsteadOfRuntimeInformationAnalyzerTests.cs index aab1e1a09..9eceda2a2 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseOperatingSystemInsteadOfRuntimeInformationAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseOperatingSystemInsteadOfRuntimeInformationAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public class UseOperatingSystemInsteadOfRuntimeInformationAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/UsePatternMatchingForEqualityComparisonsAnalyzerHasValueTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UsePatternMatchingForEqualityComparisonsAnalyzerHasValueTests.cs index 9d7be8c96..32529d20e 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UsePatternMatchingForEqualityComparisonsAnalyzerHasValueTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UsePatternMatchingForEqualityComparisonsAnalyzerHasValueTests.cs @@ -1,6 +1,5 @@ -using Meziantou.Analyzer.Rules; +using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UsePatternMatchingForEqualityComparisonsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UsePatternMatchingForEqualityComparisonsAnalyzerTests.cs index 5a8752f94..fee0fbe56 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UsePatternMatchingForEqualityComparisonsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UsePatternMatchingForEqualityComparisonsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseReadOnlyStructForRefReadOnlyParametersAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseReadOnlyStructForRefReadOnlyParametersAnalyzerTests.cs index 15a213338..82d6b7159 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseReadOnlyStructForRefReadOnlyParametersAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseReadOnlyStructForRefReadOnlyParametersAnalyzerTests.cs @@ -1,8 +1,6 @@ #if ROSLYN_4_8_OR_GREATER -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseRegexOptionsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseRegexOptionsAnalyzerTests.cs index 250b6a5cc..252e476bf 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseRegexOptionsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseRegexOptionsAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseRegexSourceGeneratorAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseRegexSourceGeneratorAnalyzerTests.cs index c1cb4d3a1..64eba68f7 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseRegexSourceGeneratorAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseRegexSourceGeneratorAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseRegexTimeoutAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseRegexTimeoutAnalyzerTests.cs index eca65067a..496f769f1 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseRegexTimeoutAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseRegexTimeoutAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseStringComparerAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseStringComparerAnalyzerTests.cs index 45d68a367..31973b83a 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseStringComparerAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseStringComparerAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseStringComparisonAnalyzerNonCultureSensitiveTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseStringComparisonAnalyzerNonCultureSensitiveTests.cs index c6d257eda..953cfb962 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseStringComparisonAnalyzerNonCultureSensitiveTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseStringComparisonAnalyzerNonCultureSensitiveTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseStringComparisonAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseStringComparisonAnalyzerTests.cs index 8880928bf..77f7dd7aa 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseStringComparisonAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseStringComparisonAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseStringCreateInsteadOfFormattableStringAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseStringCreateInsteadOfFormattableStringAnalyzerTests.cs index bf44cf3ec..a6faf1a45 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseStringCreateInsteadOfFormattableStringAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseStringCreateInsteadOfFormattableStringAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseStringEqualsAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseStringEqualsAnalyzerTests.cs index fef97b746..f6826cedc 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseStringEqualsAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseStringEqualsAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseStringEqualsInsteadOfIsPatternAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseStringEqualsInsteadOfIsPatternAnalyzerTests.cs index 5e41a9aa0..b5ff14046 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseStringEqualsInsteadOfIsPatternAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseStringEqualsInsteadOfIsPatternAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseStructLayoutAttributeAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseStructLayoutAttributeAnalyzerTests.cs index 4b0176384..4583becd0 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseStructLayoutAttributeAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseStructLayoutAttributeAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseSystemThreadingLockInsteadOfObjectAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseSystemThreadingLockInsteadOfObjectAnalyzerTests.cs index 94ed5e3cd..d5836c02d 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/UseSystemThreadingLockInsteadOfObjectAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseSystemThreadingLockInsteadOfObjectAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public sealed class UseSystemThreadingLockInsteadOfObjectAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/UseTaskUnwrapAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/UseTaskUnwrapAnalyzerTests.cs index 9b0115259..69c48aeab 100755 --- a/tests/Meziantou.Analyzer.Test/Rules/UseTaskUnwrapAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/UseTaskUnwrapAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ValidateArgumentsCorrectlyAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ValidateArgumentsCorrectlyAnalyzerTests.cs index 5c5be2c4f..8c4b5cdae 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ValidateArgumentsCorrectlyAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ValidateArgumentsCorrectlyAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Rules/ValidateUnsafeAccessorAttributeUsageAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ValidateUnsafeAccessorAttributeUsageAnalyzerTests.cs index ed2dff7e2..ba441772e 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ValidateUnsafeAccessorAttributeUsageAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ValidateUnsafeAccessorAttributeUsageAnalyzerTests.cs @@ -1,8 +1,6 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; public class ValidateUnsafeAccessorAttributeUsageAnalyzerTests diff --git a/tests/Meziantou.Analyzer.Test/Rules/ValueReturnedByStreamReadShouldBeUsedAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/ValueReturnedByStreamReadShouldBeUsedAnalyzerTests.cs index 18ebd51e2..5fc049223 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/ValueReturnedByStreamReadShouldBeUsedAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/ValueReturnedByStreamReadShouldBeUsedAnalyzerTests.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; using Meziantou.Analyzer.Rules; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Rules; diff --git a/tests/Meziantou.Analyzer.Test/Suppressors/CA1507SerializationPropertyNameSuppressorTests.cs b/tests/Meziantou.Analyzer.Test/Suppressors/CA1507SerializationPropertyNameSuppressorTests.cs index 8107c271d..48015548c 100644 --- a/tests/Meziantou.Analyzer.Test/Suppressors/CA1507SerializationPropertyNameSuppressorTests.cs +++ b/tests/Meziantou.Analyzer.Test/Suppressors/CA1507SerializationPropertyNameSuppressorTests.cs @@ -1,9 +1,7 @@ #if ROSLYN_4_10_OR_GREATER -using System.Threading.Tasks; using Meziantou.Analyzer.Suppressors; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Suppressors; public sealed class CA1507SerializationPropertyNameSuppressorTests diff --git a/tests/Meziantou.Analyzer.Test/Suppressors/CA1822DecoratedMethodSuppressorTests.cs b/tests/Meziantou.Analyzer.Test/Suppressors/CA1822DecoratedMethodSuppressorTests.cs index 366e6a7a6..4b8db2552 100644 --- a/tests/Meziantou.Analyzer.Test/Suppressors/CA1822DecoratedMethodSuppressorTests.cs +++ b/tests/Meziantou.Analyzer.Test/Suppressors/CA1822DecoratedMethodSuppressorTests.cs @@ -1,9 +1,7 @@ -#if ROSLYN_4_10_OR_GREATER -using System.Threading.Tasks; +#if ROSLYN_4_10_OR_GREATER using Meziantou.Analyzer.Suppressors; using Meziantou.Analyzer.Test.Helpers; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Suppressors; public sealed class CA1822DecoratedMethodSuppressorTests diff --git a/tests/Meziantou.Analyzer.Test/Suppressors/IDE0058SuppressorTests.cs b/tests/Meziantou.Analyzer.Test/Suppressors/IDE0058SuppressorTests.cs index 9764d8d2c..e8d422d4d 100644 --- a/tests/Meziantou.Analyzer.Test/Suppressors/IDE0058SuppressorTests.cs +++ b/tests/Meziantou.Analyzer.Test/Suppressors/IDE0058SuppressorTests.cs @@ -1,9 +1,7 @@ -#if ROSLYN_4_10_OR_GREATER -using System.Threading.Tasks; +#if ROSLYN_4_10_OR_GREATER using Meziantou.Analyzer.Suppressors; using Microsoft.CodeAnalysis; using TestHelper; -using Xunit; namespace Meziantou.Analyzer.Test.Suppressors; public sealed class IDE0058SuppressorTests