From ea68d4d0ff56ee849695fa8be8674722f84bb7c5 Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Fri, 20 Dec 2024 21:35:32 +0100 Subject: [PATCH] update --- .../CodeFixes/AddBracesCodeFixProvider.cs | 6 +- .../AddBracesToIfElseCodeFixProvider.cs | 4 +- ...onToDocumentationCommentCodeFixProvider.cs | 4 +- ...sesWhenCreatingNewObjectCodeFixProvider.cs | 2 +- ...AddOrRemoveTrailingCommaCodeFixProvider.cs | 2 +- ...phToDocumentationCommentCodeFixProvider.cs | 2 +- ...ParenthesesWhenNecessaryCodeFixProvider.cs | 4 +- .../AnonymousMethodCodeFixProvider.cs | 4 +- .../AssignmentExpressionCodeFixProvider.cs | 8 +- .../AttributeArgumentListCodeFixProvider.cs | 4 +- .../AvoidBoxingOfValueTypeCodeFixProvider.cs | 4 +- ...idNullReferenceExceptionCodeFixProvider.cs | 4 +- .../AwaitExpressionCodeFixProvider.cs | 2 +- .../BaseArgumentListCodeFixProvider.cs | 4 +- .../CodeFixes/BaseTypeCodeFixProvider.cs | 4 +- .../BinaryExpressionCodeFixProvider.cs | 52 +- .../CSharp/CodeFixes/BlockCodeFixProvider.cs | 8 +- .../CaseSwitchLabelCodeFixProvider.cs | 4 +- .../CastExpressionCodeFixProvider.cs | 4 +- .../ClassDeclarationCodeFixProvider.cs | 20 +- ...lueContainsUndefinedFlagCodeFixProvider.cs | 2 +- .../ConditionalExpressionCodeFixProvider.cs | 16 +- .../ConstructorDeclarationCodeFixProvider.cs | 12 +- ...sionBodyToExpressionBodyCodeFixProvider.cs | 4 +- ...eEachAttributeSeparatelyCodeFixProvider.cs | 4 +- ...eEnumMemberWithZeroValueCodeFixProvider.cs | 4 +- ...clareTypeInsideNamespaceCodeFixProvider.cs | 2 +- .../DefaultExpressionCodeFixProvider.cs | 4 +- .../DestructorDeclarationCodeFixProvider.cs | 4 +- .../DirectiveTriviaCodeFixProvider.cs | 2 +- ...seResourceAsynchronouslyCodeFixProvider.cs | 4 +- .../CodeFixes/DoStatementCodeFixProvider.cs | 4 +- .../CodeFixes/DocumentCodeFixProvider.cs | 4 +- .../DocumentationCommentCodeFixProvider.cs | 4 +- .../DuplicateWordInCommentCodeFixProvider.cs | 4 +- .../CodeFixes/ElseClauseCodeFixProvider.cs | 8 +- .../EmptyStatementCodeFixProvider.cs | 4 +- ...EndRegionDirectiveTriviaCodeFixProvider.cs | 4 +- .../EnumDeclarationCodeFixProvider.cs | 12 +- .../EnumMemberDeclarationCodeFixProvider.cs | 12 +- .../CodeFixes/ExpressionCodeFixProvider.cs | 8 +- ...tractMemberToNewDocumentCodeFixProvider.cs | 4 +- .../CodeFixes/FinallyClauseCodeFixProvider.cs | 4 +- .../CodeFixes/ForStatementCodeFixProvider.cs | 4 +- .../CodeFixes/IfStatementCodeFixProvider.cs | 28 +- ...entNonGenericCounterpartCodeFixProvider.cs | 4 +- .../CodeFixes/InitializerCodeFixProvider.cs | 4 +- .../InterpolatedStringCodeFixProvider.cs | 8 +- .../CodeFixes/InterpolationCodeFixProvider.cs | 2 +- ...InvalidArgumentNullCheckCodeFixProvider.cs | 2 +- .../InvocationExpressionCodeFixProvider.cs | 28 +- ...ocalDeclarationStatementCodeFixProvider.cs | 4 +- .../CodeFixes/LockStatementCodeFixProvider.cs | 4 +- ...MarkLocalVariableAsConstCodeFixProvider.cs | 2 +- ...DebuggerDisplayAttributeCodeFixProvider.cs | 2 +- .../MemberDeclarationCodeFixProvider.cs | 40 +- .../NamespaceDeclarationCodeFixProvider.cs | 8 +- .../CodeFixes/NormalizeNullCheckProvider.cs | 2 +- ...alizeUsageOfInfiniteLoopCodeFixProvider.cs | 2 +- ...ObjectCreationExpressionCodeFixProvider.cs | 4 +- .../OptimizeLinqMethodCallCodeFixProvider.cs | 4 +- .../OptimizeMethodCallCodeFixProvider.cs | 2 +- ...eStringBuilderAppendCallCodeFixProvider.cs | 2 +- ...tsInDocumentationCommentCodeFixProvider.cs | 2 +- ...TypeParameterConstraintsCodeFixProvider.cs | 2 +- .../CodeFixes/ParameterCodeFixProvider.cs | 12 +- ...meterNameDiffersFromBaseCodeFixProvider.cs | 4 +- .../ParenthesizedExpressionCodeFixProvider.cs | 2 +- .../PropertyDeclarationCodeFixProvider.cs | 4 +- .../RawStringLiteralCodeFixProvider.cs | 4 +- .../RegionDirectiveTriviaCodeFixProvider.cs | 4 +- .../CodeFixes/RemoveBracesCodeFixProvider.cs | 4 +- .../RemoveBracesFromIfElseCodeFixProvider.cs | 4 +- ...ntInDocumentationCommentCodeFixProvider.cs | 4 +- .../RemoveEmptyInitializerCodeFixProvider.cs | 4 +- .../RemoveEmptySyntaxCodeFixProvider.cs | 2 +- ...emoveEnumDefaultBaseTypeCodeFixProvider.cs | 4 +- .../RemoveOriginalExceptionCodeFixProvider.cs | 4 +- ...erFromTypeWithSinglePartCodeFixProvider.cs | 4 +- ...emoveRedundantAssignmentCodeFixProvider.cs | 4 +- ...emoveRedundantAsyncAwaitCodeFixProvider.cs | 2 +- ...eRedundantBooleanLiteralCodeFixProvider.cs | 4 +- .../RemoveRedundantCastCodeFixProvider.cs | 6 +- .../RemoveUnnecessaryBracesCodeFixProvider.cs | 2 +- .../RemoveUnnecessaryElseCodeFixProvider.cs | 4 +- ...mpletedTaskInsteadOfNullCodeFixProvider.cs | 2 +- ...pletedTaskInsteadOfNullCodeFixProvider2.cs | 2 +- ...implifyBooleanComparisonCodeFixProvider.cs | 2 +- .../SimplifyCodeBranchingCodeFixProvider.cs | 2 +- .../SimplifyLogicalNegationCodeFixProvider.cs | 2 +- ...lifyNestedUsingStatementCodeFixProvider.cs | 4 +- .../SimplifyNullableOfTCodeFixProvider.cs | 4 +- ...cumentationCommentTriviaCodeFixProvider.cs | 20 +- .../CodeFixes/StatementCodeFixProvider.cs | 16 +- .../CodeFixes/SwitchSectionCodeFixProvider.cs | 16 +- .../CSharp/CodeFixes/TokenCodeFixProvider.cs | 4 +- .../CSharp/CodeFixes/TypeCodeFixProvider.cs | 2 +- .../CodeFixes/TypeParameterCodeFixProvider.cs | 4 +- .../UnnecessaryAssignmentCodeFixProvider.cs | 2 +- .../UnnecessaryEnumFlagCodeFixProvider.cs | 4 +- ...yExplicitUseOfEnumeratorCodeFixProvider.cs | 2 +- ...UnnecessaryUnsafeContextCodeFixProvider.cs | 2 +- ...eOfVerbatimStringLiteralCodeFixProvider.cs | 4 +- .../CodeFixes/UnusedMemberCodeFixProvider.cs | 2 +- .../UnusedParameterCodeFixProvider.cs | 2 +- ...ousFunctionOrMethodGroupCodeFixProvider.cs | 2 +- .../CodeFixes/UseAsyncAwaitCodeFixProvider.cs | 2 +- .../UseAutoPropertyCodeFixProvider.cs | 2 +- ...lockBodyOrExpressionBodyCodeFixProvider.cs | 2 +- .../UseCoalesceExpressionCodeFixProvider.cs | 2 +- .../UseCompoundAssignmentCodeFixProvider.cs | 2 +- .../UseConditionalAccessCodeFixProvider.cs | 6 +- ...ringLiteralOrStringEmptyCodeFixProvider.cs | 2 +- ...ExplicitTypeInsteadOfVarCodeFixProvider.cs | 4 +- ...ypeInsteadOfVarInForEachCodeFixProvider.cs | 2 +- ...lyOrImplicitlyTypedArrayCodeFixProvider.cs | 2 +- ...gMethodOrBitwiseOperatorCodeFixProvider.cs | 2 +- ...OrExplicitObjectCreationCodeFixProvider.cs | 2 +- ...ratorInsteadOfAsOperatorCodeFixProvider.cs | 2 +- .../UseNameOfOperatorCodeFixProvider.cs | 2 +- ...gInsteadOfAsAndNullCheckCodeFixProvider.cs | 2 +- ...tchingInsteadOfIsAndCastCodeFixProvider.cs | 2 +- .../UsePredefinedTypeCodeFixProvider.cs | 4 +- ...nceInsteadOfStaticMethodCodeFixProvider.cs | 4 +- .../UseStringComparisonCodeFixProvider.cs | 2 +- ...VarInsteadOfExplicitTypeCodeFixProvider.cs | 6 +- .../UseVarOrExplicitTypeCodeFixProvider.cs | 2 +- .../UsingDirectiveCodeFixProvider.cs | 4 +- ...lidateArgumentsCorrectlyCodeFixProvider.cs | 2 +- .../VariableDeclarationCodeFixProvider.cs | 4 +- .../VariableDeclaratorCodeFixProvider.cs | 4 +- .../WhileStatementCodeFixProvider.cs | 8 +- .../CodeFixes/XmlNodeCodeFixProvider.cs | 2 +- .../WhitespaceTriviaCodeFixProvider.cs | 8 +- src/Analyzers.xml | 2 +- .../MergePreprocessorDirectivesAnalyzer.cs | 2 +- .../AttributeArgumentCodeFixProvider.cs | 4 +- .../CSharp/AttributeCodeFixProvider.cs | 8 +- .../CSharp/BinaryExpressionCodeFixProvider.cs | 8 +- ...ditionalAccessExpressionCodeFixProvider.cs | 2 +- .../ElementAccessExpressionCodeFixProvider.cs | 2 +- .../InvocationExpressionCodeFixProvider.cs | 8 +- ...leMemberAccessExpressionCodeFixProvider.cs | 2 +- .../UsePatternMatchingCodeFixProvider.cs | 2 +- .../CSharp/ElementAccessExpressionAnalyzer.cs | 4 +- .../CSharp/InvocationExpressionAnalyzer.cs | 22 +- .../CSharp/NamedTypeSymbolAnalyzer.cs | 22 +- .../SimpleMemberAccessExpressionAnalyzer.cs | 8 +- .../UnnecessaryConditionalAccessAnalyzer.cs | 8 +- .../CSharp/UsePatternMatchingAnalyzer.cs | 6 +- .../CSharp/DiagnosticIds.Generated.cs} | 2 +- .../CSharp/DiagnosticRules.Generated.cs | 868 +++++------ .../CodeAnalysisDiagnosticIds.Generated.cs} | 2 +- .../CodeAnalysisDiagnosticRules.Generated.cs} | 46 +- .../CSharp/DiagnosticIdentifiers.Generated.cs | 12 + .../CSharp/DiagnosticRules.Generated.cs | 13 + .../FormattingDiagnosticIds.Generated.cs} | 2 +- .../FormattingDiagnosticRules.Generated.cs} | 214 +-- .../AccessorDeclarationCodeFixProvider.cs | 12 +- .../CSharp/AccessorListCodeFixProvider.cs | 4 +- ...dAfterUsingDirectiveListCodeFixProvider.cs | 4 +- .../CSharp/BinaryExpressionCodeFixProvider.cs | 2 +- ...kLineBetweenDeclarationsCodeFixProvider.cs | 10 +- .../CSharp/BlockCodeFixProvider.cs | 8 +- .../CSharp/CompilationUnitCodeFixProvider.cs | 4 +- ...ditionalAccessExpressionCodeFixProvider.cs | 2 +- .../CSharp/DirectiveTriviaCodeFixProvider.cs | 8 +- .../CSharp/EnumDeclarationCodeFixProvider.cs | 2 +- ...opedNamespaceDeclarationCodeFixProvider.cs | 2 +- ...gOfBinaryExpressionChainCodeFixProvider.cs | 2 +- ...FixFormattingOfCallChainCodeFixProvider.cs | 2 +- .../FixFormattingOfListCodeFixProvider.cs | 2 +- .../CSharp/InitializerCodeFixProvider.cs | 4 +- .../LineIsTooLongCodeFixProvider.cs | 2 +- .../MemberDeclarationCodeFixProvider.cs | 8 +- ...izeWhitespaceAtEndOfFileCodeFixProvider.cs | 4 +- .../ReplaceTabWithSpacesCodeFixProvider.cs | 6 +- .../CSharp/StatementCodeFixProvider.cs | 16 +- .../CSharp/SwitchSectionCodeFixProvider.cs | 4 +- .../CSharp/SyntaxTokenCodeFixProvider.cs | 24 +- .../CSharp/SyntaxTriviaCodeFixProvider.cs | 32 +- ...erConstraintClauseSyntaxCodeFixProvider.cs | 2 +- .../NewLineCodeFixProvider.cs | 8 +- .../CSharp/AccessorListAnalyzer.cs | 14 +- ...BlankLineAfterEmbeddedStatementAnalyzer.cs | 4 +- ...ddBlankLineAfterRegionDirectiveAnalyzer.cs | 4 +- .../AddBlankLineAfterTopCommentAnalyzer.cs | 4 +- ...lankLineAfterUsingDirectiveListAnalyzer.cs | 4 +- ...ankLineBeforeEndRegionDirectiveAnalyzer.cs | 4 +- ...ddBlankLineBeforeTopDeclarationAnalyzer.cs | 4 +- ...ankLineBeforeUsingDirectiveListAnalyzer.cs | 4 +- ...eenClosingBraceAndNextStatementAnalyzer.cs | 4 +- ...dBlankLineBetweenSwitchSectionsAnalyzer.cs | 4 +- .../AddNewLineAfterSwitchLabelAnalyzer.cs | 4 +- ...NewLineBeforeWhileInDoStatementAnalyzer.cs | 6 +- .../AnalyzerOptionIsObsoleteAnalyzer.cs | 14 +- ...rFileScopedNamespaceDeclarationAnalyzer.cs | 6 +- .../BlankLineBetweenAccessorsAnalyzer.cs | 12 +- .../BlankLineBetweenDeclarationsAnalyzer.cs | 28 +- .../BlankLineBetweenSwitchSectionsAnalyzer.cs | 4 +- ...BlankLineBetweenUsingDirectivesAnalyzer.cs | 18 +- ...rmattingOfBinaryExpressionChainAnalyzer.cs | 4 +- .../FixFormattingOfCallChainAnalyzer.cs | 4 +- .../CSharp/FixFormattingOfListAnalyzer.cs | 4 +- .../CSharp/FormatAccessorBracesAnalyzer.cs | 12 +- .../CSharp/FormatBlockBracesAnalyzer.cs | 12 +- .../FormatTypeDeclarationBracesAnalyzer.cs | 4 +- .../CSharp/LineIsTooLongAnalyzer.cs | 4 +- ...lizeWhitespaceAtBeginningOfFileAnalyzer.cs | 4 +- .../NormalizeWhitespaceAtEndOfFileAnalyzer.cs | 4 +- ...eNewLineAfterOrBeforeArrowTokenAnalyzer.cs | 4 +- ...LineAfterOrBeforeBinaryOperatorAnalyzer.cs | 4 +- ...fterOrBeforeConditionalOperatorAnalyzer.cs | 4 +- ...NewLineAfterOrBeforeEqualsTokenAnalyzer.cs | 4 +- ...OrBeforeNullConditionalOperatorAnalyzer.cs | 4 +- .../PutAttributeListOnItsOwnLineAnalyzer.cs | 4 +- ...structorInitializerOnItsOwnLineAnalyzer.cs | 4 +- ...utEmbeddedStatementOnItsOwnLineAnalyzer.cs | 4 +- .../PutEnumMemberOnItsOwnLineAnalyzer.cs | 4 +- .../PutInitializerOnSingleLineAnalyzer.cs | 4 +- .../PutStatementOnItsOwnLineAnalyzer.cs | 4 +- ...ParameterConstraintOnItsOwnLineAnalyzer.cs | 4 +- .../RemoveNewLineBeforeBaseListAnalyzer.cs | 4 +- ...eBetweenIfKeywordAndElseKeywordAnalyzer.cs | 4 +- .../RequiredConfigOptionNotSetAnalyzer.cs | 14 +- .../CSharp/UseSpacesInsteadOfTabAnalyzer.cs | 4 +- .../WrapAndIndentEachNodeInListAnalyzer.cs | 4 +- ...riageReturnAndLinefeedAsNewLineAnalyzer.cs | 4 +- .../UseLinefeedAsNewLineAnalyzer.cs | 4 +- .../RCS1004RemoveBracesFromIfElseTests.cs | 12 +- ...CS1005SimplifyNestedUsingStatementTests.cs | 8 +- .../Analyzers.Tests/RCS1007AddBracesTests.cs | 30 +- .../RCS1013UsePredefinedTypeTests.cs | 6 +- ...UseExplicitlyTypedArrayOrViceVersaTests.cs | 54 +- .../RCS1014UseImplicitlyTypedArrayTests.cs | 24 +- .../RCS1015UseNameOfOperatorTests.cs | 4 +- .../RCS1016UseBlockBodyTests.cs | 64 +- ...BlockBodyWhenExpressionIsMultiLineTests.cs | 26 +- .../RCS1016UseExpressionBodyTests.cs | 82 +- .../RCS1018AddAccessibilityModifiersTests.cs | 30 +- ...CS1018RemoveAccessibilityModifiersTests.cs | 10 +- .../RCS1019OrderModifiersTests.cs | 2 +- .../RCS1020SimplifyNullableOfTTests.cs | 12 +- ...mbdaExpressionBodyToExpressionBodyTests.cs | 4 +- ...veUnnecessaryBracesInSwitchSectionTests.cs | 18 +- .../RCS1032RemoveRedundantParenthesesTests.cs | 50 +- .../RCS1036RemoveUnnecessaryBlankLineTests.cs | 46 +- .../RCS1037RemoveTrailingWhitespaceTests.cs | 4 +- .../RCS1040RemoveEmptyElseClauseTests.cs | 10 +- .../RCS1041RemoveEmptyInitializerTests.cs | 4 +- ...tialModifierFromTypeWithSinglePartTests.cs | 26 +- ...riginalExceptionFromThrowStatementTests.cs | 6 +- ...ronousMethodNameShouldEndWithAsyncTests.cs | 16 +- ...ousMethodNameShouldNotEndWithAsyncTests.cs | 14 +- .../RCS1049SimplifyBooleanComparisonTests.cs | 14 +- ...veParenthesesWhenCreatingNewObjectTests.cs | 10 +- ...omConditionOfConditionalExpressionTests.cs | 14 +- ...emicolonAtEndOfDeclarationAnalyzerTests.cs | 8 +- ...056AvoidUsageOfUsingAliasDirectiveTests.cs | 8 +- .../RCS1058UseCompoundAssignmentTests.cs | 18 +- ...S1060DeclareEachTypeInSeparateFileTests.cs | 4 +- .../RCS1061MergeIfWithNestedIfTests.cs | 4 +- .../RCS1066RemoveEmptyFinallyClauseTests.cs | 6 +- .../RCS1068SimplifyLogicalNegationTests.cs | 48 +- .../RCS1068SimplifyLogicalNegationTests2.cs | 12 +- .../RCS1073ConvertIfToReturnStatementTests.cs | 16 +- .../RCS1074RemoveRedundantConstructorTests.cs | 12 +- .../RCS1077OptimizeLinqMethodCallTests.cs | 114 +- ...UseEmptyStringLiteralOrStringEmptyTests.cs | 8 +- ...OrLengthPropertyInsteadOfAnyMethodTests.cs | 38 +- .../RCS1081SplitVariableDeclarationTests.cs | 2 +- ...sionInsteadOfConditionalExpressionTests.cs | 14 +- .../RCS1085UseAutoPropertyTests.cs | 68 +- ...seUnaryOperatorInsteadOfAssignmentTests.cs | 22 +- .../RCS1090AddCallToConfigureAwaitTests.cs | 34 +- .../RCS1090RemoveCallToConfigureAwaitTests.cs | 34 +- .../RCS1093FileContainsNoCodeTests.cs | 8 +- ...nvertHasFlagCallToBitwiseOperationTests.cs | 30 +- ...6UseHasFlagMethodOrBitwiseOperatorTests.cs | 22 +- ...RCS1097RemoveRedundantToStringCallTests.cs | 14 +- ...ldBePlacedOnRightSideOfComparisonsTests.cs | 18 +- ...ocumentationSummaryOnMultipleLinesTests.cs | 10 +- .../RCS1102MakeClassStaticTests.cs | 14 +- .../RCS1103ConvertIfToAssignmentTests.cs | 6 +- ...S1104SimplifyConditionalExpressionTests.cs | 16 +- ...moveRedundantStringToCharArrayCallTests.cs | 8 +- .../RCS1110DeclareTypeInsideNamespaceTests.cs | 2 +- ...CS1113UseStringIsNullOrEmptyMethodTests.cs | 6 +- ...114RemoveRedundantDelegateCreationTests.cs | 8 +- .../RCS1118MarkLocalVariableAsConstTests.cs | 10 +- ...RCS1123AddParenthesesWhenNecessaryTests.cs | 4 +- .../RCS1124InlineLocalVariableTests.cs | 16 +- .../RCS1128UseCoalesceExpressionTests.cs | 32 +- .../RCS1128UseCoalesceExpressionTests2.cs | 4 +- ...RemoveRedundantFieldInitializationTests.cs | 26 +- ...132RemoveRedundantOverridingMemberTests.cs | 2 +- .../RCS1134RemoveRedundantStatementTests.cs | 16 +- ...1135DeclareEnumMemberWithZeroValueTests.cs | 6 +- ...mmaryElementToDocumentationCommentTests.cs | 4 +- ...AddExceptionToDocumentationCommentTests.cs | 10 +- ...ParamElementToDocumentationCommentTests.cs | 2 +- ...ParamElementToDocumentationCommentTests.cs | 4 +- .../RCS1143SimplifyCoalesceExpressionTests.cs | 2 +- .../RCS1145RemoveRedundantAsOperatorTests.cs | 2 +- .../RCS1146UseConditionalAccessTests.cs | 56 +- .../RCS1151RemoveRedundantCastTests.cs | 24 +- .../RCS1151RemoveRedundantCastTests2.cs | 8 +- .../RCS1154SortEnumMembersTests.cs | 12 +- ...InsteadOfComparisonWithEmptyStringTests.cs | 6 +- ...siteEnumValueContainsUndefinedFlagTests.cs | 8 +- ...nGenericTypeShouldUseTypeParameterTests.cs | 4 +- .../RCS1159UseGenericEventHandlerTests.cs | 16 +- ...umMemberShouldDeclareExplicitValueTests.cs | 18 +- .../RCS1163UnusedParameterTests.cs | 22 +- .../RCS1164UnusedTypeParameterTests.cs | 2 +- .../RCS1169MakeFieldReadOnlyTests.cs | 36 +- .../RCS1170UseReadOnlyAutoPropertyTests.cs | 52 +- .../RCS1171SimplifyLazyInitializationTests.cs | 46 +- ...73UseCoalesceExpressionInsteadOfIfTests.cs | 16 +- .../RCS1174RemoveRedundantAsyncAwaitTests.cs | 50 +- .../RCS1179UnnecessaryAssignmentTests.cs | 16 +- .../RCS1180InlineLazyInitializationTests.cs | 8 +- ...nvertCommentToDocumentationCommentTests.cs | 34 +- ...CS1182RemoveRedundantBaseInterfaceTests.cs | 14 +- ...RegexInstanceInsteadOfStaticMethodTests.cs | 40 +- .../RCS1187UseConstantInsteadOfFieldTests.cs | 10 +- ...edundantAutoPropertyInitializationTests.cs | 20 +- .../RCS1190JoinStringExpressionsTests.cs | 36 +- ...clareEnumValueAsCombinationOfNamesTests.cs | 14 +- ...essaryUsageOfVerbatimStringLiteralTests.cs | 16 +- ...emberShouldNotChangeParamsModifierTests.cs | 8 +- ...1194ImplementExceptionConstructorsTests.cs | 2 +- ...allExtensionMethodAsInstanceMethodTests.cs | 2 +- ...197OptimizeStringBuilderAppendCallTests.cs | 66 +- .../RCS1198AvoidBoxingOfValueTypeTests.cs | 4 +- .../RCS1198AvoidBoxingOfValueTypeTests2.cs | 8 +- .../RCS1199UnnecessaryNullCheckTests.cs | 30 +- .../RCS1201UseMethodChainingTests.cs | 16 +- ...RCS1202AvoidNullReferenceExceptionTests.cs | 24 +- ...CS1202AvoidNullReferenceExceptionTests2.cs | 16 +- .../RCS1203UseAttributeUsageAttributeTests.cs | 10 +- .../RCS1204UseEventArgsEmptyTests.cs | 2 +- .../RCS1205OrderNamedArgumentsTests.cs | 12 +- ...cessInsteadOfConditionalExpressionTests.cs | 28 +- ...vertAnonymousFunctionToMethodGroupTests.cs | 32 +- ...vertMethodGroupToAnonymousFunctionTests.cs | 38 +- .../RCS1208ReduceIfNestingTests.cs | 38 +- ...10ReturnCompletedTaskInsteadOfNullTests.cs | 6 +- ...0ReturnCompletedTaskInsteadOfNullTests2.cs | 4 +- .../RCS1211RemoveUnnecessaryElseTests.cs | 8 +- .../RCS1212RemoveRedundantAssignmentTests.cs | 28 +- ...S1213RemoveUnusedMemberDeclarationTests.cs | 46 +- ...S1214UnnecessaryInterpolatedStringTests.cs | 22 +- ...pressionIsAlwaysEqualToTrueOrFalseTests.cs | 14 +- .../RCS1216UnnecessaryUnsafeContextTests.cs | 32 +- .../RCS1218SimplifyCodeBranchingTests.cs | 86 +- ...ePatternMatchingInsteadOfIsAndCastTests.cs | 44 +- ...ernMatchingInsteadOfAsAndNullCheckTests.cs | 26 +- ...RCS1222MergePreprocessorDirectivesTests.cs | 16 +- ...rkTypeWithDebuggerDisplayAttributeTests.cs | 28 +- .../RCS1224MakeMethodExtensionMethodTests.cs | 38 +- .../RCS1225MakeClassSealedTests.cs | 20 +- ...AddParagraphToDocumentationCommentTests.cs | 46 +- .../RCS1227ValidateArgumentsCorrectlyTests.cs | 18 +- ...nusedElementInDocumentationCommentTests.cs | 42 +- .../RCS1229UseAsyncAwaitTests.cs | 42 +- ...UnnecessaryExplicitUseOfEnumeratorTests.cs | 14 +- .../RCS1231MakeParameterRefReadOnlyTests.cs | 20 +- ...rderElementsInDocumentationCommentTests.cs | 14 +- .../RCS1233UseShortCircuitingOperatorTests.cs | 4 +- .../RCS1234DuplicateEnumValueTests.cs | 16 +- .../RCS1235OptimizeMethodCallTests.cs | 46 +- .../RCS1236UseExceptionFilterTests.cs | 28 +- .../RCS1237UseBitShiftOperatorTests.cs | 8 +- ...238AvoidNestedConditionalOperatorsTests.cs | 24 +- ...orStatementInsteadOfWhileStatementTests.cs | 12 +- .../RCS1240UnnecessaryOperatorTests.cs | 4 +- ...1241ImplementNonGenericCounterpartTests.cs | 14 +- ...nReadOnlyStructByReadOnlyReferenceTests.cs | 4 +- .../RCS1243DuplicateWordInCommentTests.cs | 14 +- .../RCS1244SimplifyDefaultExpressionTests.cs | 50 +- .../RCS1246UseElementAccessTests.cs | 24 +- .../RCS1247FixDocumentationCommentTagTests.cs | 12 +- .../RCS1248NormalizeNullCheckTests.cs | 14 +- ...49UnnecessaryNullForgivingOperatorTests.cs | 16 +- ...seImplicitOrExplicitObjectCreationTests.cs | 184 +-- .../RCS1251RemoveUnnecessaryBracesTests.cs | 20 +- ...CS1252NormalizeUsageOfInfiniteLoopTests.cs | 18 +- ...3FormatDocumentationCommentSummaryTests.cs | 20 +- ...1254NormalizeFormatOfEnumFlagValueTests.cs | 18 +- .../RCS1255SimplifyArgumentNullCheckTests.cs | 8 +- .../RCS1256InvalidArgumentNullCheckTests.cs | 12 +- .../RCS1257UseEnumFieldExplicitlyTests.cs | 10 +- .../RCS1258UnnecessaryEnumFlagTests.cs | 6 +- .../RCS1259RemoveEmptySyntaxTests.cs | 40 +- .../RCS1260AddOrRemoveTrailingCommaTests.cs | 30 +- ...S1261DisposeResourceAsynchronouslyTests.cs | 46 +- ...RCS1262UnnecessaryRawStringLiteralTests.cs | 16 +- ...lidReferenceInDocumentationCommentTests.cs | 24 +- .../RCS1264UseVarOrExplicitTypeTests.cs | 28 +- .../RCS1264UseVarOrExplicitTypeTests2.cs | 16 +- .../RCS1264UseVarOrExplicitTypeTests3.cs | 30 +- .../RCS1264UseVarOrExplicitTypeTests4.cs | 30 +- .../RCS1264UseVarOrExplicitTypeTests5.cs | 14 +- .../RCS1264UseVarOrExplicitTypeTests6.cs | 10 +- .../RCS1265RemoveRedundantCatchBlockTests.cs | 8 +- .../RCS1266UseRawStringLiteralTests.cs | 20 +- ...InterpolationInsteadOfStringConcatTests.cs | 20 +- .../RCS1268SimplifyNumericComparisonTests.cs | 16 +- .../ROS002AnalyzerOptionIsObsoleteTests.cs | 4 +- .../RCS9001UsePatternMatchingTests.cs | 30 +- ...9002UsePropertySyntaxNodeSpanStartTests.cs | 6 +- ...CS9003UnnecessaryConditionalAccessTests.cs | 6 +- ...9004CallAnyInsteadOfAccessingCountTests.cs | 30 +- .../RCS9005UnnecessaryNullCheckTests.cs | 8 +- .../RCS9006UseElementAccessTests.cs | 16 +- .../RCS9007UseReturnValueTests.cs | 6 +- ...allLastInsteadOfUsingElementAccessTests.cs | 20 +- .../RCS9009UnknownLanguageNameTests.cs | 22 +- ...deRefactoringProviderAttributeNameTests.cs | 6 +- ...ExportCodeFixProviderAttributeNameTests.cs | 6 +- ...AddBlankLineAfterEmbeddedStatementTests.cs | 28 +- ...02AddBlankLineAfterRegionDirectiveTests.cs | 18 +- ...ddBlankLineAfterUsingDirectiveListTests.cs | 26 +- ...dBlankLineBeforeEndRegionDirectiveTests.cs | 24 +- ...dEmptyLineBeforeUsingDirectiveListTests.cs | 20 +- ...CS0007AddBlankLineBetweenAccessorsTests.cs | 10 +- ...etweenClosingBraceAndNextStatementTests.cs | 38 +- ...DeclarationAndDocumentationCommentTests.cs | 14 +- ...010AddBlankLineBetweenDeclarationsTests.cs | 24 +- ...lankLineBetweenSingleLineAccessorsTests.cs | 14 +- ...kLineBetweenSingleLineDeclarationsTests.cs | 20 +- ...gleLineDeclarationsOfDifferentKindTests.cs | 12 +- ...4AddBlankLineBetweenSwitchSectionsTests.cs | 20 +- ...015BlankLineBetweenUsingDirectivesTests.cs | 28 +- ...16PutEachAttributeListOnItsOwnLineTests.cs | 50 +- .../RCS0020FormatAccessorBracesTests.cs | 20 +- .../RCS0021FormatBlockBracesTests.cs | 18 +- ...wLineAfterOpeningBraceOfEmptyBlockTests.cs | 8 +- ...RCS0023FormatTypeDeclarationBracesTests.cs | 10 +- .../RCS0024AddNewLineAfterSwitchLabelTests.cs | 8 +- ...RCS0025PutFullAccessorOnItsOwnLineTests.cs | 16 +- ...NewLineAfterOrBeforeBinaryOperatorTests.cs | 14 +- ...eforeConditionalExpressionOperatorTests.cs | 18 +- ...ConstructorInitializerOnItsOwnLineTests.cs | 8 +- ...30PutEmbeddedStatementOnItsOwnLineTests.cs | 26 +- .../RCS0031PutEnumMemberOnItsOwnLineTests.cs | 12 +- ...laceNewLineAfterOrBeforeArrowTokenTests.cs | 10 +- .../RCS0033PutStatementOnItsOwnLineTests.cs | 10 +- ...ypeParameterConstraintOnItsOwnLineTests.cs | 18 +- ...enSingleLineDeclarationsOfSameKindTests.cs | 16 +- ...ingDirectivesWithSameRootNamespaceTests.cs | 12 +- ...RCS0039RemoveNewLineBeforeBaseListTests.cs | 20 +- ...LineBetweenIfKeywordAndElseKeywordTests.cs | 10 +- ...inesFromAccessorListOfAutoPropertyTests.cs | 12 +- ...gleLineWhenStatementIsOnSingleLineTests.cs | 12 +- ...CarriageReturnAndLinefeedAsNewLineTests.cs | 6 +- .../RCS0045UseLinefeedAsNewLineTests.cs | 6 +- .../RCS0046UseSpacesInsteadOfTabTests.cs | 6 +- .../RCS0048PutInitializerOnSingleLineTests.cs | 48 +- ...RCS0049AddBlankLineAfterTopCommentTests.cs | 14 +- ...50AddBlankLineBeforeTopDeclarationTests.cs | 18 +- ...oveNewLineBeforeWhileInDoStatementTests.cs | 18 +- ...laceNewLineAfterOrBeforeEqualsSignTests.cs | 38 +- .../RCS0053FixFormattingOfListTests.cs | 104 +- .../RCS0054FixFormattingOfCallChainTests.cs | 34 +- ...xFormattingOfBinaryExpressionChainTests.cs | 24 +- .../RCS0056LineIsTooLongTests.cs | 104 +- ...rmalizeWhitespaceAtBeginningOfFileTests.cs | 16 +- ...0058NormalizeWhitespaceAtEndOfFileTests.cs | 36 +- ...terOrBeforeNullConditionalOperatorTests.cs | 16 +- ...dEmptyLineAfterFileScopedNamespaceTests.cs | 36 +- ...0061BlankLineBetweenSwitchSectionsTests.cs | 16 +- src/Tools/CodeGenerator/Program.cs | 38 +- .../src/configurationFiles.generated.ts | 1338 ----------------- tools/generate_code.ps1 | 2 +- tools/generate_configuration_file.ps1 | 2 +- tools/generate_metadata.ps1 | 2 +- 478 files changed, 3832 insertions(+), 5143 deletions(-) rename src/{Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs => Common/CSharp/DiagnosticIds.Generated.cs} (99%) rename src/{Analyzers => Common}/CSharp/DiagnosticRules.Generated.cs (77%) rename src/{CodeAnalysis.Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs => Common/CodeAnalysis/CSharp/CodeAnalysisDiagnosticIds.Generated.cs} (94%) rename src/{CodeAnalysis.Analyzers/CSharp/DiagnosticRules.Generated.cs => Common/CodeAnalysis/CSharp/CodeAnalysisDiagnosticRules.Generated.cs} (76%) create mode 100644 src/Common/Formatting/CSharp/DiagnosticIdentifiers.Generated.cs create mode 100644 src/Common/Formatting/CSharp/DiagnosticRules.Generated.cs rename src/{Formatting.Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs => Common/Formatting/CSharp/FormattingDiagnosticIds.Generated.cs} (98%) rename src/{Formatting.Analyzers/CSharp/DiagnosticRules.Generated.cs => Common/Formatting/CSharp/FormattingDiagnosticRules.Generated.cs} (75%) delete mode 100644 src/VisualStudioCode/package/src/configurationFiles.generated.ts diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddBracesCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddBracesCodeFixProvider.cs index 2eb93d3a49..b39b128e5b 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddBracesCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddBracesCodeFixProvider.cs @@ -21,9 +21,9 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.AddBracesWhenExpressionSpansOverMultipleLines, - DiagnosticIdentifiers.AddBraces, - DiagnosticIdentifiers.AddBracesToIfElse); + DiagnosticIds.AddBracesWhenExpressionSpansOverMultipleLines, + DiagnosticIds.AddBraces, + DiagnosticIds.AddBracesToIfElse); } } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddBracesToIfElseCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddBracesToIfElseCodeFixProvider.cs index 7c774b76f6..a29bdfb3e7 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddBracesToIfElseCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddBracesToIfElseCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class AddBracesToIfElseCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AddBracesToIfElseWhenExpressionSpansOverMultipleLines); } + get { return ImmutableArray.Create(DiagnosticIds.AddBracesToIfElseWhenExpressionSpansOverMultipleLines); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -33,7 +33,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Add braces to if-else", ct => AddBracesToIfElseRefactoring.RefactorAsync(context.Document, ifStatement, ct), - GetEquivalenceKey(DiagnosticIdentifiers.AddBracesToIfElseWhenExpressionSpansOverMultipleLines)); + GetEquivalenceKey(DiagnosticIds.AddBracesToIfElseWhenExpressionSpansOverMultipleLines)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddExceptionToDocumentationCommentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddExceptionToDocumentationCommentCodeFixProvider.cs index 8b7c0204f8..422cc46e4d 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddExceptionToDocumentationCommentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddExceptionToDocumentationCommentCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class AddExceptionToDocumentationCommentCodeFixProvider : BaseCode { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AddExceptionToDocumentationComment); } + get { return ImmutableArray.Create(DiagnosticIds.AddExceptionToDocumentationComment); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -33,7 +33,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.AddExceptionToDocumentationComment: + case DiagnosticIds.AddExceptionToDocumentationComment: { switch (node.Kind()) { diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddOrRemoveParenthesesWhenCreatingNewObjectCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddOrRemoveParenthesesWhenCreatingNewObjectCodeFixProvider.cs index 3a6f40857c..a9aaab8dcf 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddOrRemoveParenthesesWhenCreatingNewObjectCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddOrRemoveParenthesesWhenCreatingNewObjectCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class AddOrRemoveParenthesesWhenCreatingNewObjectCodeFixProvider : { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject); } + get { return ImmutableArray.Create(DiagnosticIds.IncludeParenthesesWhenCreatingNewObject); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddOrRemoveTrailingCommaCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddOrRemoveTrailingCommaCodeFixProvider.cs index 0275c60d6d..a9db14e537 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddOrRemoveTrailingCommaCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddOrRemoveTrailingCommaCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class AddOrRemoveTrailingCommaCodeFixProvider : BaseCodeFixProvide { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AddOrRemoveTrailingComma); } + get { return ImmutableArray.Create(DiagnosticIds.AddOrRemoveTrailingComma); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs index b793710b1c..25148abc79 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParagraphToDocumentationCommentCodeFixProvider.cs @@ -23,7 +23,7 @@ public sealed class AddParagraphToDocumentationCommentCodeFixProvider : BaseCode { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AddParagraphToDocumentationComment); } + get { return ImmutableArray.Create(DiagnosticIds.AddParagraphToDocumentationComment); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParenthesesWhenNecessaryCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParenthesesWhenNecessaryCodeFixProvider.cs index ad0ebd30a1..b623cae2f5 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParenthesesWhenNecessaryCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AddParenthesesWhenNecessaryCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class AddParenthesesWhenNecessaryCodeFixProvider : BaseCodeFixProv { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AddParenthesesWhenNecessary); } + get { return ImmutableArray.Create(DiagnosticIds.AddParenthesesWhenNecessary); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -46,7 +46,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) return AddParenthesesAccordingToOperatorPrecedenceAsync(document, expression, ct); } }, - GetEquivalenceKey(DiagnosticIdentifiers.AddParenthesesWhenNecessary)); + GetEquivalenceKey(DiagnosticIds.AddParenthesesWhenNecessary)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AnonymousMethodCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AnonymousMethodCodeFixProvider.cs index eaba928a56..8346631a79 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AnonymousMethodCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AnonymousMethodCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class AnonymousMethodCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseLambdaExpressionInsteadOfAnonymousMethod); } + get { return ImmutableArray.Create(DiagnosticIds.UseLambdaExpressionInsteadOfAnonymousMethod); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Use lambda expression instead of anonymous method", ct => UseLambdaInsteadOfAnonymousMethodRefactoring.RefactorAsync(context.Document, anonymousMethod, ct), - GetEquivalenceKey(DiagnosticIdentifiers.UseLambdaExpressionInsteadOfAnonymousMethod)); + GetEquivalenceKey(DiagnosticIds.UseLambdaExpressionInsteadOfAnonymousMethod)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AssignmentExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AssignmentExpressionCodeFixProvider.cs index f94a3611c0..3d0816ea2e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AssignmentExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AssignmentExpressionCodeFixProvider.cs @@ -27,8 +27,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UseUnaryOperatorInsteadOfAssignment, - DiagnosticIdentifiers.RemoveRedundantDelegateCreation); + DiagnosticIds.UseUnaryOperatorInsteadOfAssignment, + DiagnosticIds.RemoveRedundantDelegateCreation); } } @@ -45,7 +45,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.UseUnaryOperatorInsteadOfAssignment: + case DiagnosticIds.UseUnaryOperatorInsteadOfAssignment: { string operatorText = UseUnaryOperatorInsteadOfAssignmentAnalyzer.GetOperatorText(assignment); @@ -57,7 +57,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveRedundantDelegateCreation: + case DiagnosticIds.RemoveRedundantDelegateCreation: { CodeAction codeAction = CodeAction.Create( "Remove redundant delegate creation", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AttributeArgumentListCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AttributeArgumentListCodeFixProvider.cs index e45c9c3347..9b39a30841 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AttributeArgumentListCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AttributeArgumentListCodeFixProvider.cs @@ -17,7 +17,7 @@ public sealed class AttributeArgumentListCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveArgumentListFromAttribute); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveArgumentListFromAttribute); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -30,7 +30,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove parentheses", ct => context.Document.RemoveNodeAsync(attributeArgumentList, SyntaxRemoveOptions.KeepNoTrivia, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveArgumentListFromAttribute)); + GetEquivalenceKey(DiagnosticIds.RemoveArgumentListFromAttribute)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AvoidBoxingOfValueTypeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AvoidBoxingOfValueTypeCodeFixProvider.cs index cf82570bca..d1609cde84 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AvoidBoxingOfValueTypeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AvoidBoxingOfValueTypeCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class AvoidBoxingOfValueTypeCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AvoidBoxingOfValueType); } + get { return ImmutableArray.Create(DiagnosticIds.AvoidBoxingOfValueType); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -35,7 +35,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.AvoidBoxingOfValueType: + case DiagnosticIds.AvoidBoxingOfValueType: { CodeAction codeAction = CodeAction.Create( (expression.IsKind(SyntaxKind.CharacterLiteralExpression)) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AvoidNullReferenceExceptionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AvoidNullReferenceExceptionCodeFixProvider.cs index 3bf7a983ab..57cf9450f3 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AvoidNullReferenceExceptionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AvoidNullReferenceExceptionCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class AvoidNullReferenceExceptionCodeFixProvider : BaseCodeFixProv { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AvoidNullReferenceException); } + get { return ImmutableArray.Create(DiagnosticIds.AvoidNullReferenceException); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -60,7 +60,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Use conditional access", ct => RefactorAsync(context.Document, expression, ct), - GetEquivalenceKey(DiagnosticIdentifiers.AvoidNullReferenceException)); + GetEquivalenceKey(DiagnosticIds.AvoidNullReferenceException)); context.RegisterCodeFix(codeAction, context.Diagnostics); diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AwaitExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AwaitExpressionCodeFixProvider.cs index 6fc56ce528..b969e97064 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/AwaitExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/AwaitExpressionCodeFixProvider.cs @@ -24,7 +24,7 @@ public sealed class AwaitExpressionCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.ConfigureAwait); } + get { return ImmutableArray.Create(DiagnosticIds.ConfigureAwait); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/BaseArgumentListCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/BaseArgumentListCodeFixProvider.cs index 7964b57b76..dd22efc619 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/BaseArgumentListCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/BaseArgumentListCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class BaseArgumentListCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.OrderNamedArguments); } + get { return ImmutableArray.Create(DiagnosticIds.OrderNamedArguments); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.OrderNamedArguments: + case DiagnosticIds.OrderNamedArguments: { CodeAction codeAction = CodeAction.Create( "Order arguments", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/BaseTypeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/BaseTypeCodeFixProvider.cs index a02c27e53a..8eaeddbbc2 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/BaseTypeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/BaseTypeCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class BaseTypeCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantBaseInterface); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantBaseInterface); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove redundant base interface", ct => RemoveRedundantBaseInterfaceRefactoring.RefactorAsync(context.Document, baseType, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveRedundantBaseInterface)); + GetEquivalenceKey(DiagnosticIds.RemoveRedundantBaseInterface)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/BinaryExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/BinaryExpressionCodeFixProvider.cs index 04d7223fc1..e516d8621a 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/BinaryExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/BinaryExpressionCodeFixProvider.cs @@ -26,19 +26,19 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.ConstantValuesShouldBePlacedOnRightSideOfComparisons, - DiagnosticIdentifiers.UseStringIsNullOrEmptyMethod, - DiagnosticIdentifiers.SimplifyCoalesceExpression, - DiagnosticIdentifiers.RemoveRedundantAsOperator, - DiagnosticIdentifiers.UseStringLengthInsteadOfComparisonWithEmptyString, - DiagnosticIdentifiers.UnconstrainedTypeParameterCheckedForNull, - DiagnosticIdentifiers.ValueTypeObjectIsNeverEqualToNull, - DiagnosticIdentifiers.JoinStringExpressions, - DiagnosticIdentifiers.UseExclusiveOrOperator, - DiagnosticIdentifiers.UnnecessaryNullCheck, - DiagnosticIdentifiers.UseShortCircuitingOperator, - DiagnosticIdentifiers.UnnecessaryOperator, - DiagnosticIdentifiers.SimplifyNumericComparison); + DiagnosticIds.ConstantValuesShouldBePlacedOnRightSideOfComparisons, + DiagnosticIds.UseStringIsNullOrEmptyMethod, + DiagnosticIds.SimplifyCoalesceExpression, + DiagnosticIds.RemoveRedundantAsOperator, + DiagnosticIds.UseStringLengthInsteadOfComparisonWithEmptyString, + DiagnosticIds.UnconstrainedTypeParameterCheckedForNull, + DiagnosticIds.ValueTypeObjectIsNeverEqualToNull, + DiagnosticIds.JoinStringExpressions, + DiagnosticIds.UseExclusiveOrOperator, + DiagnosticIds.UnnecessaryNullCheck, + DiagnosticIds.UseShortCircuitingOperator, + DiagnosticIds.UnnecessaryOperator, + DiagnosticIds.SimplifyNumericComparison); } } @@ -55,7 +55,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.ConstantValuesShouldBePlacedOnRightSideOfComparisons: + case DiagnosticIds.ConstantValuesShouldBePlacedOnRightSideOfComparisons: { CodeAction codeAction = CodeAction.Create( "Swap operands", @@ -65,7 +65,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseStringIsNullOrEmptyMethod: + case DiagnosticIds.UseStringIsNullOrEmptyMethod: { CodeAction codeAction = CodeAction.Create( "Use 'string.IsNullOrEmpty' method", @@ -75,7 +75,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.SimplifyCoalesceExpression: + case DiagnosticIds.SimplifyCoalesceExpression: { ExpressionSyntax expression = binaryExpression.Left; @@ -93,7 +93,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveRedundantAsOperator: + case DiagnosticIds.RemoveRedundantAsOperator: { CodeAction codeAction = CodeAction.Create( "Remove redundant 'as' operator", @@ -103,7 +103,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseStringLengthInsteadOfComparisonWithEmptyString: + case DiagnosticIds.UseStringLengthInsteadOfComparisonWithEmptyString: { CodeAction codeAction = CodeAction.Create( "Use string.Length", @@ -113,7 +113,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UnconstrainedTypeParameterCheckedForNull: + case DiagnosticIds.UnconstrainedTypeParameterCheckedForNull: { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); @@ -127,7 +127,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.ValueTypeObjectIsNeverEqualToNull: + case DiagnosticIds.ValueTypeObjectIsNeverEqualToNull: { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); @@ -155,7 +155,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.JoinStringExpressions: + case DiagnosticIds.JoinStringExpressions: { CodeAction codeAction = CodeAction.Create( "Join string expressions", @@ -165,7 +165,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseExclusiveOrOperator: + case DiagnosticIds.UseExclusiveOrOperator: { CodeAction codeAction = CodeAction.Create( "Use ^ operator", @@ -175,7 +175,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UnnecessaryNullCheck: + case DiagnosticIds.UnnecessaryNullCheck: { CodeAction codeAction = CodeAction.Create( "Remove unnecessary null check", @@ -185,7 +185,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseShortCircuitingOperator: + case DiagnosticIds.UseShortCircuitingOperator: { SyntaxToken operatorToken = binaryExpression.OperatorToken; @@ -224,7 +224,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UnnecessaryOperator: + case DiagnosticIds.UnnecessaryOperator: { CodeAction codeAction = CodeAction.Create( "Use '==' operator", @@ -244,7 +244,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.SimplifyNumericComparison: + case DiagnosticIds.SimplifyNumericComparison: { CodeAction codeAction = CodeAction.Create( "Simplify numeric comparison", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/BlockCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/BlockCodeFixProvider.cs index 28317bcedb..47df7bb148 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/BlockCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/BlockCodeFixProvider.cs @@ -24,8 +24,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.SimplifyLazyInitialization, - DiagnosticIdentifiers.RemoveUnnecessaryBracesInSwitchSection); + DiagnosticIds.SimplifyLazyInitialization, + DiagnosticIds.RemoveUnnecessaryBracesInSwitchSection); } } @@ -42,7 +42,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.SimplifyLazyInitialization: + case DiagnosticIds.SimplifyLazyInitialization: { CodeAction codeAction = CodeAction.Create( "Simplify lazy initialization", @@ -52,7 +52,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveUnnecessaryBracesInSwitchSection: + case DiagnosticIds.RemoveUnnecessaryBracesInSwitchSection: { CodeAction codeAction = CodeAction.Create( "Remove braces", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/CaseSwitchLabelCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/CaseSwitchLabelCodeFixProvider.cs index cd8fc86fe0..21c6e0f4e6 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/CaseSwitchLabelCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/CaseSwitchLabelCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class CaseSwitchLabelCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveUnnecessaryCaseLabel); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveUnnecessaryCaseLabel); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -37,7 +37,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) label, ct); }, - GetEquivalenceKey(DiagnosticIdentifiers.RemoveUnnecessaryCaseLabel)); + GetEquivalenceKey(DiagnosticIds.RemoveUnnecessaryCaseLabel)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/CastExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/CastExpressionCodeFixProvider.cs index d1fb6b4cc0..b7b6fe21ef 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/CastExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/CastExpressionCodeFixProvider.cs @@ -23,7 +23,7 @@ public sealed class CastExpressionCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseEnumFieldExplicitly); } + get { return ImmutableArray.Create(DiagnosticIds.UseEnumFieldExplicitly); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Use enum field explicitly", ct => UseEnumFieldExplicitlyAsync(castExpression, document, ct), - GetEquivalenceKey(DiagnosticIdentifiers.UseEnumFieldExplicitly)); + GetEquivalenceKey(DiagnosticIds.UseEnumFieldExplicitly)); context.RegisterCodeFix(codeAction, diagnostic); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ClassDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ClassDeclarationCodeFixProvider.cs index 472a59c80b..b3c3a8c236 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ClassDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ClassDeclarationCodeFixProvider.cs @@ -28,11 +28,11 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.MakeClassStatic, - DiagnosticIdentifiers.AddStaticModifierToAllPartialClassDeclarations, - DiagnosticIdentifiers.ImplementExceptionConstructors, - DiagnosticIdentifiers.UseAttributeUsageAttribute, - DiagnosticIdentifiers.MakeClassSealed); + DiagnosticIds.MakeClassStatic, + DiagnosticIds.AddStaticModifierToAllPartialClassDeclarations, + DiagnosticIds.ImplementExceptionConstructors, + DiagnosticIds.UseAttributeUsageAttribute, + DiagnosticIds.MakeClassSealed); } } @@ -47,7 +47,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.MakeClassStatic: + case DiagnosticIds.MakeClassStatic: { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); @@ -67,12 +67,12 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) break; } - case DiagnosticIdentifiers.AddStaticModifierToAllPartialClassDeclarations: + case DiagnosticIds.AddStaticModifierToAllPartialClassDeclarations: { ModifiersCodeFixRegistrator.AddModifier(context, diagnostic, classDeclaration, SyntaxKind.StaticKeyword); break; } - case DiagnosticIdentifiers.ImplementExceptionConstructors: + case DiagnosticIds.ImplementExceptionConstructors: { CodeAction codeAction = CodeAction.Create( "Generate exception constructors", @@ -88,7 +88,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseAttributeUsageAttribute: + case DiagnosticIds.UseAttributeUsageAttribute: { CodeAction codeAction = CodeAction.Create( "Use AttributeUsageAttribute", @@ -98,7 +98,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.MakeClassSealed: + case DiagnosticIds.MakeClassSealed: { ModifiersCodeFixRegistrator.AddModifier( context, diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/CompositeEnumValueContainsUndefinedFlagCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/CompositeEnumValueContainsUndefinedFlagCodeFixProvider.cs index c58b5a1fc7..7f3cbd96d2 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/CompositeEnumValueContainsUndefinedFlagCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/CompositeEnumValueContainsUndefinedFlagCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class CompositeEnumValueContainsUndefinedFlagCodeFixProvider : Bas { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.CompositeEnumValueContainsUndefinedFlag); } + get { return ImmutableArray.Create(DiagnosticIds.CompositeEnumValueContainsUndefinedFlag); } } public override FixAllProvider GetFixAllProvider() => null; diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConditionalExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConditionalExpressionCodeFixProvider.cs index 5cdc6122b6..a6f7642a75 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConditionalExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConditionalExpressionCodeFixProvider.cs @@ -28,10 +28,10 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression, - DiagnosticIdentifiers.SimplifyConditionalExpression, - DiagnosticIdentifiers.UseConditionalAccessInsteadOfConditionalExpression, - DiagnosticIdentifiers.AvoidNestedConditionalOperators); + DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression, + DiagnosticIds.SimplifyConditionalExpression, + DiagnosticIds.UseConditionalAccessInsteadOfConditionalExpression, + DiagnosticIds.AvoidNestedConditionalOperators); } } @@ -48,7 +48,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression: + case DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression: { CodeAction codeAction = CodeAction.Create( "Use coalesce expression", @@ -64,7 +64,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.SimplifyConditionalExpression: + case DiagnosticIds.SimplifyConditionalExpression: { CodeAction codeAction = CodeAction.Create( "Simplify conditional expression", @@ -74,7 +74,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseConditionalAccessInsteadOfConditionalExpression: + case DiagnosticIds.UseConditionalAccessInsteadOfConditionalExpression: { CodeAction codeAction = CodeAction.Create( "Use conditional access", @@ -90,7 +90,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.AvoidNestedConditionalOperators: + case DiagnosticIds.AvoidNestedConditionalOperators: { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConstructorDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConstructorDeclarationCodeFixProvider.cs index ae95e8e1d3..2eddf87922 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConstructorDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConstructorDeclarationCodeFixProvider.cs @@ -21,9 +21,9 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.RemoveRedundantBaseConstructorCall, - DiagnosticIdentifiers.RemoveRedundantConstructor, - DiagnosticIdentifiers.AbstractTypeShouldNotHavePublicConstructors); + DiagnosticIds.RemoveRedundantBaseConstructorCall, + DiagnosticIds.RemoveRedundantConstructor, + DiagnosticIds.AbstractTypeShouldNotHavePublicConstructors); } } @@ -38,7 +38,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveRedundantBaseConstructorCall: + case DiagnosticIds.RemoveRedundantBaseConstructorCall: { CodeAction codeAction = CodeAction.Create( "Remove redundant base constructor call", @@ -48,7 +48,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveRedundantConstructor: + case DiagnosticIds.RemoveRedundantConstructor: { CodeAction codeAction = CodeActionFactory.RemoveMemberDeclaration( context.Document, @@ -59,7 +59,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.AbstractTypeShouldNotHavePublicConstructors: + case DiagnosticIds.AbstractTypeShouldNotHavePublicConstructors: { CodeAction codeAction = CodeAction.Create( "Change accessibility to 'protected'", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConvertLambdaExpressionBodyToExpressionBodyCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConvertLambdaExpressionBodyToExpressionBodyCodeFixProvider.cs index 4d43f598e4..e25e8bb769 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConvertLambdaExpressionBodyToExpressionBodyCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ConvertLambdaExpressionBodyToExpressionBodyCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class ConvertLambdaExpressionBodyToExpressionBodyCodeFixProvider : { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.ConvertLambdaExpressionBodyToExpressionBody); } + get { return ImmutableArray.Create(DiagnosticIds.ConvertLambdaExpressionBodyToExpressionBody); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( ConvertLambdaBlockBodyToExpressionBodyRefactoring.Title, ct => ConvertLambdaBlockBodyToExpressionBodyRefactoring.RefactorAsync(context.Document, (LambdaExpressionSyntax)block.Parent, ct), - GetEquivalenceKey(DiagnosticIdentifiers.ConvertLambdaExpressionBodyToExpressionBody)); + GetEquivalenceKey(DiagnosticIds.ConvertLambdaExpressionBodyToExpressionBody)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareEachAttributeSeparatelyCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareEachAttributeSeparatelyCodeFixProvider.cs index 160a5ffc5a..87f6a17289 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareEachAttributeSeparatelyCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareEachAttributeSeparatelyCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class DeclareEachAttributeSeparatelyCodeFixProvider : BaseCodeFixP { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.DeclareEachAttributeSeparately); } + get { return ImmutableArray.Create(DiagnosticIds.DeclareEachAttributeSeparately); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Split attributes", ct => DeclareEachAttributeSeparatelyRefactoring.RefactorAsync(context.Document, attributeList, ct), - GetEquivalenceKey(DiagnosticIdentifiers.DeclareEachAttributeSeparately)); + GetEquivalenceKey(DiagnosticIds.DeclareEachAttributeSeparately)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareEnumMemberWithZeroValueCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareEnumMemberWithZeroValueCodeFixProvider.cs index a0a03e84cb..24121d483d 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareEnumMemberWithZeroValueCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareEnumMemberWithZeroValueCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class DeclareEnumMemberWithZeroValueCodeFixProvider : BaseCodeFixP { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.DeclareEnumMemberWithZeroValue); } + get { return ImmutableArray.Create(DiagnosticIds.DeclareEnumMemberWithZeroValue); } } public override FixAllProvider GetFixAllProvider() => null; @@ -36,7 +36,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Declare enum member with zero value", ct => RefactorAsync(context.Document, enumDeclaration, ct), - GetEquivalenceKey(DiagnosticIdentifiers.DeclareEnumMemberWithZeroValue)); + GetEquivalenceKey(DiagnosticIds.DeclareEnumMemberWithZeroValue)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareTypeInsideNamespaceCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareTypeInsideNamespaceCodeFixProvider.cs index d4b5123272..6bfcac5f64 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareTypeInsideNamespaceCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DeclareTypeInsideNamespaceCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class DeclareTypeInsideNamespaceCodeFixProvider : BaseCodeFixProvi { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.DeclareTypeInsideNamespace); } + get { return ImmutableArray.Create(DiagnosticIds.DeclareTypeInsideNamespace); } } public override FixAllProvider GetFixAllProvider() => null; diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DefaultExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DefaultExpressionCodeFixProvider.cs index 2fe7a4c387..ca33361cc4 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DefaultExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DefaultExpressionCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class DefaultExpressionCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.SimplifyDefaultExpression); } + get { return ImmutableArray.Create(DiagnosticIds.SimplifyDefaultExpression); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -34,7 +34,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.SimplifyDefaultExpression: + case DiagnosticIds.SimplifyDefaultExpression: { CodeAction codeAction = CodeAction.Create( "Simplify 'default' expression", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DestructorDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DestructorDeclarationCodeFixProvider.cs index 8403c2d96f..62d32cfb3f 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DestructorDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DestructorDeclarationCodeFixProvider.cs @@ -17,7 +17,7 @@ public sealed class DestructorDeclarationCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveEmptyDestructor); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveEmptyDestructor); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveEmptyDestructor: + case DiagnosticIds.RemoveEmptyDestructor: { CodeAction codeAction = CodeActionFactory.RemoveMemberDeclaration( context.Document, diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DirectiveTriviaCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DirectiveTriviaCodeFixProvider.cs index fa475d2e3d..6c145aeed7 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DirectiveTriviaCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DirectiveTriviaCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class DirectiveTriviaCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.MergePreprocessorDirectives); } + get { return ImmutableArray.Create(DiagnosticIds.MergePreprocessorDirectives); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DisposeResourceAsynchronouslyCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DisposeResourceAsynchronouslyCodeFixProvider.cs index 8b55dd5c87..5e81850045 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DisposeResourceAsynchronouslyCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DisposeResourceAsynchronouslyCodeFixProvider.cs @@ -23,7 +23,7 @@ public sealed class DisposeResourceAsynchronouslyCodeFixProvider : BaseCodeFixPr public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.DisposeResourceAsynchronously); } + get { return ImmutableArray.Create(DiagnosticIds.DisposeResourceAsynchronously); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -44,7 +44,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.DisposeResourceAsynchronously: + case DiagnosticIds.DisposeResourceAsynchronously: { if (node is LocalDeclarationStatementSyntax localDeclaration) { diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DoStatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DoStatementCodeFixProvider.cs index f91d74c548..c0b1cdc20c 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DoStatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DoStatementCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class DoStatementCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AvoidUsageOfDoStatementToCreateInfiniteLoop); } + get { return ImmutableArray.Create(DiagnosticIds.AvoidUsageOfDoStatementToCreateInfiniteLoop); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -37,7 +37,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) doStatement, ct); }, - GetEquivalenceKey(DiagnosticIdentifiers.AvoidUsageOfDoStatementToCreateInfiniteLoop)); + GetEquivalenceKey(DiagnosticIds.AvoidUsageOfDoStatementToCreateInfiniteLoop)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DocumentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DocumentCodeFixProvider.cs index ef75b0c39a..e49000f25e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DocumentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DocumentCodeFixProvider.cs @@ -16,7 +16,7 @@ public sealed class DocumentCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.FileContainsNoCode); } + get { return ImmutableArray.Create(DiagnosticIds.FileContainsNoCode); } } public override FixAllProvider GetFixAllProvider() @@ -30,7 +30,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.FileContainsNoCode: + case DiagnosticIds.FileContainsNoCode: { CodeAction codeAction = CodeAction.Create( "Remove file with no code", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DocumentationCommentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DocumentationCommentCodeFixProvider.cs index 7a4b1dd7f6..9edb48aa8f 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DocumentationCommentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DocumentationCommentCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class DocumentationCommentCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AddSummaryElementToDocumentationComment); } + get { return ImmutableArray.Create(DiagnosticIds.AddSummaryElementToDocumentationComment); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.AddSummaryElementToDocumentationComment: + case DiagnosticIds.AddSummaryElementToDocumentationComment: { CodeAction codeAction = CodeAction.Create( "Add summary element", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DuplicateWordInCommentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DuplicateWordInCommentCodeFixProvider.cs index c2608d2859..a0246c3106 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/DuplicateWordInCommentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/DuplicateWordInCommentCodeFixProvider.cs @@ -17,7 +17,7 @@ public sealed class DuplicateWordInCommentCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.DuplicateWordInComment); } + get { return ImmutableArray.Create(DiagnosticIds.DuplicateWordInComment); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -42,7 +42,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove duplicate word", ct => context.Document.WithTextChangeAsync(TextSpan.FromBounds(start, context.Span.End), "", ct), - GetEquivalenceKey(DiagnosticIdentifiers.DuplicateWordInComment)); + GetEquivalenceKey(DiagnosticIds.DuplicateWordInComment)); context.RegisterCodeFix(codeAction, context.Diagnostics[0]); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ElseClauseCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ElseClauseCodeFixProvider.cs index 0b981b3149..ced928feda 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ElseClauseCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ElseClauseCodeFixProvider.cs @@ -22,8 +22,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.RemoveEmptyElseClause, - DiagnosticIdentifiers.MergeElseWithNestedIf); + DiagnosticIds.RemoveEmptyElseClause, + DiagnosticIds.MergeElseWithNestedIf); } } @@ -38,7 +38,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveEmptyElseClause: + case DiagnosticIds.RemoveEmptyElseClause: { CodeAction codeAction = CodeAction.Create( "Remove empty 'else' clause", @@ -48,7 +48,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.MergeElseWithNestedIf: + case DiagnosticIds.MergeElseWithNestedIf: { CodeAction codeAction = CodeAction.Create( "Remove braces", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/EmptyStatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/EmptyStatementCodeFixProvider.cs index 8b98035e5a..05fda2e87c 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/EmptyStatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/EmptyStatementCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class EmptyStatementCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveEmptyStatement); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveEmptyStatement); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove empty statement", ct => RemoveEmptyStatementRefactoring.RefactorAsync(context.Document, emptyStatement, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveEmptyStatement)); + GetEquivalenceKey(DiagnosticIds.RemoveEmptyStatement)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/EndRegionDirectiveTriviaCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/EndRegionDirectiveTriviaCodeFixProvider.cs index 7208664136..a16e8371c0 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/EndRegionDirectiveTriviaCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/EndRegionDirectiveTriviaCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class EndRegionDirectiveTriviaCodeFixProvider : BaseCodeFixProvide { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AddOrRemoveRegionName); } + get { return ImmutableArray.Create(DiagnosticIds.AddOrRemoveRegionName); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -38,7 +38,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) ? "Add region name to #endregion" : "Remove region name from #endregion", ct => AddOrRemoveRegionNameRefactoring.RefactorAsync(context.Document, endRegionDirective, trivia, ct), - GetEquivalenceKey(DiagnosticIdentifiers.AddOrRemoveRegionName)); + GetEquivalenceKey(DiagnosticIds.AddOrRemoveRegionName)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumDeclarationCodeFixProvider.cs index 212d524b72..288e9747a4 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumDeclarationCodeFixProvider.cs @@ -27,9 +27,9 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.SortEnumMembers, - DiagnosticIdentifiers.EnumShouldDeclareExplicitValues, - DiagnosticIdentifiers.UseBitShiftOperator); + DiagnosticIds.SortEnumMembers, + DiagnosticIds.EnumShouldDeclareExplicitValues, + DiagnosticIds.UseBitShiftOperator); } } @@ -46,7 +46,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.SortEnumMembers: + case DiagnosticIds.SortEnumMembers: { CodeAction codeAction = CodeAction.Create( $"Sort '{enumDeclaration.Identifier}' members", @@ -56,7 +56,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.EnumShouldDeclareExplicitValues: + case DiagnosticIds.EnumShouldDeclareExplicitValues: { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); @@ -99,7 +99,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) break; } - case DiagnosticIdentifiers.UseBitShiftOperator: + case DiagnosticIds.UseBitShiftOperator: { CodeAction codeAction = CodeAction.Create( "Use '<<' operator", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumMemberDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumMemberDeclarationCodeFixProvider.cs index 277d07e8cb..2a7cd99a54 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumMemberDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumMemberDeclarationCodeFixProvider.cs @@ -27,9 +27,9 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames, - DiagnosticIdentifiers.DuplicateEnumValue, - DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue); + DiagnosticIds.DeclareEnumValueAsCombinationOfNames, + DiagnosticIds.DuplicateEnumValue, + DiagnosticIds.NormalizeFormatOfEnumFlagValue); } } @@ -45,7 +45,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames: + case DiagnosticIds.DeclareEnumValueAsCombinationOfNames: { CodeAction codeAction = CodeAction.Create( "Declare value as combination of names", @@ -55,7 +55,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.DuplicateEnumValue: + case DiagnosticIds.DuplicateEnumValue: { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); @@ -75,7 +75,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue: + case DiagnosticIds.NormalizeFormatOfEnumFlagValue: { EnumFlagValueStyle style = document.GetConfigOptions(enumMemberDeclaration.SyntaxTree).GetEnumFlagValueStyle(); diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ExpressionCodeFixProvider.cs index 3a39737672..625ad79b6e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ExpressionCodeFixProvider.cs @@ -24,8 +24,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse, - DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator); + DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse, + DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator); } } @@ -42,7 +42,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator: + case DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator: { if (expression is ParenthesizedExpressionSyntax parenthesizedExpression) { @@ -62,7 +62,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) break; } - case DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse: + case DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse: { if (expression.IsKind( SyntaxKind.LessThanExpression, diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ExtractMemberToNewDocumentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ExtractMemberToNewDocumentCodeFixProvider.cs index 2f178cd00d..2873696f88 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ExtractMemberToNewDocumentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ExtractMemberToNewDocumentCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class ExtractMemberToNewDocumentCodeFixProvider : BaseCodeFixProvi { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.DeclareEachTypeInSeparateFile); } + get { return ImmutableArray.Create(DiagnosticIds.DeclareEachTypeInSeparateFile); } } public override FixAllProvider GetFixAllProvider() @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( title, ct => ExtractTypeDeclarationToNewDocumentRefactoring.RefactorAsync(context.Document, memberDeclaration, ct), - GetEquivalenceKey(DiagnosticIdentifiers.DeclareEachTypeInSeparateFile)); + GetEquivalenceKey(DiagnosticIds.DeclareEachTypeInSeparateFile)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/FinallyClauseCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/FinallyClauseCodeFixProvider.cs index 2cddf8731e..2f437bd15b 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/FinallyClauseCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/FinallyClauseCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class FinallyClauseCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveEmptyFinallyClause); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveEmptyFinallyClause); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -33,7 +33,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove empty 'finally' clause", ct => RemoveEmptyFinallyClauseAsync(context.Document, finallyClause, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveEmptyFinallyClause)); + GetEquivalenceKey(DiagnosticIds.RemoveEmptyFinallyClause)); context.RegisterCodeFix(codeAction, context.Diagnostics[0]); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ForStatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ForStatementCodeFixProvider.cs index 702f05b0fc..355904c72e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ForStatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ForStatementCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class ForStatementCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AvoidUsageOfForStatementToCreateInfiniteLoop); } + get { return ImmutableArray.Create(DiagnosticIds.AvoidUsageOfForStatementToCreateInfiniteLoop); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.AvoidUsageOfForStatementToCreateInfiniteLoop: + case DiagnosticIds.AvoidUsageOfForStatementToCreateInfiniteLoop: { CodeAction codeAction = CodeAction.Create( "Use while to create an infinite loop", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/IfStatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/IfStatementCodeFixProvider.cs index 776a450e41..265d311d3a 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/IfStatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/IfStatementCodeFixProvider.cs @@ -31,13 +31,13 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.MergeIfWithNestedIf, - DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf, - DiagnosticIdentifiers.ConvertIfToReturnStatement, - DiagnosticIdentifiers.ConvertIfToAssignment, - DiagnosticIdentifiers.ReduceIfNesting, - DiagnosticIdentifiers.UseExceptionFilter, - DiagnosticIdentifiers.SimplifyArgumentNullCheck); + DiagnosticIds.MergeIfWithNestedIf, + DiagnosticIds.UseCoalesceExpressionInsteadOfIf, + DiagnosticIds.ConvertIfToReturnStatement, + DiagnosticIds.ConvertIfToAssignment, + DiagnosticIds.ReduceIfNesting, + DiagnosticIds.UseExceptionFilter, + DiagnosticIds.SimplifyArgumentNullCheck); } } @@ -52,7 +52,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.MergeIfWithNestedIf: + case DiagnosticIds.MergeIfWithNestedIf: { CodeAction codeAction = CodeAction.Create( "Merge 'if' with nested 'if'", @@ -62,9 +62,9 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf: - case DiagnosticIdentifiers.ConvertIfToReturnStatement: - case DiagnosticIdentifiers.ConvertIfToAssignment: + case DiagnosticIds.UseCoalesceExpressionInsteadOfIf: + case DiagnosticIds.ConvertIfToReturnStatement: + case DiagnosticIds.ConvertIfToAssignment: { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); @@ -83,7 +83,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.ReduceIfNesting: + case DiagnosticIds.ReduceIfNesting: { CodeAction codeAction = CodeAction.Create( "Invert if", @@ -101,7 +101,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseExceptionFilter: + case DiagnosticIds.UseExceptionFilter: { CodeAction codeAction = CodeAction.Create( "Use exception filter", @@ -117,7 +117,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.SimplifyArgumentNullCheck: + case DiagnosticIds.SimplifyArgumentNullCheck: { CodeAction codeAction = CodeAction.Create( "Call ArgumentNullException.ThrowIfNull", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ImplementNonGenericCounterpartCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ImplementNonGenericCounterpartCodeFixProvider.cs index 57310f56e9..e9227ea162 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ImplementNonGenericCounterpartCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ImplementNonGenericCounterpartCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class ImplementNonGenericCounterpartCodeFixProvider : BaseCodeFixP { public ImplementNonGenericCounterpartCodeFixProvider() { - ExplicitEquivalenceKey = GetEquivalenceKey(DiagnosticIdentifiers.ImplementNonGenericCounterpart, "Explicit"); + ExplicitEquivalenceKey = GetEquivalenceKey(DiagnosticIds.ImplementNonGenericCounterpart, "Explicit"); } internal readonly string ExplicitEquivalenceKey; @@ -123,7 +123,7 @@ public ImplementNonGenericCounterpartCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.ImplementNonGenericCounterpart); } + get { return ImmutableArray.Create(DiagnosticIds.ImplementNonGenericCounterpart); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InitializerCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InitializerCodeFixProvider.cs index c053a5e18c..b7217006dd 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InitializerCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InitializerCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class InitializerCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantCommaInInitializer); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantCommaInInitializer); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveRedundantCommaInInitializer: + case DiagnosticIds.RemoveRedundantCommaInInitializer: { CodeAction codeAction = CodeAction.Create( "Remove redundant comma", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InterpolatedStringCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InterpolatedStringCodeFixProvider.cs index 607cdc9095..5c3f023bea 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InterpolatedStringCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InterpolatedStringCodeFixProvider.cs @@ -22,8 +22,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UnnecessaryInterpolatedString, - DiagnosticIdentifiers.ConvertInterpolatedStringToConcatenation); + DiagnosticIds.UnnecessaryInterpolatedString, + DiagnosticIds.ConvertInterpolatedStringToConcatenation); } } @@ -40,7 +40,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.UnnecessaryInterpolatedString: + case DiagnosticIds.UnnecessaryInterpolatedString: { if (ConvertInterpolatedStringToStringLiteralAnalysis.IsFixable(interpolatedString)) { @@ -65,7 +65,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) break; } - case DiagnosticIdentifiers.ConvertInterpolatedStringToConcatenation: + case DiagnosticIds.ConvertInterpolatedStringToConcatenation: { CodeAction codeAction = CodeAction.Create( "Convert to concatenation", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InterpolationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InterpolationCodeFixProvider.cs index 427407627a..db2d91f5c5 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InterpolationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InterpolationCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class InterpolationCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnnecessaryInterpolation); } + get { return ImmutableArray.Create(DiagnosticIds.UnnecessaryInterpolation); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InvalidArgumentNullCheckCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InvalidArgumentNullCheckCodeFixProvider.cs index 1be463869a..7a1ac2043d 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InvalidArgumentNullCheckCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InvalidArgumentNullCheckCodeFixProvider.cs @@ -17,7 +17,7 @@ public sealed class InvalidArgumentNullCheckCodeFixProvider : BaseCodeFixProvide { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.InvalidArgumentNullCheck); } + get { return ImmutableArray.Create(DiagnosticIds.InvalidArgumentNullCheck); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InvocationExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InvocationExpressionCodeFixProvider.cs index cfa10faa53..31cb965b46 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/InvocationExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/InvocationExpressionCodeFixProvider.cs @@ -28,13 +28,13 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod, - DiagnosticIdentifiers.RemoveRedundantToStringCall, - DiagnosticIdentifiers.RemoveRedundantStringToCharArrayCall, - DiagnosticIdentifiers.CombineEnumerableWhereMethodChain, - DiagnosticIdentifiers.CallExtensionMethodAsInstanceMethod, - DiagnosticIdentifiers.CallThenByInsteadOfOrderBy, - DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat); + DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod, + DiagnosticIds.RemoveRedundantToStringCall, + DiagnosticIds.RemoveRedundantStringToCharArrayCall, + DiagnosticIds.CombineEnumerableWhereMethodChain, + DiagnosticIds.CallExtensionMethodAsInstanceMethod, + DiagnosticIds.CallThenByInsteadOfOrderBy, + DiagnosticIds.UseStringInterpolationInsteadOfStringConcat); } } @@ -49,7 +49,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.CombineEnumerableWhereMethodChain: + case DiagnosticIds.CombineEnumerableWhereMethodChain: { CodeAction codeAction = CodeAction.Create( "Combine 'Where' method chain", @@ -59,7 +59,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod: + case DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod: { string propertyName = diagnostic.Properties["PropertyName"]; @@ -71,7 +71,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveRedundantToStringCall: + case DiagnosticIds.RemoveRedundantToStringCall: { CodeAction codeAction = CodeAction.Create( "Remove redundant 'ToString' call", @@ -81,7 +81,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveRedundantStringToCharArrayCall: + case DiagnosticIds.RemoveRedundantStringToCharArrayCall: { CodeAction codeAction = CodeAction.Create( "Remove redundant 'ToCharArray' call", @@ -91,7 +91,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.CallExtensionMethodAsInstanceMethod: + case DiagnosticIds.CallExtensionMethodAsInstanceMethod: { CodeAction codeAction = CodeAction.Create( CallExtensionMethodAsInstanceMethodRefactoring.Title, @@ -101,7 +101,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.CallThenByInsteadOfOrderBy: + case DiagnosticIds.CallThenByInsteadOfOrderBy: { SimpleMemberInvocationExpressionInfo invocationInfo = SyntaxInfo.SimpleMemberInvocationExpressionInfo(invocation); @@ -119,7 +119,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat: + case DiagnosticIds.UseStringInterpolationInsteadOfStringConcat: { CodeAction codeAction = CodeAction.Create( "Use string interpolation", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/LocalDeclarationStatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/LocalDeclarationStatementCodeFixProvider.cs index 2c06bc1364..0a43e264e4 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/LocalDeclarationStatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/LocalDeclarationStatementCodeFixProvider.cs @@ -24,7 +24,7 @@ public sealed class LocalDeclarationStatementCodeFixProvider : BaseCodeFixProvid { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.InlineLocalVariable); } + get { return ImmutableArray.Create(DiagnosticIds.InlineLocalVariable); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.InlineLocalVariable: + case DiagnosticIds.InlineLocalVariable: { CodeAction codeAction = CodeAction.Create( "Inline local variable", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/LockStatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/LockStatementCodeFixProvider.cs index b11207d1e4..3b357586fc 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/LockStatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/LockStatementCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class LockStatementCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AvoidLockingOnPubliclyAccessibleInstance); } + get { return ImmutableArray.Create(DiagnosticIds.AvoidLockingOnPubliclyAccessibleInstance); } } public override FixAllProvider GetFixAllProvider() @@ -36,7 +36,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Introduce field to lock on", ct => AvoidLockingOnPubliclyAccessibleInstanceRefactoring.RefactorAsync(context.Document, lockStatement, ct), - GetEquivalenceKey(DiagnosticIdentifiers.AvoidLockingOnPubliclyAccessibleInstance)); + GetEquivalenceKey(DiagnosticIds.AvoidLockingOnPubliclyAccessibleInstance)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/MarkLocalVariableAsConstCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/MarkLocalVariableAsConstCodeFixProvider.cs index 0590556488..bf291ac26d 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/MarkLocalVariableAsConstCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/MarkLocalVariableAsConstCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class MarkLocalVariableAsConstCodeFixProvider : BaseCodeFixProvide { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.MarkLocalVariableAsConst); } + get { return ImmutableArray.Create(DiagnosticIds.MarkLocalVariableAsConst); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/MarkTypeWithDebuggerDisplayAttributeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/MarkTypeWithDebuggerDisplayAttributeCodeFixProvider.cs index 2284fe340a..cc4615c9c5 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/MarkTypeWithDebuggerDisplayAttributeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/MarkTypeWithDebuggerDisplayAttributeCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class MarkTypeWithDebuggerDisplayAttributeCodeFixProvider : BaseCo { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute); } + get { return ImmutableArray.Create(DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/MemberDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/MemberDeclarationCodeFixProvider.cs index 665a1b8b13..774aef82fa 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/MemberDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/MemberDeclarationCodeFixProvider.cs @@ -26,16 +26,16 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.RemoveRedundantOverridingMember, - DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers, - DiagnosticIdentifiers.RemoveRedundantSealedModifier, - DiagnosticIdentifiers.UnnecessarySemicolonAtEndOfDeclaration, - DiagnosticIdentifiers.OrderModifiers, - DiagnosticIdentifiers.MakeFieldReadOnly, - DiagnosticIdentifiers.UseConstantInsteadOfField, - DiagnosticIdentifiers.UseReadOnlyAutoProperty, - DiagnosticIdentifiers.ConvertCommentToDocumentationComment, - DiagnosticIdentifiers.MakeMethodExtensionMethod); + DiagnosticIds.RemoveRedundantOverridingMember, + DiagnosticIds.AddOrRemoveAccessibilityModifiers, + DiagnosticIds.RemoveRedundantSealedModifier, + DiagnosticIds.UnnecessarySemicolonAtEndOfDeclaration, + DiagnosticIds.OrderModifiers, + DiagnosticIds.MakeFieldReadOnly, + DiagnosticIds.UseConstantInsteadOfField, + DiagnosticIds.UseReadOnlyAutoProperty, + DiagnosticIds.ConvertCommentToDocumentationComment, + DiagnosticIds.MakeMethodExtensionMethod); } } @@ -50,14 +50,14 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveRedundantOverridingMember: + case DiagnosticIds.RemoveRedundantOverridingMember: { CodeAction codeAction = CodeActionFactory.RemoveMemberDeclaration(context.Document, memberDeclaration, equivalenceKey: GetEquivalenceKey(diagnostic)); context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers: + case DiagnosticIds.AddOrRemoveAccessibilityModifiers: { if (diagnostic.Properties.TryGetValue(nameof(Accessibility), out string accessibilityText)) { @@ -92,12 +92,12 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) break; } - case DiagnosticIdentifiers.RemoveRedundantSealedModifier: + case DiagnosticIds.RemoveRedundantSealedModifier: { ModifiersCodeFixRegistrator.RemoveModifier(context, diagnostic, memberDeclaration, SyntaxKind.SealedKeyword); break; } - case DiagnosticIdentifiers.UnnecessarySemicolonAtEndOfDeclaration: + case DiagnosticIds.UnnecessarySemicolonAtEndOfDeclaration: { CodeAction codeAction = CodeAction.Create( "Remove unnecessary semicolon", @@ -107,7 +107,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.OrderModifiers: + case DiagnosticIds.OrderModifiers: { CodeAction codeAction = CodeAction.Create( "Order modifiers", @@ -117,7 +117,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.MakeFieldReadOnly: + case DiagnosticIds.MakeFieldReadOnly: { var fieldDeclaration = (FieldDeclarationSyntax)memberDeclaration; @@ -130,7 +130,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) ModifiersCodeFixRegistrator.AddModifier(context, diagnostic, fieldDeclaration, SyntaxKind.ReadOnlyKeyword, title: title); break; } - case DiagnosticIdentifiers.UseConstantInsteadOfField: + case DiagnosticIds.UseConstantInsteadOfField: { CodeAction codeAction = CodeAction.Create( "Use constant instead of field", @@ -140,7 +140,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseReadOnlyAutoProperty: + case DiagnosticIds.UseReadOnlyAutoProperty: { CodeAction codeAction = CodeAction.Create( "Use read-only auto-property", @@ -150,7 +150,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.ConvertCommentToDocumentationComment: + case DiagnosticIds.ConvertCommentToDocumentationComment: { CodeAction codeAction = CodeAction.Create( ConvertCommentToDocumentationCommentRefactoring.Title, @@ -160,7 +160,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.MakeMethodExtensionMethod: + case DiagnosticIds.MakeMethodExtensionMethod: { var methodDeclaration = (MethodDeclarationSyntax)memberDeclaration; diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/NamespaceDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/NamespaceDeclarationCodeFixProvider.cs index de9393c474..3007958b46 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/NamespaceDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/NamespaceDeclarationCodeFixProvider.cs @@ -21,8 +21,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.RemoveEmptyNamespaceDeclaration, - DiagnosticIdentifiers.DeclareUsingDirectiveOnTopLevel); + DiagnosticIds.RemoveEmptyNamespaceDeclaration, + DiagnosticIds.DeclareUsingDirectiveOnTopLevel); } } @@ -37,7 +37,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveEmptyNamespaceDeclaration: + case DiagnosticIds.RemoveEmptyNamespaceDeclaration: { CodeAction codeAction = CodeAction.Create( "Remove empty namespace declaration", @@ -47,7 +47,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.DeclareUsingDirectiveOnTopLevel: + case DiagnosticIds.DeclareUsingDirectiveOnTopLevel: { string title = (namespaceDeclaration.Usings.Count == 1) ? "Move using to top level" diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/NormalizeNullCheckProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/NormalizeNullCheckProvider.cs index a2a1ecffac..f1032df497 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/NormalizeNullCheckProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/NormalizeNullCheckProvider.cs @@ -23,7 +23,7 @@ public sealed class NormalizeNullCheckProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.NormalizeNullCheck); } + get { return ImmutableArray.Create(DiagnosticIds.NormalizeNullCheck); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/NormalizeUsageOfInfiniteLoopCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/NormalizeUsageOfInfiniteLoopCodeFixProvider.cs index 27f92464e3..1351b5122b 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/NormalizeUsageOfInfiniteLoopCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/NormalizeUsageOfInfiniteLoopCodeFixProvider.cs @@ -26,7 +26,7 @@ public sealed class NormalizeUsageOfInfiniteLoopCodeFixProvider : BaseCodeFixPro { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop); } + get { return ImmutableArray.Create(DiagnosticIds.NormalizeUsageOfInfiniteLoop); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ObjectCreationExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ObjectCreationExpressionCodeFixProvider.cs index f3acce2f8c..6d37fb897e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ObjectCreationExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ObjectCreationExpressionCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class ObjectCreationExpressionCodeFixProvider : BaseCodeFixProvide { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseEventArgsEmpty); } + get { return ImmutableArray.Create(DiagnosticIds.UseEventArgsEmpty); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.UseEventArgsEmpty: + case DiagnosticIds.UseEventArgsEmpty: { CodeAction codeAction = CodeAction.Create( "Use EventArgs.Empty", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeLinqMethodCallCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeLinqMethodCallCodeFixProvider.cs index 42226365b3..f0f84e4d26 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeLinqMethodCallCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeLinqMethodCallCodeFixProvider.cs @@ -32,8 +32,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.OptimizeLinqMethodCall, - DiagnosticIdentifiers.UseElementAccess); + DiagnosticIds.OptimizeLinqMethodCall, + DiagnosticIds.UseElementAccess); } } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeMethodCallCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeMethodCallCodeFixProvider.cs index 4e8851a902..e477451124 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeMethodCallCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeMethodCallCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class OptimizeMethodCallCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.OptimizeMethodCall); } + get { return ImmutableArray.Create(DiagnosticIds.OptimizeMethodCall); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeStringBuilderAppendCallCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeStringBuilderAppendCallCodeFixProvider.cs index 5ab1c7dec6..fdbf7ec67e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeStringBuilderAppendCallCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeStringBuilderAppendCallCodeFixProvider.cs @@ -23,7 +23,7 @@ public sealed class OptimizeStringBuilderAppendCallCodeFixProvider : BaseCodeFix { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.OptimizeStringBuilderAppendCall); } + get { return ImmutableArray.Create(DiagnosticIds.OptimizeStringBuilderAppendCall); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OrderElementsInDocumentationCommentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OrderElementsInDocumentationCommentCodeFixProvider.cs index 9686fab0b3..9ba83f0e4b 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OrderElementsInDocumentationCommentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OrderElementsInDocumentationCommentCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class OrderElementsInDocumentationCommentCodeFixProvider : BaseCod { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.OrderElementsInDocumentationComment); } + get { return ImmutableArray.Create(DiagnosticIds.OrderElementsInDocumentationComment); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OrderTypeParameterConstraintsCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OrderTypeParameterConstraintsCodeFixProvider.cs index c80db7bace..b41ae7daa9 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OrderTypeParameterConstraintsCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OrderTypeParameterConstraintsCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class OrderTypeParameterConstraintsCodeFixProvider : BaseCodeFixPr { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.OrderTypeParameterConstraints); } + get { return ImmutableArray.Create(DiagnosticIds.OrderTypeParameterConstraints); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParameterCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParameterCodeFixProvider.cs index acad348cd9..da19c834bf 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParameterCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParameterCodeFixProvider.cs @@ -20,9 +20,9 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.OverridingMemberShouldNotChangeParamsModifier, - DiagnosticIdentifiers.MakeParameterRefReadOnly, - DiagnosticIdentifiers.DoNotPassNonReadOnlyStructByReadOnlyReference); + DiagnosticIds.OverridingMemberShouldNotChangeParamsModifier, + DiagnosticIds.MakeParameterRefReadOnly, + DiagnosticIds.DoNotPassNonReadOnlyStructByReadOnlyReference); } } @@ -37,7 +37,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.OverridingMemberShouldNotChangeParamsModifier: + case DiagnosticIds.OverridingMemberShouldNotChangeParamsModifier: { if (parameter.IsParams()) { @@ -50,8 +50,8 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) break; } - case DiagnosticIdentifiers.MakeParameterRefReadOnly: - case DiagnosticIdentifiers.DoNotPassNonReadOnlyStructByReadOnlyReference: + case DiagnosticIds.MakeParameterRefReadOnly: + case DiagnosticIds.DoNotPassNonReadOnlyStructByReadOnlyReference: { if (parameter.Modifiers.Contains(SyntaxKind.InKeyword)) { diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParameterNameDiffersFromBaseCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParameterNameDiffersFromBaseCodeFixProvider.cs index 1b872b3fa3..a6a513655f 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParameterNameDiffersFromBaseCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParameterNameDiffersFromBaseCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class ParameterNameDiffersFromBaseCodeFixProvider : BaseCodeFixPro { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.ParameterNameDiffersFromBase); } + get { return ImmutableArray.Create(DiagnosticIds.ParameterNameDiffersFromBase); } } public override FixAllProvider GetFixAllProvider() @@ -38,7 +38,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.ParameterNameDiffersFromBase: + case DiagnosticIds.ParameterNameDiffersFromBase: { SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false); diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParenthesizedExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParenthesizedExpressionCodeFixProvider.cs index 1d77e98802..ebebf280f0 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParenthesizedExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ParenthesizedExpressionCodeFixProvider.cs @@ -17,7 +17,7 @@ public sealed class ParenthesizedExpressionCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantParentheses); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantParentheses); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/PropertyDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/PropertyDeclarationCodeFixProvider.cs index f5189575fe..f259a83284 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/PropertyDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/PropertyDeclarationCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class PropertyDeclarationCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantAutoPropertyInitialization); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization: + case DiagnosticIds.RemoveRedundantAutoPropertyInitialization: { CodeAction codeAction = CodeAction.Create( "Remove redundant initialization", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RawStringLiteralCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RawStringLiteralCodeFixProvider.cs index 9f44fdbf24..ab5c484114 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RawStringLiteralCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RawStringLiteralCodeFixProvider.cs @@ -25,8 +25,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UnnecessaryRawStringLiteral, - DiagnosticIdentifiers.UseRawStringLiteral); + DiagnosticIds.UnnecessaryRawStringLiteral, + DiagnosticIds.UseRawStringLiteral); } } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RegionDirectiveTriviaCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RegionDirectiveTriviaCodeFixProvider.cs index a1dec29eb1..424e944ee7 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RegionDirectiveTriviaCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RegionDirectiveTriviaCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class RegionDirectiveTriviaCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveEmptyRegion); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveEmptyRegion); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove empty region", ct => RemoveEmptyRegionRefactoring.RefactorAsync(context.Document, SyntaxInfo.RegionInfo(regionDirective), ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveEmptyRegion)); + GetEquivalenceKey(DiagnosticIds.RemoveEmptyRegion)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveBracesCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveBracesCodeFixProvider.cs index 3eb5f3a1a7..660bedef37 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveBracesCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveBracesCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class RemoveBracesCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveBraces); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveBraces); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove braces", ct => RemoveBracesRefactoring.RefactorAsync(context.Document, block, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveBraces)); + GetEquivalenceKey(DiagnosticIds.RemoveBraces)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveBracesFromIfElseCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveBracesFromIfElseCodeFixProvider.cs index 303a10e1ef..4e66100d65 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveBracesFromIfElseCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveBracesFromIfElseCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class RemoveBracesFromIfElseCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveBracesFromIfElse); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveBracesFromIfElse); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -33,7 +33,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove braces from if-else", ct => RemoveBracesFromIfElseElseRefactoring.RefactorAsync(context.Document, ifStatement, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveBracesFromIfElse)); + GetEquivalenceKey(DiagnosticIds.RemoveBracesFromIfElse)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveElementInDocumentationCommentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveElementInDocumentationCommentCodeFixProvider.cs index 0ca275c2d1..04d050721c 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveElementInDocumentationCommentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveElementInDocumentationCommentCodeFixProvider.cs @@ -26,8 +26,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UnusedElementInDocumentationComment, - DiagnosticIdentifiers.InvalidReferenceInDocumentationComment); + DiagnosticIds.UnusedElementInDocumentationComment, + DiagnosticIds.InvalidReferenceInDocumentationComment); } } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEmptyInitializerCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEmptyInitializerCodeFixProvider.cs index 541bc825f4..8453db7bdc 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEmptyInitializerCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEmptyInitializerCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class RemoveEmptyInitializerCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveEmptyInitializer); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveEmptyInitializer); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove empty initializer", ct => RemoveEmptyInitializerRefactoring.RefactorAsync(context.Document, objectCreationExpression, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveEmptyInitializer)); + GetEquivalenceKey(DiagnosticIds.RemoveEmptyInitializer)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEmptySyntaxCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEmptySyntaxCodeFixProvider.cs index 3e387d474f..1a0f182227 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEmptySyntaxCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEmptySyntaxCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class RemoveEmptySyntaxCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveEmptySyntax); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveEmptySyntax); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEnumDefaultBaseTypeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEnumDefaultBaseTypeCodeFixProvider.cs index cd40d15cc7..517797b1da 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEnumDefaultBaseTypeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveEnumDefaultBaseTypeCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class RemoveEnumDefaultBaseTypeCodeFixProvider : BaseCodeFixProvid { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveEnumDefaultUnderlyingType); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveEnumDefaultUnderlyingType); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove default underlying type", ct => RemoveEnumDefaultUnderlyingTypeRefactoring.RefactorAsync(context.Document, baseType, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveEnumDefaultUnderlyingType)); + GetEquivalenceKey(DiagnosticIds.RemoveEnumDefaultUnderlyingType)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveOriginalExceptionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveOriginalExceptionCodeFixProvider.cs index 8b4aec6745..5cb9c5bdf1 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveOriginalExceptionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveOriginalExceptionCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class RemoveOriginalExceptionCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveOriginalExceptionFromThrowStatement); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveOriginalExceptionFromThrowStatement); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove original exception from throw statement", ct => RemoveOriginalExceptionFromThrowStatementRefactoring.RefactorAsync(context.Document, throwStatement, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveOriginalExceptionFromThrowStatement)); + GetEquivalenceKey(DiagnosticIds.RemoveOriginalExceptionFromThrowStatement)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemovePartialModifierFromTypeWithSinglePartCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemovePartialModifierFromTypeWithSinglePartCodeFixProvider.cs index 374785b177..b609e3c898 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemovePartialModifierFromTypeWithSinglePartCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemovePartialModifierFromTypeWithSinglePartCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class RemovePartialModifierFromTypeWithSinglePartCodeFixProvider : { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart); } + get { return ImmutableArray.Create(DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -55,7 +55,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) return document.ReplaceNodeAsync(typeDeclaration, newTypeDeclaration, ct); }, - GetEquivalenceKey(DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)); + GetEquivalenceKey(DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)); context.RegisterCodeFix(codeAction, diagnostic); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantAssignmentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantAssignmentCodeFixProvider.cs index 99d3b1836b..39efda8e7a 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantAssignmentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantAssignmentCodeFixProvider.cs @@ -23,7 +23,7 @@ public sealed class RemoveRedundantAssignmentCodeFixProvider : BaseCodeFixProvid { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantAssignment); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantAssignment); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveRedundantAssignment: + case DiagnosticIds.RemoveRedundantAssignment: { CodeAction codeAction = CodeAction.Create( "Remove redundant assignment", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantAsyncAwaitCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantAsyncAwaitCodeFixProvider.cs index 37cf841c08..6fc5b8e1ba 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantAsyncAwaitCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantAsyncAwaitCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class RemoveRedundantAsyncAwaitCodeFixProvider : BaseCodeFixProvid { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantAsyncAwait); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantAsyncAwait); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantBooleanLiteralCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantBooleanLiteralCodeFixProvider.cs index 2e01abf7e2..68cad9a886 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantBooleanLiteralCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantBooleanLiteralCodeFixProvider.cs @@ -23,7 +23,7 @@ public sealed class RemoveRedundantBooleanLiteralCodeFixProvider : BaseCodeFixPr { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantBooleanLiteral); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantBooleanLiteral); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -91,7 +91,7 @@ private static void RegisterCodeFix(CodeFixContext context, string textToRemove, CodeAction codeAction = CodeAction.Create( $"Remove redundant '{textToRemove}'", createChangedDocument, - GetEquivalenceKey(DiagnosticIdentifiers.RemoveRedundantBooleanLiteral)); + GetEquivalenceKey(DiagnosticIds.RemoveRedundantBooleanLiteral)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantCastCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantCastCodeFixProvider.cs index c9b9f9d6fd..10f981d2fb 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantCastCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantCastCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class RemoveRedundantCastCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantCast); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantCast); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -36,7 +36,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove redundant cast", ct => RemoveRedundantCastRefactoring.RefactorAsync(context.Document, (CastExpressionSyntax)node, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveRedundantCast)); + GetEquivalenceKey(DiagnosticIds.RemoveRedundantCast)); context.RegisterCodeFix(codeAction, context.Diagnostics); break; @@ -46,7 +46,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove redundant cast", ct => RemoveRedundantCastRefactoring.RefactorAsync(context.Document, (InvocationExpressionSyntax)node, ct), - GetEquivalenceKey(DiagnosticIdentifiers.RemoveRedundantCast)); + GetEquivalenceKey(DiagnosticIds.RemoveRedundantCast)); context.RegisterCodeFix(codeAction, context.Diagnostics); break; diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveUnnecessaryBracesCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveUnnecessaryBracesCodeFixProvider.cs index 2d971806a5..d03c4397f1 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveUnnecessaryBracesCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveUnnecessaryBracesCodeFixProvider.cs @@ -20,7 +20,7 @@ public class RemoveUnnecessaryBracesCodeFixProvider : BaseCodeFixProvider { public sealed override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveUnnecessaryBraces); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveUnnecessaryBraces); } } public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveUnnecessaryElseCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveUnnecessaryElseCodeFixProvider.cs index 94a54aec7e..0012202c4e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveUnnecessaryElseCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveUnnecessaryElseCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class RemoveUnnecessaryElseCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveUnnecessaryElse); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveUnnecessaryElse); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -36,7 +36,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveUnnecessaryElse: + case DiagnosticIds.RemoveUnnecessaryElse: { CodeAction codeAction = CodeAction.Create( "Remove 'else'", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider.cs index 041479ccfc..210471672a 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class ReturnCompletedTaskInsteadOfNullCodeFixProvider : BaseCodeFi { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.ReturnCompletedTaskInsteadOfNull); } + get { return ImmutableArray.Create(DiagnosticIds.ReturnCompletedTaskInsteadOfNull); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider2.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider2.cs index 067d9fa1a8..333a81da60 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider2.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider2.cs @@ -20,7 +20,7 @@ public class ReturnCompletedTaskInsteadOfNullCodeFixProvider2 : BaseCodeFixProvi { public sealed override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.ReturnCompletedTaskInsteadOfNull); } + get { return ImmutableArray.Create(DiagnosticIds.ReturnCompletedTaskInsteadOfNull); } } public override FixAllProvider GetFixAllProvider() => null; diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyBooleanComparisonCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyBooleanComparisonCodeFixProvider.cs index 418d6c7d89..bc805c0ca0 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyBooleanComparisonCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyBooleanComparisonCodeFixProvider.cs @@ -24,7 +24,7 @@ public sealed class SimplifyBooleanComparisonCodeFixProvider : BaseCodeFixProvid public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.SimplifyBooleanComparison); } + get { return ImmutableArray.Create(DiagnosticIds.SimplifyBooleanComparison); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyCodeBranchingCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyCodeBranchingCodeFixProvider.cs index 45c9bcc1ad..3a2223d24c 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyCodeBranchingCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyCodeBranchingCodeFixProvider.cs @@ -23,7 +23,7 @@ public sealed class SimplifyCodeBranchingCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.SimplifyCodeBranching); } + get { return ImmutableArray.Create(DiagnosticIds.SimplifyCodeBranching); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyLogicalNegationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyLogicalNegationCodeFixProvider.cs index 491496373b..9080d51d33 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyLogicalNegationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyLogicalNegationCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class SimplifyLogicalNegationCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.SimplifyLogicalNegation); } + get { return ImmutableArray.Create(DiagnosticIds.SimplifyLogicalNegation); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyNestedUsingStatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyNestedUsingStatementCodeFixProvider.cs index 7986a48fa9..48369bac84 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyNestedUsingStatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyNestedUsingStatementCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class SimplifyNestedUsingStatementCodeFixProvider : BaseCodeFixPro { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.SimplifyNestedUsingStatement); } + get { return ImmutableArray.Create(DiagnosticIds.SimplifyNestedUsingStatement); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Remove braces", ct => SimplifyNestedUsingStatementRefactoring.RefactorAsync(context.Document, usingStatement, ct), - GetEquivalenceKey(DiagnosticIdentifiers.SimplifyNestedUsingStatement)); + GetEquivalenceKey(DiagnosticIds.SimplifyNestedUsingStatement)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyNullableOfTCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyNullableOfTCodeFixProvider.cs index 8aba819fb3..b9f8bf5b38 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyNullableOfTCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SimplifyNullableOfTCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class SimplifyNullableOfTCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.SimplifyNullableOfT); } + get { return ImmutableArray.Create(DiagnosticIds.SimplifyNullableOfT); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -34,7 +34,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( $"Simplify name '{type}'", ct => SimplifyNullableOfTRefactoring.RefactorAsync(context.Document, type, nullableType, ct), - GetEquivalenceKey(DiagnosticIdentifiers.SimplifyNullableOfT)); + GetEquivalenceKey(DiagnosticIds.SimplifyNullableOfT)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SingleLineDocumentationCommentTriviaCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SingleLineDocumentationCommentTriviaCodeFixProvider.cs index 280ec56c7d..b19aa4aa57 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SingleLineDocumentationCommentTriviaCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SingleLineDocumentationCommentTriviaCodeFixProvider.cs @@ -49,11 +49,11 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.FormatDocumentationSummaryOnSingleLine, - DiagnosticIdentifiers.FormatDocumentationSummaryOnMultipleLines, - DiagnosticIdentifiers.FormatDocumentationCommentSummary, - DiagnosticIdentifiers.AddParamElementToDocumentationComment, - DiagnosticIdentifiers.AddTypeParamElementToDocumentationComment); + DiagnosticIds.FormatDocumentationSummaryOnSingleLine, + DiagnosticIds.FormatDocumentationSummaryOnMultipleLines, + DiagnosticIds.FormatDocumentationCommentSummary, + DiagnosticIds.AddParamElementToDocumentationComment, + DiagnosticIds.AddTypeParamElementToDocumentationComment); } } @@ -68,7 +68,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.FormatDocumentationCommentSummary: + case DiagnosticIds.FormatDocumentationCommentSummary: { XmlElementSyntax summaryElement = documentationComment.SummaryElement(); @@ -95,7 +95,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) break; } - case DiagnosticIdentifiers.FormatDocumentationSummaryOnSingleLine: + case DiagnosticIds.FormatDocumentationSummaryOnSingleLine: { CodeAction codeAction = CodeAction.Create( "Format summary on a single line", @@ -105,7 +105,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.FormatDocumentationSummaryOnMultipleLines: + case DiagnosticIds.FormatDocumentationSummaryOnMultipleLines: { CodeAction codeAction = CodeAction.Create( "Format summary on multiple lines", @@ -115,7 +115,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.AddParamElementToDocumentationComment: + case DiagnosticIds.AddParamElementToDocumentationComment: { var refactoring = new AddParamElementToDocumentationCommentRefactoring(); @@ -127,7 +127,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.AddTypeParamElementToDocumentationComment: + case DiagnosticIds.AddTypeParamElementToDocumentationComment: { var refactoring = new AddTypeParamElementToDocumentationCommentRefactoring(); diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/StatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/StatementCodeFixProvider.cs index e8beaa61fa..78f0dbcd43 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/StatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/StatementCodeFixProvider.cs @@ -29,10 +29,10 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.InlineLazyInitialization, - DiagnosticIdentifiers.RemoveRedundantDisposeOrCloseCall, - DiagnosticIdentifiers.RemoveRedundantStatement, - DiagnosticIdentifiers.UseMethodChaining); + DiagnosticIds.InlineLazyInitialization, + DiagnosticIds.RemoveRedundantDisposeOrCloseCall, + DiagnosticIds.RemoveRedundantStatement, + DiagnosticIds.UseMethodChaining); } } @@ -47,7 +47,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.InlineLazyInitialization: + case DiagnosticIds.InlineLazyInitialization: { CodeAction codeAction = CodeAction.Create( "Inline lazy initialization", @@ -63,7 +63,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveRedundantDisposeOrCloseCall: + case DiagnosticIds.RemoveRedundantDisposeOrCloseCall: { var expressionStatement = (ExpressionStatementSyntax)statement; var invocation = (InvocationExpressionSyntax)expressionStatement.Expression; @@ -77,7 +77,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveRedundantStatement: + case DiagnosticIds.RemoveRedundantStatement: { CodeAction codeAction = CodeActionFactory.RemoveStatement( context.Document, @@ -88,7 +88,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseMethodChaining: + case DiagnosticIds.UseMethodChaining: { var expressionStatement = (ExpressionStatementSyntax)statement; diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SwitchSectionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SwitchSectionCodeFixProvider.cs index d5709992f6..b61ff1a51d 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/SwitchSectionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/SwitchSectionCodeFixProvider.cs @@ -21,10 +21,10 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.RemoveRedundantDefaultSwitchSection, - DiagnosticIdentifiers.DefaultLabelShouldBeLastLabelInSwitchSection, - DiagnosticIdentifiers.AddBracesToSwitchSectionWithMultipleStatements, - DiagnosticIdentifiers.MergeSwitchSectionsWithEquivalentContent); + DiagnosticIds.RemoveRedundantDefaultSwitchSection, + DiagnosticIds.DefaultLabelShouldBeLastLabelInSwitchSection, + DiagnosticIds.AddBracesToSwitchSectionWithMultipleStatements, + DiagnosticIds.MergeSwitchSectionsWithEquivalentContent); } } @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveRedundantDefaultSwitchSection: + case DiagnosticIds.RemoveRedundantDefaultSwitchSection: { CodeAction codeAction = CodeAction.Create( "Remove redundant switch section", @@ -49,7 +49,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.DefaultLabelShouldBeLastLabelInSwitchSection: + case DiagnosticIds.DefaultLabelShouldBeLastLabelInSwitchSection: { CodeAction codeAction = CodeAction.Create( "Move default label to the last position", @@ -59,7 +59,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.AddBracesToSwitchSectionWithMultipleStatements: + case DiagnosticIds.AddBracesToSwitchSectionWithMultipleStatements: { CodeAction codeAction = CodeAction.Create( AddBracesToSwitchSectionRefactoring.Title, @@ -69,7 +69,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.MergeSwitchSectionsWithEquivalentContent: + case DiagnosticIds.MergeSwitchSectionsWithEquivalentContent: { CodeAction codeAction = CodeAction.Create( "Merge sections", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/TokenCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/TokenCodeFixProvider.cs index bcd4f67279..29eed65893 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/TokenCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/TokenCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class TokenCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnnecessaryNullForgivingOperator); } + get { return ImmutableArray.Create(DiagnosticIds.UnnecessaryNullForgivingOperator); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.UnnecessaryNullForgivingOperator: + case DiagnosticIds.UnnecessaryNullForgivingOperator: { CodeAction codeAction = CodeAction.Create( "Remove null-forgiving operator", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/TypeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/TypeCodeFixProvider.cs index 30a54a83b0..9256692f7b 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/TypeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/TypeCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class TypeCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseGenericEventHandler); } + get { return ImmutableArray.Create(DiagnosticIds.UseGenericEventHandler); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/TypeParameterCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/TypeParameterCodeFixProvider.cs index 91744bdc57..f45526d197 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/TypeParameterCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/TypeParameterCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class TypeParameterCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnusedTypeParameter); } + get { return ImmutableArray.Create(DiagnosticIds.UnusedTypeParameter); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.UnusedTypeParameter: + case DiagnosticIds.UnusedTypeParameter: { CodeAction codeAction = CodeAction.Create( $"Remove unused type parameter '{typeParameter.Identifier}'", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryAssignmentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryAssignmentCodeFixProvider.cs index 4f8fdef206..947b08dd2e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryAssignmentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryAssignmentCodeFixProvider.cs @@ -27,7 +27,7 @@ public sealed class UnnecessaryAssignmentCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnnecessaryAssignment); } + get { return ImmutableArray.Create(DiagnosticIds.UnnecessaryAssignment); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryEnumFlagCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryEnumFlagCodeFixProvider.cs index 518a538f91..462631cff4 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryEnumFlagCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryEnumFlagCodeFixProvider.cs @@ -17,7 +17,7 @@ public sealed class UnnecessaryEnumFlagCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnnecessaryEnumFlag); } + get { return ImmutableArray.Create(DiagnosticIds.UnnecessaryEnumFlag); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.UnnecessaryEnumFlag: + case DiagnosticIds.UnnecessaryEnumFlag: { CodeAction codeAction = CodeAction.Create( "Remove unnecessary flag", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryExplicitUseOfEnumeratorCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryExplicitUseOfEnumeratorCodeFixProvider.cs index 19ad5e8444..0a1cd43f3d 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryExplicitUseOfEnumeratorCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryExplicitUseOfEnumeratorCodeFixProvider.cs @@ -24,7 +24,7 @@ public sealed class UnnecessaryExplicitUseOfEnumeratorCodeFixProvider : BaseCode { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator); } + get { return ImmutableArray.Create(DiagnosticIds.UnnecessaryExplicitUseOfEnumerator); } } public override FixAllProvider GetFixAllProvider() => null; diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryUnsafeContextCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryUnsafeContextCodeFixProvider.cs index 9d2b0c5800..a60b748492 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryUnsafeContextCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryUnsafeContextCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class UnnecessaryUnsafeContextCodeFixProvider : BaseCodeFixProvide { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnnecessaryUnsafeContext); } + get { return ImmutableArray.Create(DiagnosticIds.UnnecessaryUnsafeContext); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryUsageOfVerbatimStringLiteralCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryUsageOfVerbatimStringLiteralCodeFixProvider.cs index bf3fbe5e8e..b244b4dee1 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryUsageOfVerbatimStringLiteralCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnnecessaryUsageOfVerbatimStringLiteralCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class UnnecessaryUsageOfVerbatimStringLiteralCodeFixProvider : Bas public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral); } + get { return ImmutableArray.Create(DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -34,7 +34,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( Title, ct => RefactorAsync(context.Document, node, ct), - GetEquivalenceKey(DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)); + GetEquivalenceKey(DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)); context.RegisterCodeFix(codeAction, context.Diagnostics[0]); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnusedMemberCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnusedMemberCodeFixProvider.cs index 6db4f8bd9b..b181f2e51b 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnusedMemberCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnusedMemberCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class UnusedMemberCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveUnusedMemberDeclaration); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveUnusedMemberDeclaration); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnusedParameterCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnusedParameterCodeFixProvider.cs index df1c2ebb96..d052f3ce1e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnusedParameterCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UnusedParameterCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class UnusedParameterCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnusedParameter); } + get { return ImmutableArray.Create(DiagnosticIds.UnusedParameter); } } public override FixAllProvider GetFixAllProvider() diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAnonymousFunctionOrMethodGroupCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAnonymousFunctionOrMethodGroupCodeFixProvider.cs index d84219c2c8..677dc819d4 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAnonymousFunctionOrMethodGroupCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAnonymousFunctionOrMethodGroupCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class UseAnonymousFunctionOrMethodGroupCodeFixProvider : BaseCodeF { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup); } + get { return ImmutableArray.Create(DiagnosticIds.UseAnonymousFunctionOrMethodGroup); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAsyncAwaitCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAsyncAwaitCodeFixProvider.cs index b36dee155f..0cbe10f7fd 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAsyncAwaitCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAsyncAwaitCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class UseAsyncAwaitCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseAsyncAwait); } + get { return ImmutableArray.Create(DiagnosticIds.UseAsyncAwait); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAutoPropertyCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAutoPropertyCodeFixProvider.cs index cb1e2ae9a4..d581c190b5 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAutoPropertyCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseAutoPropertyCodeFixProvider.cs @@ -25,7 +25,7 @@ public sealed class UseAutoPropertyCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseAutoProperty); } + get { return ImmutableArray.Create(DiagnosticIds.UseAutoProperty); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseBlockBodyOrExpressionBodyCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseBlockBodyOrExpressionBodyCodeFixProvider.cs index d581a1df22..e6d1d9be58 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseBlockBodyOrExpressionBodyCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseBlockBodyOrExpressionBodyCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class UseBlockBodyOrExpressionBodyCodeFixProvider : BaseCodeFixPro { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseBlockBodyOrExpressionBody); } + get { return ImmutableArray.Create(DiagnosticIds.UseBlockBodyOrExpressionBody); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseCoalesceExpressionCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseCoalesceExpressionCodeFixProvider.cs index 015e26c723..ccfb991977 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseCoalesceExpressionCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseCoalesceExpressionCodeFixProvider.cs @@ -27,7 +27,7 @@ public sealed class UseCoalesceExpressionCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseCoalesceExpression); } + get { return ImmutableArray.Create(DiagnosticIds.UseCoalesceExpression); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseCompoundAssignmentCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseCompoundAssignmentCodeFixProvider.cs index 242db07bc7..5b4924c0d8 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseCompoundAssignmentCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseCompoundAssignmentCodeFixProvider.cs @@ -25,7 +25,7 @@ public sealed class UseCompoundAssignmentCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseCompoundAssignment); } + get { return ImmutableArray.Create(DiagnosticIds.UseCompoundAssignment); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseConditionalAccessCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseConditionalAccessCodeFixProvider.cs index d43e2a8765..2c38afc16b 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseConditionalAccessCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseConditionalAccessCodeFixProvider.cs @@ -27,7 +27,7 @@ public sealed class UseConditionalAccessCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseConditionalAccess); } + get { return ImmutableArray.Create(DiagnosticIds.UseConditionalAccess); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -54,7 +54,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( Title, ct => UseConditionalAccessAsync(context.Document, (BinaryExpressionSyntax)node, ct), - GetEquivalenceKey(DiagnosticIdentifiers.UseConditionalAccess)); + GetEquivalenceKey(DiagnosticIds.UseConditionalAccess)); context.RegisterCodeFix(codeAction, context.Diagnostics); break; @@ -64,7 +64,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( Title, ct => UseConditionalAccessAsync(context.Document, (IfStatementSyntax)node, ct), - GetEquivalenceKey(DiagnosticIdentifiers.UseConditionalAccess)); + GetEquivalenceKey(DiagnosticIds.UseConditionalAccess)); context.RegisterCodeFix(codeAction, context.Diagnostics); break; diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseEmptyStringLiteralOrStringEmptyCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseEmptyStringLiteralOrStringEmptyCodeFixProvider.cs index a2c49a1eec..702150f4ec 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseEmptyStringLiteralOrStringEmptyCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseEmptyStringLiteralOrStringEmptyCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class UseEmptyStringLiteralOrStringEmptyCodeFixProvider : BaseCode { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseEmptyStringLiteralOrStringEmpty); } + get { return ImmutableArray.Create(DiagnosticIds.UseEmptyStringLiteralOrStringEmpty); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitTypeInsteadOfVarCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitTypeInsteadOfVarCodeFixProvider.cs index b0442f12f6..3efb378ef1 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitTypeInsteadOfVarCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitTypeInsteadOfVarCodeFixProvider.cs @@ -25,8 +25,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarWhenTypeIsNotObvious, - DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarWhenTypeIsObvious); + DiagnosticIds.UseExplicitTypeInsteadOfVarWhenTypeIsNotObvious, + DiagnosticIds.UseExplicitTypeInsteadOfVarWhenTypeIsObvious); } } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitTypeInsteadOfVarInForEachCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitTypeInsteadOfVarInForEachCodeFixProvider.cs index 94ecd0c49f..88abd30014 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitTypeInsteadOfVarInForEachCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitTypeInsteadOfVarInForEachCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class UseExplicitTypeInsteadOfVarInForEachCodeFixProvider : BaseCo { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarInForEach); } + get { return ImmutableArray.Create(DiagnosticIds.UseExplicitTypeInsteadOfVarInForEach); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitlyOrImplicitlyTypedArrayCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitlyOrImplicitlyTypedArrayCodeFixProvider.cs index d6e01e0ded..3db2a8c88b 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitlyOrImplicitlyTypedArrayCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseExplicitlyOrImplicitlyTypedArrayCodeFixProvider.cs @@ -28,7 +28,7 @@ public sealed class UseExplicitlyOrImplicitlyTypedArrayCodeFixProvider : BaseCod public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray); } + get { return ImmutableArray.Create(DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray); } } #if ROSLYN_4_0 diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseHasFlagMethodOrBitwiseOperatorCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseHasFlagMethodOrBitwiseOperatorCodeFixProvider.cs index 158cb51a66..795633744e 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseHasFlagMethodOrBitwiseOperatorCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseHasFlagMethodOrBitwiseOperatorCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class UseHasFlagMethodOrBitwiseOperatorCodeFixProvider : BaseCodeF { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseHasFlagMethodOrBitwiseOperator); } + get { return ImmutableArray.Create(DiagnosticIds.UseHasFlagMethodOrBitwiseOperator); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseImplicitOrExplicitObjectCreationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseImplicitOrExplicitObjectCreationCodeFixProvider.cs index e43a8e0200..ce5af8e2b3 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseImplicitOrExplicitObjectCreationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseImplicitOrExplicitObjectCreationCodeFixProvider.cs @@ -28,7 +28,7 @@ public class UseImplicitOrExplicitObjectCreationCodeFixProvider : BaseCodeFixPro public sealed override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation); } + get { return ImmutableArray.Create(DiagnosticIds.UseImplicitOrExplicitObjectCreation); } } public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseIsOperatorInsteadOfAsOperatorCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseIsOperatorInsteadOfAsOperatorCodeFixProvider.cs index f28d2be289..c301187bff 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseIsOperatorInsteadOfAsOperatorCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseIsOperatorInsteadOfAsOperatorCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class UseIsOperatorInsteadOfAsOperatorCodeFixProvider : BaseCodeFi { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseIsOperatorInsteadOfAsOperator); } + get { return ImmutableArray.Create(DiagnosticIds.UseIsOperatorInsteadOfAsOperator); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseNameOfOperatorCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseNameOfOperatorCodeFixProvider.cs index 62e02c9a72..ff0f1654a1 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseNameOfOperatorCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseNameOfOperatorCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class UseNameOfOperatorCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseNameOfOperator); } + get { return ImmutableArray.Create(DiagnosticIds.UseNameOfOperator); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePatternMatchingInsteadOfAsAndNullCheckCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePatternMatchingInsteadOfAsAndNullCheckCodeFixProvider.cs index b127978906..207435cc60 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePatternMatchingInsteadOfAsAndNullCheckCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePatternMatchingInsteadOfAsAndNullCheckCodeFixProvider.cs @@ -24,7 +24,7 @@ public sealed class UsePatternMatchingInsteadOfAsAndNullCheckCodeFixProvider : B { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck); } + get { return ImmutableArray.Create(DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePatternMatchingInsteadOfIsAndCastCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePatternMatchingInsteadOfIsAndCastCodeFixProvider.cs index 2df0b4135e..7c95e8fe61 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePatternMatchingInsteadOfIsAndCastCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePatternMatchingInsteadOfIsAndCastCodeFixProvider.cs @@ -25,7 +25,7 @@ public sealed class UsePatternMatchingInsteadOfIsAndCastCodeFixProvider : BaseCo public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast); } + get { return ImmutableArray.Create(DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast); } } public override FixAllProvider GetFixAllProvider() diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePredefinedTypeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePredefinedTypeCodeFixProvider.cs index e3a0893cca..129fb7261f 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePredefinedTypeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsePredefinedTypeCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class UsePredefinedTypeCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UsePredefinedType); } + get { return ImmutableArray.Create(DiagnosticIds.UsePredefinedType); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -48,7 +48,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( $"Use predefined type '{SymbolDisplay.ToDisplayString(typeSymbol, SymbolDisplayFormats.DisplayName_WithoutNullableReferenceTypeModifier)}'", ct => UsePredefinedTypeAsync(context.Document, node, typeSymbol, ct), - GetEquivalenceKey(DiagnosticIdentifiers.UsePredefinedType)); + GetEquivalenceKey(DiagnosticIds.UsePredefinedType)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseRegexInstanceInsteadOfStaticMethodCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseRegexInstanceInsteadOfStaticMethodCodeFixProvider.cs index 338bc03c67..17a96cd7ce 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseRegexInstanceInsteadOfStaticMethodCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseRegexInstanceInsteadOfStaticMethodCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class UseRegexInstanceInsteadOfStaticMethodCodeFixProvider : BaseC { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod); } + get { return ImmutableArray.Create(DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod); } } public override FixAllProvider GetFixAllProvider() @@ -40,7 +40,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Use Regex instance", ct => UseRegexInstanceInsteadOfStaticMethodRefactoring.RefactorAsync(context.Document, invocation, ct), - GetEquivalenceKey(DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)); + GetEquivalenceKey(DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseStringComparisonCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseStringComparisonCodeFixProvider.cs index 31541b4103..e0eb71f72a 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseStringComparisonCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseStringComparisonCodeFixProvider.cs @@ -25,7 +25,7 @@ public sealed class UseStringComparisonCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseStringComparison); } + get { return ImmutableArray.Create(DiagnosticIds.UseStringComparison); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseVarInsteadOfExplicitTypeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseVarInsteadOfExplicitTypeCodeFixProvider.cs index 8d0c40a20e..ef0436cc68 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseVarInsteadOfExplicitTypeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseVarInsteadOfExplicitTypeCodeFixProvider.cs @@ -23,9 +23,9 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeWhenTypeIsObvious, - DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeWhenTypeIsNotObvious, - DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeInForEach); + DiagnosticIds.UseVarInsteadOfExplicitTypeWhenTypeIsObvious, + DiagnosticIds.UseVarInsteadOfExplicitTypeWhenTypeIsNotObvious, + DiagnosticIds.UseVarInsteadOfExplicitTypeInForEach); } } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseVarOrExplicitTypeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseVarOrExplicitTypeCodeFixProvider.cs index 3a480cb4fc..e0fb8e5576 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseVarOrExplicitTypeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UseVarOrExplicitTypeCodeFixProvider.cs @@ -21,7 +21,7 @@ public sealed class UseVarOrExplicitTypeCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseVarOrExplicitType); } + get { return ImmutableArray.Create(DiagnosticIds.UseVarOrExplicitType); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsingDirectiveCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsingDirectiveCodeFixProvider.cs index 80342dc43c..563a6783ca 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsingDirectiveCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/UsingDirectiveCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class UsingDirectiveCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective); } + get { return ImmutableArray.Create(DiagnosticIds.AvoidUsageOfUsingAliasDirective); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( "Inline alias expression", ct => AvoidUsageOfUsingAliasDirectiveRefactoring.RefactorAsync(context.Document, usingDirective, ct), - GetEquivalenceKey(DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective)); + GetEquivalenceKey(DiagnosticIds.AvoidUsageOfUsingAliasDirective)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ValidateArgumentsCorrectlyCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ValidateArgumentsCorrectlyCodeFixProvider.cs index be8f394817..031e66bad0 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/ValidateArgumentsCorrectlyCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/ValidateArgumentsCorrectlyCodeFixProvider.cs @@ -24,7 +24,7 @@ public sealed class ValidateArgumentsCorrectlyCodeFixProvider : BaseCodeFixProvi { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.ValidateArgumentsCorrectly); } + get { return ImmutableArray.Create(DiagnosticIds.ValidateArgumentsCorrectly); } } public override FixAllProvider GetFixAllProvider() diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/VariableDeclarationCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/VariableDeclarationCodeFixProvider.cs index 016a97d0d8..58f592c2be 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/VariableDeclarationCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/VariableDeclarationCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class VariableDeclarationCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.SplitVariableDeclaration); } + get { return ImmutableArray.Create(DiagnosticIds.SplitVariableDeclaration); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) CodeAction codeAction = CodeAction.Create( SplitVariableDeclarationRefactoring.GetTitle(variableDeclaration), ct => SplitVariableDeclarationRefactoring.RefactorAsync(context.Document, variableDeclaration, ct), - GetEquivalenceKey(DiagnosticIdentifiers.SplitVariableDeclaration)); + GetEquivalenceKey(DiagnosticIds.SplitVariableDeclaration)); context.RegisterCodeFix(codeAction, context.Diagnostics); } diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/VariableDeclaratorCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/VariableDeclaratorCodeFixProvider.cs index d61f1775f2..a9d5377207 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/VariableDeclaratorCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/VariableDeclaratorCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class VariableDeclaratorCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantFieldInitialization); } + get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantFieldInitialization); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveRedundantFieldInitialization: + case DiagnosticIds.RemoveRedundantFieldInitialization: { CodeAction codeAction = CodeAction.Create( "Remove redundant initialization", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/WhileStatementCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/WhileStatementCodeFixProvider.cs index b72225f3a6..96a185204f 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/WhileStatementCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/WhileStatementCodeFixProvider.cs @@ -22,8 +22,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.AvoidUsageOfWhileStatementToCreateInfiniteLoop, - DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement); + DiagnosticIds.AvoidUsageOfWhileStatementToCreateInfiniteLoop, + DiagnosticIds.UseForStatementInsteadOfWhileStatement); } } @@ -40,7 +40,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.AvoidUsageOfWhileStatementToCreateInfiniteLoop: + case DiagnosticIds.AvoidUsageOfWhileStatementToCreateInfiniteLoop: { CodeAction codeAction = CodeAction.Create( "Convert to 'for'", @@ -56,7 +56,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement: + case DiagnosticIds.UseForStatementInsteadOfWhileStatement: { CodeAction codeAction = CodeAction.Create( "Convert to 'for'", diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/XmlNodeCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/XmlNodeCodeFixProvider.cs index 5be0d7009c..991e7a6d26 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/XmlNodeCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/XmlNodeCodeFixProvider.cs @@ -18,7 +18,7 @@ namespace Roslynator.CSharp.CodeFixes; [Shared] public sealed class XmlNodeCodeFixProvider : BaseCodeFixProvider { - public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(DiagnosticIdentifiers.FixDocumentationCommentTag); + public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(DiagnosticIds.FixDocumentationCommentTag); public override async Task RegisterCodeFixesAsync(CodeFixContext context) { diff --git a/src/Analyzers.CodeFixes/CodeFixes/WhitespaceTriviaCodeFixProvider.cs b/src/Analyzers.CodeFixes/CodeFixes/WhitespaceTriviaCodeFixProvider.cs index b5f8c0fc9d..e38586f89e 100644 --- a/src/Analyzers.CodeFixes/CodeFixes/WhitespaceTriviaCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CodeFixes/WhitespaceTriviaCodeFixProvider.cs @@ -22,8 +22,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.RemoveTrailingWhitespace, - DiagnosticIdentifiers.RemoveUnnecessaryBlankLine); + DiagnosticIds.RemoveTrailingWhitespace, + DiagnosticIds.RemoveUnnecessaryBlankLine); } } @@ -44,7 +44,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { switch (diagnostic.Id) { - case DiagnosticIdentifiers.RemoveTrailingWhitespace: + case DiagnosticIds.RemoveTrailingWhitespace: { CodeAction codeAction = CodeAction.Create( "Remove trailing white-space", @@ -54,7 +54,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.RemoveUnnecessaryBlankLine: + case DiagnosticIds.RemoveUnnecessaryBlankLine: { CodeAction codeAction = CodeAction.Create( "Remove blank line", diff --git a/src/Analyzers.xml b/src/Analyzers.xml index 3668c8bb60..4e010d95f7 100644 --- a/src/Analyzers.xml +++ b/src/Analyzers.xml @@ -7973,4 +7973,4 @@ class FooCodeFixProvider : CodeFixProvider - + \ No newline at end of file diff --git a/src/Analyzers/CSharp/Analysis/MergePreprocessorDirectivesAnalyzer.cs b/src/Analyzers/CSharp/Analysis/MergePreprocessorDirectivesAnalyzer.cs index 7e62f1991f..06ff601cf6 100644 --- a/src/Analyzers/CSharp/Analysis/MergePreprocessorDirectivesAnalyzer.cs +++ b/src/Analyzers/CSharp/Analysis/MergePreprocessorDirectivesAnalyzer.cs @@ -128,6 +128,6 @@ private static void AnalyzePragmaWarningDirectiveTrivia(SyntaxNodeAnalysisContex private static bool IsSuppressingThisAnalyzer(SeparatedSyntaxList errorCodes) { return errorCodes.SingleOrDefault(shouldThrow: false) is IdentifierNameSyntax identifierName - && string.Equals(identifierName.Identifier.ValueText, DiagnosticIdentifiers.MergePreprocessorDirectives, StringComparison.Ordinal); + && string.Equals(identifierName.Identifier.ValueText, DiagnosticIds.MergePreprocessorDirectives, StringComparison.Ordinal); } } diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/AttributeArgumentCodeFixProvider.cs b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/AttributeArgumentCodeFixProvider.cs index fbbdf989ce..4df10507cd 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/AttributeArgumentCodeFixProvider.cs +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/AttributeArgumentCodeFixProvider.cs @@ -24,7 +24,7 @@ public sealed class AttributeArgumentCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnknownLanguageName); } + get { return ImmutableArray.Create(CodeAnalysisDiagnosticIds.UnknownLanguageName); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.UnknownLanguageName: + case CodeAnalysisDiagnosticIds.UnknownLanguageName: { foreach (string languageName in RoslynUtility.WellKnownLanguageNames) { diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/AttributeCodeFixProvider.cs b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/AttributeCodeFixProvider.cs index 6e0309d7b4..0acd9ee2ad 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/AttributeCodeFixProvider.cs +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/AttributeCodeFixProvider.cs @@ -23,8 +23,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.SpecifyExportCodeFixProviderAttributeName, - DiagnosticIdentifiers.SpecifyExportCodeRefactoringProviderAttributeName); + CodeAnalysisDiagnosticIds.SpecifyExportCodeFixProviderAttributeName, + CodeAnalysisDiagnosticIds.SpecifyExportCodeRefactoringProviderAttributeName); } } @@ -40,8 +40,8 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.SpecifyExportCodeFixProviderAttributeName: - case DiagnosticIdentifiers.SpecifyExportCodeRefactoringProviderAttributeName: + case CodeAnalysisDiagnosticIds.SpecifyExportCodeFixProviderAttributeName: + case CodeAnalysisDiagnosticIds.SpecifyExportCodeRefactoringProviderAttributeName: { CodeAction codeAction = CodeAction.Create( "Specify name", diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/BinaryExpressionCodeFixProvider.cs b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/BinaryExpressionCodeFixProvider.cs index 40db5a9ac9..d685a935aa 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/BinaryExpressionCodeFixProvider.cs +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/BinaryExpressionCodeFixProvider.cs @@ -25,8 +25,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount, - DiagnosticIdentifiers.UnnecessaryNullCheck); + CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount, + CodeAnalysisDiagnosticIds.UnnecessaryNullCheck); } } @@ -42,7 +42,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount: + case CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount: { CodeAction codeAction = CodeAction.Create( "Call 'Any' instead of accessing 'Count'", @@ -52,7 +52,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UnnecessaryNullCheck: + case CodeAnalysisDiagnosticIds.UnnecessaryNullCheck: { CodeAction codeAction = CodeAction.Create( "Remove unnecessary null check", diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/ConditionalAccessExpressionCodeFixProvider.cs b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/ConditionalAccessExpressionCodeFixProvider.cs index 4fb5e616ad..8bea1746f1 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/ConditionalAccessExpressionCodeFixProvider.cs +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/ConditionalAccessExpressionCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class ConditionalAccessExpressionCodeFixProvider : BaseCodeFixProv { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UnnecessaryConditionalAccess); } + get { return ImmutableArray.Create(CodeAnalysisDiagnosticIds.UnnecessaryConditionalAccess); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/ElementAccessExpressionCodeFixProvider.cs b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/ElementAccessExpressionCodeFixProvider.cs index db593f588d..015c04deed 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/ElementAccessExpressionCodeFixProvider.cs +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/ElementAccessExpressionCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class ElementAccessExpressionCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess); } + get { return ImmutableArray.Create(CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/InvocationExpressionCodeFixProvider.cs b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/InvocationExpressionCodeFixProvider.cs index 01cdc60adf..a25f1eacc3 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/InvocationExpressionCodeFixProvider.cs +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/InvocationExpressionCodeFixProvider.cs @@ -25,8 +25,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UseElementAccess, - DiagnosticIdentifiers.UseReturnValue); + CodeAnalysisDiagnosticIds.UseElementAccess, + CodeAnalysisDiagnosticIds.UseReturnValue); } } @@ -42,7 +42,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.UseElementAccess: + case CodeAnalysisDiagnosticIds.UseElementAccess: { CodeAction codeAction = CodeAction.Create( "Use [] instead of calling 'First'", @@ -52,7 +52,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseReturnValue: + case CodeAnalysisDiagnosticIds.UseReturnValue: { CodeAction codeAction = CodeAction.Create( $"Introduce local for '{invocationExpression}'", diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/SimpleMemberAccessExpressionCodeFixProvider.cs b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/SimpleMemberAccessExpressionCodeFixProvider.cs index d8a20e092f..5dd5e25d52 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/SimpleMemberAccessExpressionCodeFixProvider.cs +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/SimpleMemberAccessExpressionCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class SimpleMemberAccessExpressionCodeFixProvider : BaseCodeFixPro { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UsePropertySyntaxNodeSpanStart); } + get { return ImmutableArray.Create(CodeAnalysisDiagnosticIds.UsePropertySyntaxNodeSpanStart); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/UsePatternMatchingCodeFixProvider.cs b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/UsePatternMatchingCodeFixProvider.cs index eaa28637bc..e775b651cf 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/UsePatternMatchingCodeFixProvider.cs +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CSharp/UsePatternMatchingCodeFixProvider.cs @@ -26,7 +26,7 @@ public sealed class UsePatternMatchingCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UsePatternMatching); } + get { return ImmutableArray.Create(CodeAnalysisDiagnosticIds.UsePatternMatching); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/CodeAnalysis.Analyzers/CSharp/ElementAccessExpressionAnalyzer.cs b/src/CodeAnalysis.Analyzers/CSharp/ElementAccessExpressionAnalyzer.cs index bacb3c7b5e..c364609cb9 100644 --- a/src/CodeAnalysis.Analyzers/CSharp/ElementAccessExpressionAnalyzer.cs +++ b/src/CodeAnalysis.Analyzers/CSharp/ElementAccessExpressionAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.CallLastInsteadOfUsingElementAccess); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, CodeAnalysisDiagnosticRules.CallLastInsteadOfUsingElementAccess); return _supportedDiagnostics; } @@ -79,6 +79,6 @@ private static void AnalyzeElementAccessExpression(SyntaxNodeAnalysisContext con return; } - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.CallLastInsteadOfUsingElementAccess, elementAccessExpression.ArgumentList); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.CallLastInsteadOfUsingElementAccess, elementAccessExpression.ArgumentList); } } diff --git a/src/CodeAnalysis.Analyzers/CSharp/InvocationExpressionAnalyzer.cs b/src/CodeAnalysis.Analyzers/CSharp/InvocationExpressionAnalyzer.cs index 25ef0bf2e8..69d90b6817 100644 --- a/src/CodeAnalysis.Analyzers/CSharp/InvocationExpressionAnalyzer.cs +++ b/src/CodeAnalysis.Analyzers/CSharp/InvocationExpressionAnalyzer.cs @@ -24,9 +24,9 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.UnnecessaryNullCheck, - DiagnosticRules.UseElementAccess, - DiagnosticRules.UseReturnValue); + CodeAnalysisDiagnosticRules.UnnecessaryNullCheck, + CodeAnalysisDiagnosticRules.UseElementAccess, + CodeAnalysisDiagnosticRules.UseReturnValue); } return _supportedDiagnostics; @@ -64,7 +64,7 @@ private static void AnalyzeInvocationExpression(SyntaxNodeAnalysisContext contex { case "First": { - if (DiagnosticRules.UseElementAccess.IsEffective(context)) + if (CodeAnalysisDiagnosticRules.UseElementAccess.IsEffective(context)) UseElementAccessInsteadOfCallingFirst(); break; @@ -79,14 +79,14 @@ private static void AnalyzeInvocationExpression(SyntaxNodeAnalysisContext contex { case "ElementAt": { - if (DiagnosticRules.UseElementAccess.IsEffective(context)) + if (CodeAnalysisDiagnosticRules.UseElementAccess.IsEffective(context)) UseElementAccessInsteadOfCallingElementAt(); break; } case "IsKind": { - if (DiagnosticRules.UnnecessaryNullCheck.IsEffective(context)) + if (CodeAnalysisDiagnosticRules.UnnecessaryNullCheck.IsEffective(context)) AnalyzeUnnecessaryNullCheck(); break; @@ -97,7 +97,7 @@ private static void AnalyzeInvocationExpression(SyntaxNodeAnalysisContext contex } } - if (DiagnosticRules.UseReturnValue.IsEffective(context) + if (CodeAnalysisDiagnosticRules.UseReturnValue.IsEffective(context) && invocationExpression.IsParentKind(SyntaxKind.ExpressionStatement)) { UseReturnValue(); @@ -138,7 +138,7 @@ void AnalyzeUnnecessaryNullCheck() DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.UnnecessaryNullCheck, + CodeAnalysisDiagnosticRules.UnnecessaryNullCheck, Location.Create(invocationInfo.InvocationExpression.SyntaxTree, span)); } @@ -161,7 +161,7 @@ void UseElementAccessInsteadOfCallingFirst() DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.UseElementAccess, + CodeAnalysisDiagnosticRules.UseElementAccess, Location.Create(invocationExpression.SyntaxTree, span)); } @@ -184,7 +184,7 @@ void UseElementAccessInsteadOfCallingElementAt() DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.UseElementAccess, + CodeAnalysisDiagnosticRules.UseElementAccess, Location.Create(invocationExpression.SyntaxTree, span)); } @@ -204,7 +204,7 @@ void UseReturnValue() if (!RoslynSymbolUtility.IsRoslynType(methodSymbol.ReturnType)) return; - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.UseReturnValue, invocationExpression); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.UseReturnValue, invocationExpression); } } } diff --git a/src/CodeAnalysis.Analyzers/CSharp/NamedTypeSymbolAnalyzer.cs b/src/CodeAnalysis.Analyzers/CSharp/NamedTypeSymbolAnalyzer.cs index 500d6a3603..cc81906b9e 100644 --- a/src/CodeAnalysis.Analyzers/CSharp/NamedTypeSymbolAnalyzer.cs +++ b/src/CodeAnalysis.Analyzers/CSharp/NamedTypeSymbolAnalyzer.cs @@ -22,9 +22,9 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.UnknownLanguageName, - DiagnosticRules.SpecifyExportCodeFixProviderAttributeName, - DiagnosticRules.SpecifyExportCodeRefactoringProviderAttributeName); + CodeAnalysisDiagnosticRules.UnknownLanguageName, + CodeAnalysisDiagnosticRules.SpecifyExportCodeFixProviderAttributeName, + CodeAnalysisDiagnosticRules.SpecifyExportCodeRefactoringProviderAttributeName); } return _supportedDiagnostics; @@ -94,7 +94,7 @@ private static void AnalyzeDiagnosticAnalyzer(SymbolAnalysisContext context, INa if (attribute is null) return; - if (DiagnosticRules.UnknownLanguageName.IsEffective(context)) + if (CodeAnalysisDiagnosticRules.UnknownLanguageName.IsEffective(context)) AnalyzeLanguageName(context, attribute); } @@ -105,13 +105,13 @@ private static void AnalyzeCodeFixProvider(SymbolAnalysisContext context, INamed if (attribute is null) return; - if (DiagnosticRules.UnknownLanguageName.IsEffective(context)) + if (CodeAnalysisDiagnosticRules.UnknownLanguageName.IsEffective(context)) AnalyzeLanguageName(context, attribute); - if (DiagnosticRules.SpecifyExportCodeFixProviderAttributeName.IsEffective(context) + if (CodeAnalysisDiagnosticRules.SpecifyExportCodeFixProviderAttributeName.IsEffective(context) && !ContainsNamedArgument(attribute, "Name")) { - ReportDiagnostic(context, attribute, DiagnosticRules.SpecifyExportCodeFixProviderAttributeName); + ReportDiagnostic(context, attribute, CodeAnalysisDiagnosticRules.SpecifyExportCodeFixProviderAttributeName); } } @@ -122,13 +122,13 @@ private static void AnalyzeCodeRefactoringProvider(SymbolAnalysisContext context if (attribute is null) return; - if (DiagnosticRules.UnknownLanguageName.IsEffective(context)) + if (CodeAnalysisDiagnosticRules.UnknownLanguageName.IsEffective(context)) AnalyzeLanguageName(context, attribute); - if (DiagnosticRules.SpecifyExportCodeRefactoringProviderAttributeName.IsEffective(context) + if (CodeAnalysisDiagnosticRules.SpecifyExportCodeRefactoringProviderAttributeName.IsEffective(context) && !ContainsNamedArgument(attribute, "Name")) { - ReportDiagnostic(context, attribute, DiagnosticRules.SpecifyExportCodeRefactoringProviderAttributeName); + ReportDiagnostic(context, attribute, CodeAnalysisDiagnosticRules.SpecifyExportCodeRefactoringProviderAttributeName); } } @@ -196,7 +196,7 @@ private static void ReportUnknownLanguageName(SymbolAnalysisContext context, Att { if (argumentIndex == i) { - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.UnknownLanguageName, arguments[i].Expression); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.UnknownLanguageName, arguments[i].Expression); break; } } diff --git a/src/CodeAnalysis.Analyzers/CSharp/SimpleMemberAccessExpressionAnalyzer.cs b/src/CodeAnalysis.Analyzers/CSharp/SimpleMemberAccessExpressionAnalyzer.cs index 0324c9fc18..8683fb308a 100644 --- a/src/CodeAnalysis.Analyzers/CSharp/SimpleMemberAccessExpressionAnalyzer.cs +++ b/src/CodeAnalysis.Analyzers/CSharp/SimpleMemberAccessExpressionAnalyzer.cs @@ -25,8 +25,8 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.UsePropertySyntaxNodeSpanStart, - DiagnosticRules.CallAnyInsteadOfAccessingCount); + CodeAnalysisDiagnosticRules.UsePropertySyntaxNodeSpanStart, + CodeAnalysisDiagnosticRules.CallAnyInsteadOfAccessingCount); } return _supportedDiagnostics; @@ -85,7 +85,7 @@ private static void AnalyzeSimpleMemberAccessExpression(SyntaxNodeAnalysisContex if (!symbol2.ContainingType.HasMetadataName(MetadataNames.Microsoft_CodeAnalysis_SyntaxNode)) break; - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.UsePropertySyntaxNodeSpanStart, memberAccessExpression); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.UsePropertySyntaxNodeSpanStart, memberAccessExpression); break; } case "Count": @@ -139,7 +139,7 @@ void CallAnyInsteadOfUsingCount() ? TextSpan.FromBounds(name.SpanStart, numericLiteralExpression.Span.End) : TextSpan.FromBounds(numericLiteralExpression.SpanStart, name.Span.End); - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.CallAnyInsteadOfAccessingCount, Location.Create(memberAccessExpression.SyntaxTree, span)); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.CallAnyInsteadOfAccessingCount, Location.Create(memberAccessExpression.SyntaxTree, span)); } } } diff --git a/src/CodeAnalysis.Analyzers/CSharp/UnnecessaryConditionalAccessAnalyzer.cs b/src/CodeAnalysis.Analyzers/CSharp/UnnecessaryConditionalAccessAnalyzer.cs index 33ad9f308c..1351501dab 100644 --- a/src/CodeAnalysis.Analyzers/CSharp/UnnecessaryConditionalAccessAnalyzer.cs +++ b/src/CodeAnalysis.Analyzers/CSharp/UnnecessaryConditionalAccessAnalyzer.cs @@ -24,8 +24,8 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.UnnecessaryConditionalAccess, - DiagnosticRules.UnnecessaryConditionalAccessFadeOut); + CodeAnalysisDiagnosticRules.UnnecessaryConditionalAccess, + CodeAnalysisDiagnosticRules.UnnecessaryConditionalAccessFadeOut); } return _supportedDiagnostics; @@ -114,7 +114,7 @@ private static void AnalyzeBinaryExpression(SyntaxNodeAnalysisContext context) if (!parameters[1].Type.HasMetadataName(RoslynMetadataNames.Microsoft_CodeAnalysis_CSharp_SyntaxKind)) return; - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.UnnecessaryConditionalAccess, conditionalAccess.OperatorToken); - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.UnnecessaryConditionalAccessFadeOut, binaryExpression.Right); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.UnnecessaryConditionalAccess, conditionalAccess.OperatorToken); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.UnnecessaryConditionalAccessFadeOut, binaryExpression.Right); } } diff --git a/src/CodeAnalysis.Analyzers/CSharp/UsePatternMatchingAnalyzer.cs b/src/CodeAnalysis.Analyzers/CSharp/UsePatternMatchingAnalyzer.cs index 52fc97520e..9877f70866 100644 --- a/src/CodeAnalysis.Analyzers/CSharp/UsePatternMatchingAnalyzer.cs +++ b/src/CodeAnalysis.Analyzers/CSharp/UsePatternMatchingAnalyzer.cs @@ -30,7 +30,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.UsePatternMatching); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, CodeAnalysisDiagnosticRules.UsePatternMatching); return _supportedDiagnostics; } @@ -187,7 +187,7 @@ private static void AnalyzeSwitchStatement(SyntaxNodeAnalysisContext context) return; } - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.UsePatternMatching, switchStatement.SwitchKeyword); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.UsePatternMatching, switchStatement.SwitchKeyword); string GetName() { @@ -320,7 +320,7 @@ void Analyze(StatementSyntax statement) if (!CSharpFactory.AreEquivalent(isKindExpression.Expression, castExpression.Expression)) return; - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.UsePatternMatching, ifStatement.IfKeyword); + DiagnosticHelpers.ReportDiagnostic(context, CodeAnalysisDiagnosticRules.UsePatternMatching, ifStatement.IfKeyword); } } diff --git a/src/Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs b/src/Common/CSharp/DiagnosticIds.Generated.cs similarity index 99% rename from src/Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs rename to src/Common/CSharp/DiagnosticIds.Generated.cs index dd1cb8ae80..c64d018589 100644 --- a/src/Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs +++ b/src/Common/CSharp/DiagnosticIds.Generated.cs @@ -6,7 +6,7 @@ namespace Roslynator.CSharp { - public static partial class DiagnosticIdentifiers + public static partial class DiagnosticIds { public const string AddBracesWhenExpressionSpansOverMultipleLines = "RCS1001"; public const string RemoveBraces = "RCS1002"; diff --git a/src/Analyzers/CSharp/DiagnosticRules.Generated.cs b/src/Common/CSharp/DiagnosticRules.Generated.cs similarity index 77% rename from src/Analyzers/CSharp/DiagnosticRules.Generated.cs rename to src/Common/CSharp/DiagnosticRules.Generated.cs index 9e0d1ca25f..322f72b534 100644 --- a/src/Analyzers/CSharp/DiagnosticRules.Generated.cs +++ b/src/Common/CSharp/DiagnosticRules.Generated.cs @@ -11,2656 +11,2656 @@ public static partial class DiagnosticRules { /// RCS1001 public static readonly DiagnosticDescriptor AddBracesWhenExpressionSpansOverMultipleLines = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBracesWhenExpressionSpansOverMultipleLines, + id: DiagnosticIds.AddBracesWhenExpressionSpansOverMultipleLines, title: "Add braces (when expression spans over multiple lines)", messageFormat: "Add braces to {0} (when expression spans over multiple lines)", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBracesWhenExpressionSpansOverMultipleLines, + helpLinkUri: DiagnosticIds.AddBracesWhenExpressionSpansOverMultipleLines, customTags: Array.Empty()); /// RCS1002 public static readonly DiagnosticDescriptor RemoveBraces = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveBraces, + id: DiagnosticIds.RemoveBraces, title: "Remove braces", messageFormat: "Remove braces from {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveBraces, + helpLinkUri: DiagnosticIds.RemoveBraces, customTags: Array.Empty()); public static readonly DiagnosticDescriptor RemoveBracesFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveBraces); /// RCS1003 public static readonly DiagnosticDescriptor AddBracesToIfElseWhenExpressionSpansOverMultipleLines = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBracesToIfElseWhenExpressionSpansOverMultipleLines, + id: DiagnosticIds.AddBracesToIfElseWhenExpressionSpansOverMultipleLines, title: "Add braces to if-else (when expression spans over multiple lines)", messageFormat: "Add braces to if-else (when expression spans over multiple lines)", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBracesToIfElseWhenExpressionSpansOverMultipleLines, + helpLinkUri: DiagnosticIds.AddBracesToIfElseWhenExpressionSpansOverMultipleLines, customTags: Array.Empty()); /// RCS1004 public static readonly DiagnosticDescriptor RemoveBracesFromIfElse = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveBracesFromIfElse, + id: DiagnosticIds.RemoveBracesFromIfElse, title: "Remove braces from if-else", messageFormat: "Remove braces from if-else", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveBracesFromIfElse, + helpLinkUri: DiagnosticIds.RemoveBracesFromIfElse, customTags: Array.Empty()); public static readonly DiagnosticDescriptor RemoveBracesFromIfElseFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveBracesFromIfElse); /// RCS1005 public static readonly DiagnosticDescriptor SimplifyNestedUsingStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyNestedUsingStatement, + id: DiagnosticIds.SimplifyNestedUsingStatement, title: "Simplify nested using statement", messageFormat: "Simplify nested using statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyNestedUsingStatement, + helpLinkUri: DiagnosticIds.SimplifyNestedUsingStatement, customTags: Array.Empty()); public static readonly DiagnosticDescriptor SimplifyNestedUsingStatementFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(SimplifyNestedUsingStatement); /// RCS1006 public static readonly DiagnosticDescriptor MergeElseWithNestedIf = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MergeElseWithNestedIf, + id: DiagnosticIds.MergeElseWithNestedIf, title: "Merge 'else' with nested 'if'", messageFormat: "Merge 'else' with nested 'if'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MergeElseWithNestedIf, + helpLinkUri: DiagnosticIds.MergeElseWithNestedIf, customTags: Array.Empty()); public static readonly DiagnosticDescriptor MergeElseWithNestedIfFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(MergeElseWithNestedIf); /// RCS1007 public static readonly DiagnosticDescriptor AddBraces = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBraces, + id: DiagnosticIds.AddBraces, title: "Add braces", messageFormat: "Add braces to {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBraces, + helpLinkUri: DiagnosticIds.AddBraces, customTags: Array.Empty()); /// RCS1008 public static readonly DiagnosticDescriptor UseExplicitTypeInsteadOfVarWhenTypeIsNotObvious = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarWhenTypeIsNotObvious, + id: DiagnosticIds.UseExplicitTypeInsteadOfVarWhenTypeIsNotObvious, title: "[deprecated] Use explicit type instead of 'var' (when the type is not obvious)", messageFormat: "([deprecated] Use RCS1264 instead) Use explicit type instead of 'var'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarWhenTypeIsNotObvious, + helpLinkUri: DiagnosticIds.UseExplicitTypeInsteadOfVarWhenTypeIsNotObvious, customTags: Array.Empty()); /// RCS1009 public static readonly DiagnosticDescriptor UseExplicitTypeInsteadOfVarInForEach = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarInForEach, + id: DiagnosticIds.UseExplicitTypeInsteadOfVarInForEach, title: "[deprecated] Use explicit type instead of 'var' (foreach variable)", messageFormat: "([deprecated] Use RCS1264 instead) Use explicit type instead of 'var'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarInForEach, + helpLinkUri: DiagnosticIds.UseExplicitTypeInsteadOfVarInForEach, customTags: Array.Empty()); /// RCS1010 public static readonly DiagnosticDescriptor UseVarInsteadOfExplicitTypeWhenTypeIsObvious = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeWhenTypeIsObvious, + id: DiagnosticIds.UseVarInsteadOfExplicitTypeWhenTypeIsObvious, title: "[deprecated] Use 'var' instead of explicit type (when the type is obvious)", messageFormat: "([deprecated] Use RCS1264 instead) Use 'var' instead of explicit type", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeWhenTypeIsObvious, + helpLinkUri: DiagnosticIds.UseVarInsteadOfExplicitTypeWhenTypeIsObvious, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1012 public static readonly DiagnosticDescriptor UseExplicitTypeInsteadOfVarWhenTypeIsObvious = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarWhenTypeIsObvious, + id: DiagnosticIds.UseExplicitTypeInsteadOfVarWhenTypeIsObvious, title: "[deprecated] Use explicit type instead of 'var' (when the type is obvious)", messageFormat: "([deprecated] Use RCS1264 instead) Use explicit type instead of 'var'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarWhenTypeIsObvious, + helpLinkUri: DiagnosticIds.UseExplicitTypeInsteadOfVarWhenTypeIsObvious, customTags: Array.Empty()); /// RCS1013 public static readonly DiagnosticDescriptor UsePredefinedType = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UsePredefinedType, + id: DiagnosticIds.UsePredefinedType, title: "Use predefined type", messageFormat: "Use predefined type", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UsePredefinedType, + helpLinkUri: DiagnosticIds.UsePredefinedType, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1014 public static readonly DiagnosticDescriptor UseExplicitlyOrImplicitlyTypedArray = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray, + id: DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray, title: "Use explicitly/implicitly typed array", messageFormat: "{0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray, + helpLinkUri: DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray, customTags: Array.Empty()); /// RCS1015 public static readonly DiagnosticDescriptor UseNameOfOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseNameOfOperator, + id: DiagnosticIds.UseNameOfOperator, title: "Use nameof operator", messageFormat: "Use nameof operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseNameOfOperator, + helpLinkUri: DiagnosticIds.UseNameOfOperator, customTags: Array.Empty()); public static readonly DiagnosticDescriptor UseNameOfOperatorFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(UseNameOfOperator); /// RCS1016 public static readonly DiagnosticDescriptor UseBlockBodyOrExpressionBody = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseBlockBodyOrExpressionBody, + id: DiagnosticIds.UseBlockBodyOrExpressionBody, title: "Use block body or expression body", messageFormat: "Use {0} body", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseBlockBodyOrExpressionBody, + helpLinkUri: DiagnosticIds.UseBlockBodyOrExpressionBody, customTags: Array.Empty()); /// RCS1018 public static readonly DiagnosticDescriptor AddOrRemoveAccessibilityModifiers = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers, + id: DiagnosticIds.AddOrRemoveAccessibilityModifiers, title: "Add/remove accessibility modifiers", messageFormat: "{0} accessibility modifiers", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers, + helpLinkUri: DiagnosticIds.AddOrRemoveAccessibilityModifiers, customTags: Array.Empty()); /// RCS1019 public static readonly DiagnosticDescriptor OrderModifiers = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.OrderModifiers, + id: DiagnosticIds.OrderModifiers, title: "Order modifiers", messageFormat: "Order modifiers", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.OrderModifiers, + helpLinkUri: DiagnosticIds.OrderModifiers, customTags: Array.Empty()); /// RCS1020 public static readonly DiagnosticDescriptor SimplifyNullableOfT = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyNullableOfT, + id: DiagnosticIds.SimplifyNullableOfT, title: "Simplify Nullable to T?", messageFormat: "Simplify Nullable to T?", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyNullableOfT, + helpLinkUri: DiagnosticIds.SimplifyNullableOfT, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1021 public static readonly DiagnosticDescriptor ConvertLambdaExpressionBodyToExpressionBody = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ConvertLambdaExpressionBodyToExpressionBody, + id: DiagnosticIds.ConvertLambdaExpressionBodyToExpressionBody, title: "Convert lambda expression body to expression body", messageFormat: "Use expression-bodied lambda", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ConvertLambdaExpressionBodyToExpressionBody, + helpLinkUri: DiagnosticIds.ConvertLambdaExpressionBodyToExpressionBody, customTags: Array.Empty()); public static readonly DiagnosticDescriptor ConvertLambdaExpressionBodyToExpressionBodyFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(ConvertLambdaExpressionBodyToExpressionBody); /// RCS1031 public static readonly DiagnosticDescriptor RemoveUnnecessaryBracesInSwitchSection = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveUnnecessaryBracesInSwitchSection, + id: DiagnosticIds.RemoveUnnecessaryBracesInSwitchSection, title: "Remove unnecessary braces in switch section", messageFormat: "Remove unnecessary braces", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveUnnecessaryBracesInSwitchSection, + helpLinkUri: DiagnosticIds.RemoveUnnecessaryBracesInSwitchSection, customTags: WellKnownDiagnosticTags.Unnecessary); public static readonly DiagnosticDescriptor RemoveUnnecessaryBracesInSwitchSectionFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveUnnecessaryBracesInSwitchSection); /// RCS1032 public static readonly DiagnosticDescriptor RemoveRedundantParentheses = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantParentheses, + id: DiagnosticIds.RemoveRedundantParentheses, title: "Remove redundant parentheses", messageFormat: "Remove redundant parentheses", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantParentheses, + helpLinkUri: DiagnosticIds.RemoveRedundantParentheses, customTags: Array.Empty()); public static readonly DiagnosticDescriptor RemoveRedundantParenthesesFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveRedundantParentheses); /// RCS1033 public static readonly DiagnosticDescriptor RemoveRedundantBooleanLiteral = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantBooleanLiteral, + id: DiagnosticIds.RemoveRedundantBooleanLiteral, title: "Remove redundant boolean literal", messageFormat: "Remove redundant '{0}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantBooleanLiteral, + helpLinkUri: DiagnosticIds.RemoveRedundantBooleanLiteral, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1034 public static readonly DiagnosticDescriptor RemoveRedundantSealedModifier = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantSealedModifier, + id: DiagnosticIds.RemoveRedundantSealedModifier, title: "Remove redundant 'sealed' modifier", messageFormat: "Remove redundant 'sealed' modifier", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantSealedModifier, + helpLinkUri: DiagnosticIds.RemoveRedundantSealedModifier, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1035 public static readonly DiagnosticDescriptor RemoveRedundantCommaInInitializer = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantCommaInInitializer, + id: DiagnosticIds.RemoveRedundantCommaInInitializer, title: "[deprecated] Remove redundant comma in initializer", messageFormat: "([deprecated] Use RCS1260 instead) Remove redundant comma in initializer", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantCommaInInitializer, + helpLinkUri: DiagnosticIds.RemoveRedundantCommaInInitializer, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1036 public static readonly DiagnosticDescriptor RemoveUnnecessaryBlankLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveUnnecessaryBlankLine, + id: DiagnosticIds.RemoveUnnecessaryBlankLine, title: "Remove unnecessary blank line", messageFormat: "Remove unnecessary blank line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveUnnecessaryBlankLine, + helpLinkUri: DiagnosticIds.RemoveUnnecessaryBlankLine, customTags: Array.Empty()); /// RCS1037 public static readonly DiagnosticDescriptor RemoveTrailingWhitespace = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveTrailingWhitespace, + id: DiagnosticIds.RemoveTrailingWhitespace, title: "Remove trailing white-space", messageFormat: "Remove trailing white-space", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveTrailingWhitespace, + helpLinkUri: DiagnosticIds.RemoveTrailingWhitespace, customTags: Array.Empty()); /// RCS1038 public static readonly DiagnosticDescriptor RemoveEmptyStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEmptyStatement, + id: DiagnosticIds.RemoveEmptyStatement, title: "[deprecated] Remove empty statement", messageFormat: "([deprecated] Use RCS1259 instead) Remove empty statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEmptyStatement, + helpLinkUri: DiagnosticIds.RemoveEmptyStatement, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1039 public static readonly DiagnosticDescriptor RemoveArgumentListFromAttribute = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveArgumentListFromAttribute, + id: DiagnosticIds.RemoveArgumentListFromAttribute, title: "Remove argument list from attribute", messageFormat: "Remove argument list from attribute", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveArgumentListFromAttribute, + helpLinkUri: DiagnosticIds.RemoveArgumentListFromAttribute, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1040 public static readonly DiagnosticDescriptor RemoveEmptyElseClause = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEmptyElseClause, + id: DiagnosticIds.RemoveEmptyElseClause, title: "[deprecated] Remove empty 'else' clause", messageFormat: "([deprecated] Use RCS1259 instead) Remove empty 'else' clause", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEmptyElseClause, + helpLinkUri: DiagnosticIds.RemoveEmptyElseClause, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1041 public static readonly DiagnosticDescriptor RemoveEmptyInitializer = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEmptyInitializer, + id: DiagnosticIds.RemoveEmptyInitializer, title: "[deprecated] Remove empty initializer", messageFormat: "([deprecated] Use RCS1259 instead) Remove empty initializer", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEmptyInitializer, + helpLinkUri: DiagnosticIds.RemoveEmptyInitializer, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1042 public static readonly DiagnosticDescriptor RemoveEnumDefaultUnderlyingType = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEnumDefaultUnderlyingType, + id: DiagnosticIds.RemoveEnumDefaultUnderlyingType, title: "Remove enum default underlying type", messageFormat: "Remove enum default underlying type", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEnumDefaultUnderlyingType, + helpLinkUri: DiagnosticIds.RemoveEnumDefaultUnderlyingType, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1043 public static readonly DiagnosticDescriptor RemovePartialModifierFromTypeWithSinglePart = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart, + id: DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart, title: "Remove 'partial' modifier from type with a single part", messageFormat: "Remove 'partial' modifier from type with a single part", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart, + helpLinkUri: DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1044 public static readonly DiagnosticDescriptor RemoveOriginalExceptionFromThrowStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveOriginalExceptionFromThrowStatement, + id: DiagnosticIds.RemoveOriginalExceptionFromThrowStatement, title: "Remove original exception from throw statement", messageFormat: "Remove original exception from throw statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveOriginalExceptionFromThrowStatement, + helpLinkUri: DiagnosticIds.RemoveOriginalExceptionFromThrowStatement, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1046 public static readonly DiagnosticDescriptor AsynchronousMethodNameShouldEndWithAsync = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync, + id: DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync, title: "Asynchronous method name should end with 'Async'", messageFormat: "Add suffix 'Async' to asynchronous method name", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync, + helpLinkUri: DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync, customTags: Array.Empty()); /// RCS1047 public static readonly DiagnosticDescriptor NonAsynchronousMethodNameShouldNotEndWithAsync = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync, + id: DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync, title: "Non-asynchronous method name should not end with 'Async'", messageFormat: "Remove suffix 'Async' from non-asynchronous method name", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync, + helpLinkUri: DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync, customTags: Array.Empty()); public static readonly DiagnosticDescriptor NonAsynchronousMethodNameShouldNotEndWithAsyncFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(NonAsynchronousMethodNameShouldNotEndWithAsync); /// RCS1048 public static readonly DiagnosticDescriptor UseLambdaExpressionInsteadOfAnonymousMethod = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseLambdaExpressionInsteadOfAnonymousMethod, + id: DiagnosticIds.UseLambdaExpressionInsteadOfAnonymousMethod, title: "Use lambda expression instead of anonymous method", messageFormat: "Use lambda expression instead of anonymous method", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseLambdaExpressionInsteadOfAnonymousMethod, + helpLinkUri: DiagnosticIds.UseLambdaExpressionInsteadOfAnonymousMethod, customTags: Array.Empty()); public static readonly DiagnosticDescriptor UseLambdaExpressionInsteadOfAnonymousMethodFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(UseLambdaExpressionInsteadOfAnonymousMethod); /// RCS1049 public static readonly DiagnosticDescriptor SimplifyBooleanComparison = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyBooleanComparison, + id: DiagnosticIds.SimplifyBooleanComparison, title: "Simplify boolean comparison", messageFormat: "Simplify boolean comparison", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyBooleanComparison, + helpLinkUri: DiagnosticIds.SimplifyBooleanComparison, customTags: Array.Empty()); public static readonly DiagnosticDescriptor SimplifyBooleanComparisonFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(SimplifyBooleanComparison); /// RCS1050 public static readonly DiagnosticDescriptor IncludeParenthesesWhenCreatingNewObject = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject, + id: DiagnosticIds.IncludeParenthesesWhenCreatingNewObject, title: "Include/omit parentheses when creating new object", messageFormat: "{0} parentheses when creating new object", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject, + helpLinkUri: DiagnosticIds.IncludeParenthesesWhenCreatingNewObject, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1051 public static readonly DiagnosticDescriptor AddOrRemoveParenthesesFromConditionInConditionalOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator, + id: DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator, title: "Add/remove parentheses from condition in conditional operator", messageFormat: "{0} parentheses {1} condition", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator, + helpLinkUri: DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator, customTags: Array.Empty()); /// RCS1052 public static readonly DiagnosticDescriptor DeclareEachAttributeSeparately = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DeclareEachAttributeSeparately, + id: DiagnosticIds.DeclareEachAttributeSeparately, title: "Declare each attribute separately", messageFormat: "Declare each attribute separately", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.DeclareEachAttributeSeparately, + helpLinkUri: DiagnosticIds.DeclareEachAttributeSeparately, customTags: Array.Empty()); /// RCS1055 public static readonly DiagnosticDescriptor UnnecessarySemicolonAtEndOfDeclaration = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessarySemicolonAtEndOfDeclaration, + id: DiagnosticIds.UnnecessarySemicolonAtEndOfDeclaration, title: "Unnecessary semicolon at the end of declaration", messageFormat: "Unnecessary semicolon at the end of declaration", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessarySemicolonAtEndOfDeclaration, + helpLinkUri: DiagnosticIds.UnnecessarySemicolonAtEndOfDeclaration, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1056 public static readonly DiagnosticDescriptor AvoidUsageOfUsingAliasDirective = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective, + id: DiagnosticIds.AvoidUsageOfUsingAliasDirective, title: "Avoid usage of using alias directive", messageFormat: "Avoid usage of using alias directive", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective, + helpLinkUri: DiagnosticIds.AvoidUsageOfUsingAliasDirective, customTags: Array.Empty()); /// RCS1058 public static readonly DiagnosticDescriptor UseCompoundAssignment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseCompoundAssignment, + id: DiagnosticIds.UseCompoundAssignment, title: "Use compound assignment", messageFormat: "Use compound assignment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseCompoundAssignment, + helpLinkUri: DiagnosticIds.UseCompoundAssignment, customTags: Array.Empty()); public static readonly DiagnosticDescriptor UseCompoundAssignmentFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(UseCompoundAssignment); /// RCS1059 public static readonly DiagnosticDescriptor AvoidLockingOnPubliclyAccessibleInstance = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidLockingOnPubliclyAccessibleInstance, + id: DiagnosticIds.AvoidLockingOnPubliclyAccessibleInstance, title: "Avoid locking on publicly accessible instance", messageFormat: "Lock on private field instead of locking on '{0}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidLockingOnPubliclyAccessibleInstance, + helpLinkUri: DiagnosticIds.AvoidLockingOnPubliclyAccessibleInstance, customTags: Array.Empty()); /// RCS1060 public static readonly DiagnosticDescriptor DeclareEachTypeInSeparateFile = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DeclareEachTypeInSeparateFile, + id: DiagnosticIds.DeclareEachTypeInSeparateFile, title: "Declare each type in separate file", messageFormat: "Declare each type in separate file", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.DeclareEachTypeInSeparateFile, + helpLinkUri: DiagnosticIds.DeclareEachTypeInSeparateFile, customTags: Array.Empty()); /// RCS1061 public static readonly DiagnosticDescriptor MergeIfWithNestedIf = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MergeIfWithNestedIf, + id: DiagnosticIds.MergeIfWithNestedIf, title: "Merge 'if' with nested 'if'", messageFormat: "Merge 'if' with nested 'if'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MergeIfWithNestedIf, + helpLinkUri: DiagnosticIds.MergeIfWithNestedIf, customTags: Array.Empty()); public static readonly DiagnosticDescriptor MergeIfWithNestedIfFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(MergeIfWithNestedIf); /// RCS1063 public static readonly DiagnosticDescriptor AvoidUsageOfDoStatementToCreateInfiniteLoop = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidUsageOfDoStatementToCreateInfiniteLoop, + id: DiagnosticIds.AvoidUsageOfDoStatementToCreateInfiniteLoop, title: "[deprecated] Avoid usage of do statement to create an infinite loop", messageFormat: "([deprecated] Use RCS1252 instead) Use while statement to create an infinite loop", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidUsageOfDoStatementToCreateInfiniteLoop, + helpLinkUri: DiagnosticIds.AvoidUsageOfDoStatementToCreateInfiniteLoop, customTags: Array.Empty()); /// RCS1064 public static readonly DiagnosticDescriptor AvoidUsageOfForStatementToCreateInfiniteLoop = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidUsageOfForStatementToCreateInfiniteLoop, + id: DiagnosticIds.AvoidUsageOfForStatementToCreateInfiniteLoop, title: "[deprecated] Avoid usage of for statement to create an infinite loop", messageFormat: "([deprecated] Use RCS1252 instead) Use while statement to create an infinite loop", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidUsageOfForStatementToCreateInfiniteLoop, + helpLinkUri: DiagnosticIds.AvoidUsageOfForStatementToCreateInfiniteLoop, customTags: Array.Empty()); /// RCS1065 public static readonly DiagnosticDescriptor AvoidUsageOfWhileStatementToCreateInfiniteLoop = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidUsageOfWhileStatementToCreateInfiniteLoop, + id: DiagnosticIds.AvoidUsageOfWhileStatementToCreateInfiniteLoop, title: "[deprecated] Avoid usage of while statement to create an infinite loop", messageFormat: "([deprecated] Use RCS1252 instead) Use for statement to create an infinite loop", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidUsageOfWhileStatementToCreateInfiniteLoop, + helpLinkUri: DiagnosticIds.AvoidUsageOfWhileStatementToCreateInfiniteLoop, customTags: Array.Empty()); /// RCS1066 public static readonly DiagnosticDescriptor RemoveEmptyFinallyClause = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEmptyFinallyClause, + id: DiagnosticIds.RemoveEmptyFinallyClause, title: "[deprecated] Remove empty 'finally' clause", messageFormat: "([deprecated] Use RCS1259 instead) Remove empty 'finally' clause", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEmptyFinallyClause, + helpLinkUri: DiagnosticIds.RemoveEmptyFinallyClause, customTags: WellKnownDiagnosticTags.Unnecessary); public static readonly DiagnosticDescriptor RemoveEmptyFinallyClauseFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveEmptyFinallyClause); /// RCS1068 public static readonly DiagnosticDescriptor SimplifyLogicalNegation = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyLogicalNegation, + id: DiagnosticIds.SimplifyLogicalNegation, title: "Simplify logical negation", messageFormat: "Simplify logical negation", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyLogicalNegation, + helpLinkUri: DiagnosticIds.SimplifyLogicalNegation, customTags: Array.Empty()); /// RCS1069 public static readonly DiagnosticDescriptor RemoveUnnecessaryCaseLabel = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveUnnecessaryCaseLabel, + id: DiagnosticIds.RemoveUnnecessaryCaseLabel, title: "Remove unnecessary case label", messageFormat: "Remove unnecessary case label", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveUnnecessaryCaseLabel, + helpLinkUri: DiagnosticIds.RemoveUnnecessaryCaseLabel, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1070 public static readonly DiagnosticDescriptor RemoveRedundantDefaultSwitchSection = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantDefaultSwitchSection, + id: DiagnosticIds.RemoveRedundantDefaultSwitchSection, title: "Remove redundant default switch section", messageFormat: "Remove redundant default switch section", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantDefaultSwitchSection, + helpLinkUri: DiagnosticIds.RemoveRedundantDefaultSwitchSection, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1071 public static readonly DiagnosticDescriptor RemoveRedundantBaseConstructorCall = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantBaseConstructorCall, + id: DiagnosticIds.RemoveRedundantBaseConstructorCall, title: "Remove redundant base constructor call", messageFormat: "Remove redundant base constructor call", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantBaseConstructorCall, + helpLinkUri: DiagnosticIds.RemoveRedundantBaseConstructorCall, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1072 public static readonly DiagnosticDescriptor RemoveEmptyNamespaceDeclaration = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEmptyNamespaceDeclaration, + id: DiagnosticIds.RemoveEmptyNamespaceDeclaration, title: "[deprecated] Remove empty namespace declaration", messageFormat: "([deprecated] Use RCS1259 instead) Remove empty namespace declaration", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEmptyNamespaceDeclaration, + helpLinkUri: DiagnosticIds.RemoveEmptyNamespaceDeclaration, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1073 public static readonly DiagnosticDescriptor ConvertIfToReturnStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ConvertIfToReturnStatement, + id: DiagnosticIds.ConvertIfToReturnStatement, title: "Convert 'if' to 'return' statement", messageFormat: "Convert 'if' to 'return' statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ConvertIfToReturnStatement, + helpLinkUri: DiagnosticIds.ConvertIfToReturnStatement, customTags: Array.Empty()); public static readonly DiagnosticDescriptor ConvertIfToReturnStatementFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(ConvertIfToReturnStatement); /// RCS1074 public static readonly DiagnosticDescriptor RemoveRedundantConstructor = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantConstructor, + id: DiagnosticIds.RemoveRedundantConstructor, title: "Remove redundant constructor", messageFormat: "Remove redundant constructor", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantConstructor, + helpLinkUri: DiagnosticIds.RemoveRedundantConstructor, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1075 public static readonly DiagnosticDescriptor AvoidEmptyCatchClauseThatCatchesSystemException = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidEmptyCatchClauseThatCatchesSystemException, + id: DiagnosticIds.AvoidEmptyCatchClauseThatCatchesSystemException, title: "Avoid empty catch clause that catches System.Exception", messageFormat: "Avoid empty catch clause that catches System.Exception", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidEmptyCatchClauseThatCatchesSystemException, + helpLinkUri: DiagnosticIds.AvoidEmptyCatchClauseThatCatchesSystemException, customTags: Array.Empty()); /// RCS1077 public static readonly DiagnosticDescriptor OptimizeLinqMethodCall = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.OptimizeLinqMethodCall, + id: DiagnosticIds.OptimizeLinqMethodCall, title: "Optimize LINQ method call", messageFormat: "Optimize LINQ method call", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.OptimizeLinqMethodCall, + helpLinkUri: DiagnosticIds.OptimizeLinqMethodCall, customTags: Array.Empty()); /// RCS1078 public static readonly DiagnosticDescriptor UseEmptyStringLiteralOrStringEmpty = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseEmptyStringLiteralOrStringEmpty, + id: DiagnosticIds.UseEmptyStringLiteralOrStringEmpty, title: "Use \"\" or 'string.Empty'", messageFormat: "Use {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseEmptyStringLiteralOrStringEmpty, + helpLinkUri: DiagnosticIds.UseEmptyStringLiteralOrStringEmpty, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1079 public static readonly DiagnosticDescriptor ThrowingOfNewNotImplementedException = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ThrowingOfNewNotImplementedException, + id: DiagnosticIds.ThrowingOfNewNotImplementedException, title: "Throwing of new NotImplementedException", messageFormat: "Implement the functionality instead of throwing new NotImplementedException", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.ThrowingOfNewNotImplementedException, + helpLinkUri: DiagnosticIds.ThrowingOfNewNotImplementedException, customTags: Array.Empty()); /// RCS1080 public static readonly DiagnosticDescriptor UseCountOrLengthPropertyInsteadOfAnyMethod = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod, + id: DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod, title: "Use 'Count/Length' property instead of 'Any' method", messageFormat: "Use '{0}' property instead of 'Any' method", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod, + helpLinkUri: DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod, customTags: Array.Empty()); /// RCS1081 public static readonly DiagnosticDescriptor SplitVariableDeclaration = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SplitVariableDeclaration, + id: DiagnosticIds.SplitVariableDeclaration, title: "Split variable declaration", messageFormat: "Split variable declaration", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.SplitVariableDeclaration, + helpLinkUri: DiagnosticIds.SplitVariableDeclaration, customTags: Array.Empty()); /// RCS1084 public static readonly DiagnosticDescriptor UseCoalesceExpressionInsteadOfConditionalExpression = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression, + id: DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression, title: "Use coalesce expression instead of conditional expression", messageFormat: "Use coalesce expression instead of conditional expression", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression, + helpLinkUri: DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression, customTags: Array.Empty()); /// RCS1085 public static readonly DiagnosticDescriptor UseAutoProperty = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseAutoProperty, + id: DiagnosticIds.UseAutoProperty, title: "Use auto-implemented property", messageFormat: "Use auto-implemented property", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseAutoProperty, + helpLinkUri: DiagnosticIds.UseAutoProperty, customTags: Array.Empty()); public static readonly DiagnosticDescriptor UseAutoPropertyFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(UseAutoProperty); /// RCS1089 public static readonly DiagnosticDescriptor UseUnaryOperatorInsteadOfAssignment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseUnaryOperatorInsteadOfAssignment, + id: DiagnosticIds.UseUnaryOperatorInsteadOfAssignment, title: "Use --/++ operator instead of assignment", messageFormat: "Use {0} operator instead of assignment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseUnaryOperatorInsteadOfAssignment, + helpLinkUri: DiagnosticIds.UseUnaryOperatorInsteadOfAssignment, customTags: Array.Empty()); public static readonly DiagnosticDescriptor UseUnaryOperatorInsteadOfAssignmentFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(UseUnaryOperatorInsteadOfAssignment); /// RCS1090 public static readonly DiagnosticDescriptor ConfigureAwait = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ConfigureAwait, + id: DiagnosticIds.ConfigureAwait, title: "Add/remove 'ConfigureAwait(false)' call", messageFormat: "{0} 'ConfigureAwait(false)' call", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.ConfigureAwait, + helpLinkUri: DiagnosticIds.ConfigureAwait, customTags: Array.Empty()); /// RCS1091 public static readonly DiagnosticDescriptor RemoveEmptyRegion = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEmptyRegion, + id: DiagnosticIds.RemoveEmptyRegion, title: "[deprecated] Remove empty region", messageFormat: "([deprecated] Use RCS1259 instead) Remove empty region", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEmptyRegion, + helpLinkUri: DiagnosticIds.RemoveEmptyRegion, customTags: Array.Empty()); public static readonly DiagnosticDescriptor RemoveEmptyRegionFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveEmptyRegion); /// RCS1093 public static readonly DiagnosticDescriptor FileContainsNoCode = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FileContainsNoCode, + id: DiagnosticIds.FileContainsNoCode, title: "File contains no code", messageFormat: "File contains no code", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.FileContainsNoCode, + helpLinkUri: DiagnosticIds.FileContainsNoCode, customTags: Array.Empty()); /// RCS1094 public static readonly DiagnosticDescriptor DeclareUsingDirectiveOnTopLevel = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DeclareUsingDirectiveOnTopLevel, + id: DiagnosticIds.DeclareUsingDirectiveOnTopLevel, title: "Declare using directive on top level", messageFormat: "Declare using directive on top level", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.DeclareUsingDirectiveOnTopLevel, + helpLinkUri: DiagnosticIds.DeclareUsingDirectiveOnTopLevel, customTags: Array.Empty()); /// RCS1096 public static readonly DiagnosticDescriptor UseHasFlagMethodOrBitwiseOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseHasFlagMethodOrBitwiseOperator, + id: DiagnosticIds.UseHasFlagMethodOrBitwiseOperator, title: "Use 'HasFlag' method or bitwise operator", messageFormat: "Use {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseHasFlagMethodOrBitwiseOperator, + helpLinkUri: DiagnosticIds.UseHasFlagMethodOrBitwiseOperator, customTags: Array.Empty()); /// RCS1097 public static readonly DiagnosticDescriptor RemoveRedundantToStringCall = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantToStringCall, + id: DiagnosticIds.RemoveRedundantToStringCall, title: "Remove redundant 'ToString' call", messageFormat: "Remove redundant 'ToString' call", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantToStringCall, + helpLinkUri: DiagnosticIds.RemoveRedundantToStringCall, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1098 public static readonly DiagnosticDescriptor ConstantValuesShouldBePlacedOnRightSideOfComparisons = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ConstantValuesShouldBePlacedOnRightSideOfComparisons, + id: DiagnosticIds.ConstantValuesShouldBePlacedOnRightSideOfComparisons, title: "Constant values should be placed on right side of comparisons", messageFormat: "Constant values should be placed on right side of comparisons", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ConstantValuesShouldBePlacedOnRightSideOfComparisons, + helpLinkUri: DiagnosticIds.ConstantValuesShouldBePlacedOnRightSideOfComparisons, customTags: Array.Empty()); /// RCS1099 public static readonly DiagnosticDescriptor DefaultLabelShouldBeLastLabelInSwitchSection = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DefaultLabelShouldBeLastLabelInSwitchSection, + id: DiagnosticIds.DefaultLabelShouldBeLastLabelInSwitchSection, title: "Default label should be the last label in a switch section", messageFormat: "Move default label to the last position in a switch section", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.DefaultLabelShouldBeLastLabelInSwitchSection, + helpLinkUri: DiagnosticIds.DefaultLabelShouldBeLastLabelInSwitchSection, customTags: Array.Empty()); /// RCS1100 public static readonly DiagnosticDescriptor FormatDocumentationSummaryOnSingleLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FormatDocumentationSummaryOnSingleLine, + id: DiagnosticIds.FormatDocumentationSummaryOnSingleLine, title: "[deprecated] Format documentation summary on a single line", messageFormat: "([deprecated] Use RCS1253 instead) Format documentation summary on a single line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FormatDocumentationSummaryOnSingleLine, + helpLinkUri: DiagnosticIds.FormatDocumentationSummaryOnSingleLine, customTags: Array.Empty()); /// RCS1101 public static readonly DiagnosticDescriptor FormatDocumentationSummaryOnMultipleLines = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FormatDocumentationSummaryOnMultipleLines, + id: DiagnosticIds.FormatDocumentationSummaryOnMultipleLines, title: "[deprecated] Format documentation summary on multiple lines", messageFormat: "([deprecated] Use RCS1253 instead) Format documentation summary on multiple lines", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FormatDocumentationSummaryOnMultipleLines, + helpLinkUri: DiagnosticIds.FormatDocumentationSummaryOnMultipleLines, customTags: Array.Empty()); /// RCS1102 public static readonly DiagnosticDescriptor MakeClassStatic = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MakeClassStatic, + id: DiagnosticIds.MakeClassStatic, title: "Make class static", messageFormat: "Make class static", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MakeClassStatic, + helpLinkUri: DiagnosticIds.MakeClassStatic, customTags: Array.Empty()); /// RCS1103 public static readonly DiagnosticDescriptor ConvertIfToAssignment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ConvertIfToAssignment, + id: DiagnosticIds.ConvertIfToAssignment, title: "Convert 'if' to assignment", messageFormat: "Convert 'if' to assignment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ConvertIfToAssignment, + helpLinkUri: DiagnosticIds.ConvertIfToAssignment, customTags: Array.Empty()); /// RCS1104 public static readonly DiagnosticDescriptor SimplifyConditionalExpression = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyConditionalExpression, + id: DiagnosticIds.SimplifyConditionalExpression, title: "Simplify conditional expression", messageFormat: "Simplify conditional expression", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyConditionalExpression, + helpLinkUri: DiagnosticIds.SimplifyConditionalExpression, customTags: Array.Empty()); /// RCS1105 public static readonly DiagnosticDescriptor UnnecessaryInterpolation = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryInterpolation, + id: DiagnosticIds.UnnecessaryInterpolation, title: "Unnecessary interpolation", messageFormat: "Unnecessary interpolation", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryInterpolation, + helpLinkUri: DiagnosticIds.UnnecessaryInterpolation, customTags: Array.Empty()); /// RCS1106 public static readonly DiagnosticDescriptor RemoveEmptyDestructor = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEmptyDestructor, + id: DiagnosticIds.RemoveEmptyDestructor, title: "[deprecated] Remove empty destructor", messageFormat: "([deprecated] Use RCS1259 instead) Remove empty destructor", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEmptyDestructor, + helpLinkUri: DiagnosticIds.RemoveEmptyDestructor, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1107 public static readonly DiagnosticDescriptor RemoveRedundantStringToCharArrayCall = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantStringToCharArrayCall, + id: DiagnosticIds.RemoveRedundantStringToCharArrayCall, title: "Remove redundant 'ToCharArray' call", messageFormat: "Remove redundant 'ToCharArray' call", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantStringToCharArrayCall, + helpLinkUri: DiagnosticIds.RemoveRedundantStringToCharArrayCall, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1108 public static readonly DiagnosticDescriptor AddStaticModifierToAllPartialClassDeclarations = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddStaticModifierToAllPartialClassDeclarations, + id: DiagnosticIds.AddStaticModifierToAllPartialClassDeclarations, title: "Add 'static' modifier to all partial class declarations", messageFormat: "Add 'static' modifier to all partial class declarations", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddStaticModifierToAllPartialClassDeclarations, + helpLinkUri: DiagnosticIds.AddStaticModifierToAllPartialClassDeclarations, customTags: Array.Empty()); /// RCS1110 public static readonly DiagnosticDescriptor DeclareTypeInsideNamespace = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DeclareTypeInsideNamespace, + id: DiagnosticIds.DeclareTypeInsideNamespace, title: "Declare type inside namespace", messageFormat: "Declare '{0}' inside namespace", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.DeclareTypeInsideNamespace, + helpLinkUri: DiagnosticIds.DeclareTypeInsideNamespace, customTags: Array.Empty()); /// RCS1111 public static readonly DiagnosticDescriptor AddBracesToSwitchSectionWithMultipleStatements = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBracesToSwitchSectionWithMultipleStatements, + id: DiagnosticIds.AddBracesToSwitchSectionWithMultipleStatements, title: "Add braces to switch section with multiple statements", messageFormat: "Add braces to switch section with multiple statements", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBracesToSwitchSectionWithMultipleStatements, + helpLinkUri: DiagnosticIds.AddBracesToSwitchSectionWithMultipleStatements, customTags: Array.Empty()); /// RCS1112 public static readonly DiagnosticDescriptor CombineEnumerableWhereMethodChain = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.CombineEnumerableWhereMethodChain, + id: DiagnosticIds.CombineEnumerableWhereMethodChain, title: "Combine 'Enumerable.Where' method chain", messageFormat: "Combine 'Enumerable.Where' method chain", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.CombineEnumerableWhereMethodChain, + helpLinkUri: DiagnosticIds.CombineEnumerableWhereMethodChain, customTags: Array.Empty()); public static readonly DiagnosticDescriptor CombineEnumerableWhereMethodChainFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(CombineEnumerableWhereMethodChain); /// RCS1113 public static readonly DiagnosticDescriptor UseStringIsNullOrEmptyMethod = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseStringIsNullOrEmptyMethod, + id: DiagnosticIds.UseStringIsNullOrEmptyMethod, title: "Use 'string.IsNullOrEmpty' method", messageFormat: "Use 'string.IsNullOrEmpty' method", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseStringIsNullOrEmptyMethod, + helpLinkUri: DiagnosticIds.UseStringIsNullOrEmptyMethod, customTags: Array.Empty()); /// RCS1114 public static readonly DiagnosticDescriptor RemoveRedundantDelegateCreation = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantDelegateCreation, + id: DiagnosticIds.RemoveRedundantDelegateCreation, title: "Remove redundant delegate creation", messageFormat: "Remove redundant delegate creation", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantDelegateCreation, + helpLinkUri: DiagnosticIds.RemoveRedundantDelegateCreation, customTags: Array.Empty()); public static readonly DiagnosticDescriptor RemoveRedundantDelegateCreationFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveRedundantDelegateCreation); /// RCS1118 public static readonly DiagnosticDescriptor MarkLocalVariableAsConst = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MarkLocalVariableAsConst, + id: DiagnosticIds.MarkLocalVariableAsConst, title: "Mark local variable as const", messageFormat: "Mark local variable as const", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MarkLocalVariableAsConst, + helpLinkUri: DiagnosticIds.MarkLocalVariableAsConst, customTags: Array.Empty()); /// RCS1123 public static readonly DiagnosticDescriptor AddParenthesesWhenNecessary = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddParenthesesWhenNecessary, + id: DiagnosticIds.AddParenthesesWhenNecessary, title: "Add parentheses when necessary", messageFormat: "Add parentheses when necessary", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddParenthesesWhenNecessary, + helpLinkUri: DiagnosticIds.AddParenthesesWhenNecessary, customTags: Array.Empty()); /// RCS1124 public static readonly DiagnosticDescriptor InlineLocalVariable = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.InlineLocalVariable, + id: DiagnosticIds.InlineLocalVariable, title: "Inline local variable", messageFormat: "Inline local variable", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.InlineLocalVariable, + helpLinkUri: DiagnosticIds.InlineLocalVariable, customTags: Array.Empty()); public static readonly DiagnosticDescriptor InlineLocalVariableFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(InlineLocalVariable); /// RCS1126 public static readonly DiagnosticDescriptor AddBracesToIfElse = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBracesToIfElse, + id: DiagnosticIds.AddBracesToIfElse, title: "Add braces to if-else", messageFormat: "Add braces to {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBracesToIfElse, + helpLinkUri: DiagnosticIds.AddBracesToIfElse, customTags: Array.Empty()); /// RCS1128 public static readonly DiagnosticDescriptor UseCoalesceExpression = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseCoalesceExpression, + id: DiagnosticIds.UseCoalesceExpression, title: "Use coalesce expression", messageFormat: "Use coalesce expression", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseCoalesceExpression, + helpLinkUri: DiagnosticIds.UseCoalesceExpression, customTags: Array.Empty()); /// RCS1129 public static readonly DiagnosticDescriptor RemoveRedundantFieldInitialization = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantFieldInitialization, + id: DiagnosticIds.RemoveRedundantFieldInitialization, title: "Remove redundant field initialization", messageFormat: "Remove redundant field initialization", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantFieldInitialization, + helpLinkUri: DiagnosticIds.RemoveRedundantFieldInitialization, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1130 public static readonly DiagnosticDescriptor BitwiseOperationOnEnumWithoutFlagsAttribute = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.BitwiseOperationOnEnumWithoutFlagsAttribute, + id: DiagnosticIds.BitwiseOperationOnEnumWithoutFlagsAttribute, title: "Bitwise operation on enum without Flags attribute", messageFormat: "Bitwise operation on enum without Flags attribute", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.BitwiseOperationOnEnumWithoutFlagsAttribute, + helpLinkUri: DiagnosticIds.BitwiseOperationOnEnumWithoutFlagsAttribute, customTags: Array.Empty()); /// RCS1132 public static readonly DiagnosticDescriptor RemoveRedundantOverridingMember = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantOverridingMember, + id: DiagnosticIds.RemoveRedundantOverridingMember, title: "Remove redundant overriding member", messageFormat: "Remove redundant overriding {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantOverridingMember, + helpLinkUri: DiagnosticIds.RemoveRedundantOverridingMember, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1133 public static readonly DiagnosticDescriptor RemoveRedundantDisposeOrCloseCall = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantDisposeOrCloseCall, + id: DiagnosticIds.RemoveRedundantDisposeOrCloseCall, title: "Remove redundant Dispose/Close call", messageFormat: "Remove redundant '{0}' call", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantDisposeOrCloseCall, + helpLinkUri: DiagnosticIds.RemoveRedundantDisposeOrCloseCall, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1134 public static readonly DiagnosticDescriptor RemoveRedundantStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantStatement, + id: DiagnosticIds.RemoveRedundantStatement, title: "Remove redundant statement", messageFormat: "Remove redundant statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantStatement, + helpLinkUri: DiagnosticIds.RemoveRedundantStatement, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1135 public static readonly DiagnosticDescriptor DeclareEnumMemberWithZeroValue = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DeclareEnumMemberWithZeroValue, + id: DiagnosticIds.DeclareEnumMemberWithZeroValue, title: "Declare enum member with zero value (when enum has FlagsAttribute)", messageFormat: "Declare enum member with zero value (when enum has FlagsAttribute)", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.DeclareEnumMemberWithZeroValue, + helpLinkUri: DiagnosticIds.DeclareEnumMemberWithZeroValue, customTags: Array.Empty()); /// RCS1136 public static readonly DiagnosticDescriptor MergeSwitchSectionsWithEquivalentContent = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MergeSwitchSectionsWithEquivalentContent, + id: DiagnosticIds.MergeSwitchSectionsWithEquivalentContent, title: "Merge switch sections with equivalent content", messageFormat: "Merge switch sections with equivalent content", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MergeSwitchSectionsWithEquivalentContent, + helpLinkUri: DiagnosticIds.MergeSwitchSectionsWithEquivalentContent, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1138 public static readonly DiagnosticDescriptor AddSummaryToDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddSummaryToDocumentationComment, + id: DiagnosticIds.AddSummaryToDocumentationComment, title: "Add summary to documentation comment", messageFormat: "Add summary to documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddSummaryToDocumentationComment, + helpLinkUri: DiagnosticIds.AddSummaryToDocumentationComment, customTags: Array.Empty()); /// RCS1139 public static readonly DiagnosticDescriptor AddSummaryElementToDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddSummaryElementToDocumentationComment, + id: DiagnosticIds.AddSummaryElementToDocumentationComment, title: "Add summary element to documentation comment", messageFormat: "Add summary element to documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddSummaryElementToDocumentationComment, + helpLinkUri: DiagnosticIds.AddSummaryElementToDocumentationComment, customTags: Array.Empty()); /// RCS1140 public static readonly DiagnosticDescriptor AddExceptionToDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddExceptionToDocumentationComment, + id: DiagnosticIds.AddExceptionToDocumentationComment, title: "Add exception to documentation comment", messageFormat: "Add exception to documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddExceptionToDocumentationComment, + helpLinkUri: DiagnosticIds.AddExceptionToDocumentationComment, customTags: Array.Empty()); /// RCS1141 public static readonly DiagnosticDescriptor AddParamElementToDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddParamElementToDocumentationComment, + id: DiagnosticIds.AddParamElementToDocumentationComment, title: "Add 'param' element to documentation comment", messageFormat: "Add 'param' element to documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddParamElementToDocumentationComment, + helpLinkUri: DiagnosticIds.AddParamElementToDocumentationComment, customTags: Array.Empty()); /// RCS1142 public static readonly DiagnosticDescriptor AddTypeParamElementToDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddTypeParamElementToDocumentationComment, + id: DiagnosticIds.AddTypeParamElementToDocumentationComment, title: "Add 'typeparam' element to documentation comment", messageFormat: "Add 'typeparam' element to documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddTypeParamElementToDocumentationComment, + helpLinkUri: DiagnosticIds.AddTypeParamElementToDocumentationComment, customTags: Array.Empty()); /// RCS1143 public static readonly DiagnosticDescriptor SimplifyCoalesceExpression = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyCoalesceExpression, + id: DiagnosticIds.SimplifyCoalesceExpression, title: "Simplify coalesce expression", messageFormat: "Simplify coalesce expression", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyCoalesceExpression, + helpLinkUri: DiagnosticIds.SimplifyCoalesceExpression, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1145 public static readonly DiagnosticDescriptor RemoveRedundantAsOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantAsOperator, + id: DiagnosticIds.RemoveRedundantAsOperator, title: "Remove redundant 'as' operator", messageFormat: "Remove redundant 'as' operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantAsOperator, + helpLinkUri: DiagnosticIds.RemoveRedundantAsOperator, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1146 public static readonly DiagnosticDescriptor UseConditionalAccess = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseConditionalAccess, + id: DiagnosticIds.UseConditionalAccess, title: "Use conditional access", messageFormat: "Use conditional access", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseConditionalAccess, + helpLinkUri: DiagnosticIds.UseConditionalAccess, customTags: Array.Empty()); /// RCS1151 public static readonly DiagnosticDescriptor RemoveRedundantCast = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantCast, + id: DiagnosticIds.RemoveRedundantCast, title: "Remove redundant cast", messageFormat: "Remove redundant cast", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantCast, + helpLinkUri: DiagnosticIds.RemoveRedundantCast, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1154 public static readonly DiagnosticDescriptor SortEnumMembers = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SortEnumMembers, + id: DiagnosticIds.SortEnumMembers, title: "Sort enum members", messageFormat: "Sort '{0}' members", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SortEnumMembers, + helpLinkUri: DiagnosticIds.SortEnumMembers, customTags: Array.Empty()); /// RCS1155 public static readonly DiagnosticDescriptor UseStringComparison = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseStringComparison, + id: DiagnosticIds.UseStringComparison, title: "Use StringComparison when comparing strings", messageFormat: "Use StringComparison when comparing strings", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseStringComparison, + helpLinkUri: DiagnosticIds.UseStringComparison, customTags: Array.Empty()); /// RCS1156 public static readonly DiagnosticDescriptor UseStringLengthInsteadOfComparisonWithEmptyString = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseStringLengthInsteadOfComparisonWithEmptyString, + id: DiagnosticIds.UseStringLengthInsteadOfComparisonWithEmptyString, title: "Use string.Length instead of comparison with empty string", messageFormat: "Use string.Length instead of comparison with empty string", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseStringLengthInsteadOfComparisonWithEmptyString, + helpLinkUri: DiagnosticIds.UseStringLengthInsteadOfComparisonWithEmptyString, customTags: Array.Empty()); /// RCS1157 public static readonly DiagnosticDescriptor CompositeEnumValueContainsUndefinedFlag = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.CompositeEnumValueContainsUndefinedFlag, + id: DiagnosticIds.CompositeEnumValueContainsUndefinedFlag, title: "Composite enum value contains undefined flag", messageFormat: "Composite enum value contains undefined flag {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.CompositeEnumValueContainsUndefinedFlag, + helpLinkUri: DiagnosticIds.CompositeEnumValueContainsUndefinedFlag, customTags: Array.Empty()); /// RCS1158 public static readonly DiagnosticDescriptor StaticMemberInGenericTypeShouldUseTypeParameter = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.StaticMemberInGenericTypeShouldUseTypeParameter, + id: DiagnosticIds.StaticMemberInGenericTypeShouldUseTypeParameter, title: "Static member in generic type should use a type parameter", messageFormat: "Static member in generic type should use a type parameter", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.StaticMemberInGenericTypeShouldUseTypeParameter, + helpLinkUri: DiagnosticIds.StaticMemberInGenericTypeShouldUseTypeParameter, customTags: Array.Empty()); /// RCS1159 public static readonly DiagnosticDescriptor UseGenericEventHandler = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseGenericEventHandler, + id: DiagnosticIds.UseGenericEventHandler, title: "Use EventHandler", messageFormat: "Use EventHandler", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseGenericEventHandler, + helpLinkUri: DiagnosticIds.UseGenericEventHandler, customTags: Array.Empty()); /// RCS1160 public static readonly DiagnosticDescriptor AbstractTypeShouldNotHavePublicConstructors = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AbstractTypeShouldNotHavePublicConstructors, + id: DiagnosticIds.AbstractTypeShouldNotHavePublicConstructors, title: "Abstract type should not have public constructors", messageFormat: "Abstract type should not have public constructors", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AbstractTypeShouldNotHavePublicConstructors, + helpLinkUri: DiagnosticIds.AbstractTypeShouldNotHavePublicConstructors, customTags: Array.Empty()); /// RCS1161 public static readonly DiagnosticDescriptor EnumShouldDeclareExplicitValues = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.EnumShouldDeclareExplicitValues, + id: DiagnosticIds.EnumShouldDeclareExplicitValues, title: "Enum should declare explicit values", messageFormat: "Enum should declare explicit values", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.EnumShouldDeclareExplicitValues, + helpLinkUri: DiagnosticIds.EnumShouldDeclareExplicitValues, customTags: Array.Empty()); /// RCS1162 public static readonly DiagnosticDescriptor AvoidChainOfAssignments = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidChainOfAssignments, + id: DiagnosticIds.AvoidChainOfAssignments, title: "Avoid chain of assignments", messageFormat: "Avoid chain of assignments", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidChainOfAssignments, + helpLinkUri: DiagnosticIds.AvoidChainOfAssignments, customTags: Array.Empty()); /// RCS1163 public static readonly DiagnosticDescriptor UnusedParameter = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnusedParameter, + id: DiagnosticIds.UnusedParameter, title: "Unused parameter", messageFormat: "Unused parameter '{0}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnusedParameter, + helpLinkUri: DiagnosticIds.UnusedParameter, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1164 public static readonly DiagnosticDescriptor UnusedTypeParameter = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnusedTypeParameter, + id: DiagnosticIds.UnusedTypeParameter, title: "Unused type parameter", messageFormat: "Unused type parameter '{0}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnusedTypeParameter, + helpLinkUri: DiagnosticIds.UnusedTypeParameter, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1165 public static readonly DiagnosticDescriptor UnconstrainedTypeParameterCheckedForNull = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnconstrainedTypeParameterCheckedForNull, + id: DiagnosticIds.UnconstrainedTypeParameterCheckedForNull, title: "Unconstrained type parameter checked for null", messageFormat: "Unconstrained type parameter checked for null", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnconstrainedTypeParameterCheckedForNull, + helpLinkUri: DiagnosticIds.UnconstrainedTypeParameterCheckedForNull, customTags: Array.Empty()); /// RCS1166 public static readonly DiagnosticDescriptor ValueTypeObjectIsNeverEqualToNull = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ValueTypeObjectIsNeverEqualToNull, + id: DiagnosticIds.ValueTypeObjectIsNeverEqualToNull, title: "Value type object is never equal to null", messageFormat: "Value type object is never equal to null", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ValueTypeObjectIsNeverEqualToNull, + helpLinkUri: DiagnosticIds.ValueTypeObjectIsNeverEqualToNull, customTags: Array.Empty()); /// RCS1168 public static readonly DiagnosticDescriptor ParameterNameDiffersFromBase = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ParameterNameDiffersFromBase, + id: DiagnosticIds.ParameterNameDiffersFromBase, title: "Parameter name differs from base name", messageFormat: "Parameter name '{0}' differs from base name '{1}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ParameterNameDiffersFromBase, + helpLinkUri: DiagnosticIds.ParameterNameDiffersFromBase, customTags: Array.Empty()); /// RCS1169 public static readonly DiagnosticDescriptor MakeFieldReadOnly = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MakeFieldReadOnly, + id: DiagnosticIds.MakeFieldReadOnly, title: "Make field read-only", messageFormat: "Make field read-only", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MakeFieldReadOnly, + helpLinkUri: DiagnosticIds.MakeFieldReadOnly, customTags: Array.Empty()); /// RCS1170 public static readonly DiagnosticDescriptor UseReadOnlyAutoProperty = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseReadOnlyAutoProperty, + id: DiagnosticIds.UseReadOnlyAutoProperty, title: "Use read-only auto-implemented property", messageFormat: "Use read-only auto-implemented property", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseReadOnlyAutoProperty, + helpLinkUri: DiagnosticIds.UseReadOnlyAutoProperty, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1171 public static readonly DiagnosticDescriptor SimplifyLazyInitialization = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyLazyInitialization, + id: DiagnosticIds.SimplifyLazyInitialization, title: "Simplify lazy initialization", messageFormat: "Simplify lazy initialization", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyLazyInitialization, + helpLinkUri: DiagnosticIds.SimplifyLazyInitialization, customTags: Array.Empty()); /// RCS1172 public static readonly DiagnosticDescriptor UseIsOperatorInsteadOfAsOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseIsOperatorInsteadOfAsOperator, + id: DiagnosticIds.UseIsOperatorInsteadOfAsOperator, title: "Use 'is' operator instead of 'as' operator", messageFormat: "Use 'is' operator instead of 'as' operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseIsOperatorInsteadOfAsOperator, + helpLinkUri: DiagnosticIds.UseIsOperatorInsteadOfAsOperator, customTags: Array.Empty()); /// RCS1173 public static readonly DiagnosticDescriptor UseCoalesceExpressionInsteadOfIf = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf, + id: DiagnosticIds.UseCoalesceExpressionInsteadOfIf, title: "Use coalesce expression instead of 'if'", messageFormat: "Use coalesce expression instead of 'if'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf, + helpLinkUri: DiagnosticIds.UseCoalesceExpressionInsteadOfIf, customTags: Array.Empty()); /// RCS1174 public static readonly DiagnosticDescriptor RemoveRedundantAsyncAwait = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantAsyncAwait, + id: DiagnosticIds.RemoveRedundantAsyncAwait, title: "Remove redundant async/await", messageFormat: "Remove redundant async/await", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantAsyncAwait, + helpLinkUri: DiagnosticIds.RemoveRedundantAsyncAwait, customTags: Array.Empty()); public static readonly DiagnosticDescriptor RemoveRedundantAsyncAwaitFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveRedundantAsyncAwait); /// RCS1175 public static readonly DiagnosticDescriptor UnusedThisParameter = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnusedThisParameter, + id: DiagnosticIds.UnusedThisParameter, title: "Unused 'this' parameter", messageFormat: "Unused 'this' parameter '{0}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnusedThisParameter, + helpLinkUri: DiagnosticIds.UnusedThisParameter, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1176 public static readonly DiagnosticDescriptor UseVarInsteadOfExplicitTypeWhenTypeIsNotObvious = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeWhenTypeIsNotObvious, + id: DiagnosticIds.UseVarInsteadOfExplicitTypeWhenTypeIsNotObvious, title: "[deprecated] Use 'var' instead of explicit type (when the type is not obvious)", messageFormat: "([deprecated] Use RCS1264 instead) Use 'var' instead of explicit type", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeWhenTypeIsNotObvious, + helpLinkUri: DiagnosticIds.UseVarInsteadOfExplicitTypeWhenTypeIsNotObvious, customTags: Array.Empty()); /// RCS1177 public static readonly DiagnosticDescriptor UseVarInsteadOfExplicitTypeInForEach = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeInForEach, + id: DiagnosticIds.UseVarInsteadOfExplicitTypeInForEach, title: "[deprecated] Use 'var' instead of explicit type (in foreach)", messageFormat: "([deprecated] Use RCS1264 instead) Use 'var' instead of explicit type", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseVarInsteadOfExplicitTypeInForEach, + helpLinkUri: DiagnosticIds.UseVarInsteadOfExplicitTypeInForEach, customTags: Array.Empty()); /// RCS1179 public static readonly DiagnosticDescriptor UnnecessaryAssignment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryAssignment, + id: DiagnosticIds.UnnecessaryAssignment, title: "Unnecessary assignment", messageFormat: "Unnecessary assignment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryAssignment, + helpLinkUri: DiagnosticIds.UnnecessaryAssignment, customTags: Array.Empty()); /// RCS1180 public static readonly DiagnosticDescriptor InlineLazyInitialization = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.InlineLazyInitialization, + id: DiagnosticIds.InlineLazyInitialization, title: "Inline lazy initialization", messageFormat: "Inline lazy initialization", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.InlineLazyInitialization, + helpLinkUri: DiagnosticIds.InlineLazyInitialization, customTags: Array.Empty()); /// RCS1181 public static readonly DiagnosticDescriptor ConvertCommentToDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ConvertCommentToDocumentationComment, + id: DiagnosticIds.ConvertCommentToDocumentationComment, title: "Convert comment to documentation comment", messageFormat: "Convert comment to documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ConvertCommentToDocumentationComment, + helpLinkUri: DiagnosticIds.ConvertCommentToDocumentationComment, customTags: Array.Empty()); /// RCS1182 public static readonly DiagnosticDescriptor RemoveRedundantBaseInterface = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantBaseInterface, + id: DiagnosticIds.RemoveRedundantBaseInterface, title: "Remove redundant base interface", messageFormat: "Interface '{0}' is already implemented by '{1}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantBaseInterface, + helpLinkUri: DiagnosticIds.RemoveRedundantBaseInterface, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1186 public static readonly DiagnosticDescriptor UseRegexInstanceInsteadOfStaticMethod = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod, + id: DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod, title: "Use Regex instance instead of static method", messageFormat: "Use Regex instance instead of static method", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod, + helpLinkUri: DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod, customTags: Array.Empty()); /// RCS1187 public static readonly DiagnosticDescriptor UseConstantInsteadOfField = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseConstantInsteadOfField, + id: DiagnosticIds.UseConstantInsteadOfField, title: "Use constant instead of field", messageFormat: "Use constant instead of field", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseConstantInsteadOfField, + helpLinkUri: DiagnosticIds.UseConstantInsteadOfField, customTags: Array.Empty()); /// RCS1188 public static readonly DiagnosticDescriptor RemoveRedundantAutoPropertyInitialization = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization, + id: DiagnosticIds.RemoveRedundantAutoPropertyInitialization, title: "Remove redundant auto-property initialization", messageFormat: "Remove redundant auto-property initialization", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization, + helpLinkUri: DiagnosticIds.RemoveRedundantAutoPropertyInitialization, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1189 public static readonly DiagnosticDescriptor AddOrRemoveRegionName = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddOrRemoveRegionName, + id: DiagnosticIds.AddOrRemoveRegionName, title: "Add or remove region name", messageFormat: "{0} region name {1} #endregion", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddOrRemoveRegionName, + helpLinkUri: DiagnosticIds.AddOrRemoveRegionName, customTags: Array.Empty()); /// RCS1190 public static readonly DiagnosticDescriptor JoinStringExpressions = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.JoinStringExpressions, + id: DiagnosticIds.JoinStringExpressions, title: "Join string expressions", messageFormat: "Join string expressions", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.JoinStringExpressions, + helpLinkUri: DiagnosticIds.JoinStringExpressions, customTags: Array.Empty()); /// RCS1191 public static readonly DiagnosticDescriptor DeclareEnumValueAsCombinationOfNames = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames, + id: DiagnosticIds.DeclareEnumValueAsCombinationOfNames, title: "Declare enum value as combination of names", messageFormat: "Declare enum value as combination of names", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames, + helpLinkUri: DiagnosticIds.DeclareEnumValueAsCombinationOfNames, customTags: Array.Empty()); /// RCS1192 public static readonly DiagnosticDescriptor UnnecessaryUsageOfVerbatimStringLiteral = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral, + id: DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral, title: "Unnecessary usage of verbatim string literal", messageFormat: "Unnecessary usage of verbatim string literal", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral, + helpLinkUri: DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1193 public static readonly DiagnosticDescriptor OverridingMemberShouldNotChangeParamsModifier = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.OverridingMemberShouldNotChangeParamsModifier, + id: DiagnosticIds.OverridingMemberShouldNotChangeParamsModifier, title: "Overriding member should not change 'params' modifier", messageFormat: "Overriding member should not change 'params' modifier", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.OverridingMemberShouldNotChangeParamsModifier, + helpLinkUri: DiagnosticIds.OverridingMemberShouldNotChangeParamsModifier, customTags: Array.Empty()); /// RCS1194 public static readonly DiagnosticDescriptor ImplementExceptionConstructors = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ImplementExceptionConstructors, + id: DiagnosticIds.ImplementExceptionConstructors, title: "Implement exception constructors", messageFormat: "Implement exception constructors", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ImplementExceptionConstructors, + helpLinkUri: DiagnosticIds.ImplementExceptionConstructors, customTags: Array.Empty()); /// RCS1195 public static readonly DiagnosticDescriptor UseExclusiveOrOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseExclusiveOrOperator, + id: DiagnosticIds.UseExclusiveOrOperator, title: "Use ^ operator", messageFormat: "Use ^ operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseExclusiveOrOperator, + helpLinkUri: DiagnosticIds.UseExclusiveOrOperator, customTags: Array.Empty()); /// RCS1196 public static readonly DiagnosticDescriptor CallExtensionMethodAsInstanceMethod = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.CallExtensionMethodAsInstanceMethod, + id: DiagnosticIds.CallExtensionMethodAsInstanceMethod, title: "Call extension method as instance method", messageFormat: "Call extension method as instance method", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.CallExtensionMethodAsInstanceMethod, + helpLinkUri: DiagnosticIds.CallExtensionMethodAsInstanceMethod, customTags: Array.Empty()); /// RCS1197 public static readonly DiagnosticDescriptor OptimizeStringBuilderAppendCall = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.OptimizeStringBuilderAppendCall, + id: DiagnosticIds.OptimizeStringBuilderAppendCall, title: "Optimize StringBuilder.Append/AppendLine call", messageFormat: "Optimize StringBuilder.{0} call", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.OptimizeStringBuilderAppendCall, + helpLinkUri: DiagnosticIds.OptimizeStringBuilderAppendCall, customTags: Array.Empty()); /// RCS1198 public static readonly DiagnosticDescriptor AvoidBoxingOfValueType = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidBoxingOfValueType, + id: DiagnosticIds.AvoidBoxingOfValueType, title: "Avoid unnecessary boxing of value type", messageFormat: "Avoid unnecessary boxing of value type", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidBoxingOfValueType, + helpLinkUri: DiagnosticIds.AvoidBoxingOfValueType, customTags: Array.Empty()); /// RCS1199 public static readonly DiagnosticDescriptor UnnecessaryNullCheck = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryNullCheck, + id: DiagnosticIds.UnnecessaryNullCheck, title: "Unnecessary null check", messageFormat: "Unnecessary null check", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryNullCheck, + helpLinkUri: DiagnosticIds.UnnecessaryNullCheck, customTags: Array.Empty()); /// RCS1200 public static readonly DiagnosticDescriptor CallThenByInsteadOfOrderBy = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.CallThenByInsteadOfOrderBy, + id: DiagnosticIds.CallThenByInsteadOfOrderBy, title: "Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy'", messageFormat: "Call 'Enumerable.ThenBy{0}' instead of 'Enumerable.OrderBy{0}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.CallThenByInsteadOfOrderBy, + helpLinkUri: DiagnosticIds.CallThenByInsteadOfOrderBy, customTags: Array.Empty()); /// RCS1201 public static readonly DiagnosticDescriptor UseMethodChaining = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseMethodChaining, + id: DiagnosticIds.UseMethodChaining, title: "Use method chaining", messageFormat: "Use method chaining", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseMethodChaining, + helpLinkUri: DiagnosticIds.UseMethodChaining, customTags: Array.Empty()); /// RCS1202 public static readonly DiagnosticDescriptor AvoidNullReferenceException = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidNullReferenceException, + id: DiagnosticIds.AvoidNullReferenceException, title: "Avoid NullReferenceException", messageFormat: "Avoid NullReferenceException", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidNullReferenceException, + helpLinkUri: DiagnosticIds.AvoidNullReferenceException, customTags: Array.Empty()); /// RCS1203 public static readonly DiagnosticDescriptor UseAttributeUsageAttribute = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseAttributeUsageAttribute, + id: DiagnosticIds.UseAttributeUsageAttribute, title: "Use AttributeUsageAttribute", messageFormat: "Use AttributeUsageAttribute", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseAttributeUsageAttribute, + helpLinkUri: DiagnosticIds.UseAttributeUsageAttribute, customTags: Array.Empty()); /// RCS1204 public static readonly DiagnosticDescriptor UseEventArgsEmpty = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseEventArgsEmpty, + id: DiagnosticIds.UseEventArgsEmpty, title: "Use EventArgs.Empty", messageFormat: "Use EventArgs.Empty", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseEventArgsEmpty, + helpLinkUri: DiagnosticIds.UseEventArgsEmpty, customTags: Array.Empty()); /// RCS1205 public static readonly DiagnosticDescriptor OrderNamedArguments = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.OrderNamedArguments, + id: DiagnosticIds.OrderNamedArguments, title: "Order named arguments according to the order of parameters", messageFormat: "Order named arguments according to the order of parameters", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.OrderNamedArguments, + helpLinkUri: DiagnosticIds.OrderNamedArguments, customTags: Array.Empty()); /// RCS1206 public static readonly DiagnosticDescriptor UseConditionalAccessInsteadOfConditionalExpression = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseConditionalAccessInsteadOfConditionalExpression, + id: DiagnosticIds.UseConditionalAccessInsteadOfConditionalExpression, title: "Use conditional access instead of conditional expression", messageFormat: "Use conditional access instead of conditional expression", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseConditionalAccessInsteadOfConditionalExpression, + helpLinkUri: DiagnosticIds.UseConditionalAccessInsteadOfConditionalExpression, customTags: Array.Empty()); /// RCS1207 public static readonly DiagnosticDescriptor UseAnonymousFunctionOrMethodGroup = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup, + id: DiagnosticIds.UseAnonymousFunctionOrMethodGroup, title: "Use anonymous function or method group", messageFormat: "Use {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup, + helpLinkUri: DiagnosticIds.UseAnonymousFunctionOrMethodGroup, customTags: Array.Empty()); /// RCS1208 public static readonly DiagnosticDescriptor ReduceIfNesting = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ReduceIfNesting, + id: DiagnosticIds.ReduceIfNesting, title: "Reduce 'if' nesting", messageFormat: "Reduce 'if' nesting", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.ReduceIfNesting, + helpLinkUri: DiagnosticIds.ReduceIfNesting, customTags: Array.Empty()); /// RCS1209 public static readonly DiagnosticDescriptor OrderTypeParameterConstraints = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.OrderTypeParameterConstraints, + id: DiagnosticIds.OrderTypeParameterConstraints, title: "Order type parameter constraints", messageFormat: "Order type parameter constraints", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.OrderTypeParameterConstraints, + helpLinkUri: DiagnosticIds.OrderTypeParameterConstraints, customTags: Array.Empty()); /// RCS1210 public static readonly DiagnosticDescriptor ReturnCompletedTaskInsteadOfNull = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ReturnCompletedTaskInsteadOfNull, + id: DiagnosticIds.ReturnCompletedTaskInsteadOfNull, title: "Return completed task instead of returning null", messageFormat: "Return completed task instead of returning null", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ReturnCompletedTaskInsteadOfNull, + helpLinkUri: DiagnosticIds.ReturnCompletedTaskInsteadOfNull, customTags: Array.Empty()); /// RCS1211 public static readonly DiagnosticDescriptor RemoveUnnecessaryElse = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveUnnecessaryElse, + id: DiagnosticIds.RemoveUnnecessaryElse, title: "Remove unnecessary 'else'", messageFormat: "Remove unnecessary else clause", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveUnnecessaryElse, + helpLinkUri: DiagnosticIds.RemoveUnnecessaryElse, customTags: Array.Empty()); /// RCS1212 public static readonly DiagnosticDescriptor RemoveRedundantAssignment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantAssignment, + id: DiagnosticIds.RemoveRedundantAssignment, title: "Remove redundant assignment", messageFormat: "Remove redundant assignment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantAssignment, + helpLinkUri: DiagnosticIds.RemoveRedundantAssignment, customTags: Array.Empty()); public static readonly DiagnosticDescriptor RemoveRedundantAssignmentFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(RemoveRedundantAssignment); /// RCS1213 public static readonly DiagnosticDescriptor RemoveUnusedMemberDeclaration = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveUnusedMemberDeclaration, + id: DiagnosticIds.RemoveUnusedMemberDeclaration, title: "Remove unused member declaration", messageFormat: "Remove unused {0} declaration", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveUnusedMemberDeclaration, + helpLinkUri: DiagnosticIds.RemoveUnusedMemberDeclaration, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1214 public static readonly DiagnosticDescriptor UnnecessaryInterpolatedString = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryInterpolatedString, + id: DiagnosticIds.UnnecessaryInterpolatedString, title: "Unnecessary interpolated string", messageFormat: "Unnecessary interpolated string", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryInterpolatedString, + helpLinkUri: DiagnosticIds.UnnecessaryInterpolatedString, customTags: Array.Empty()); public static readonly DiagnosticDescriptor UnnecessaryInterpolatedStringFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(UnnecessaryInterpolatedString); /// RCS1215 public static readonly DiagnosticDescriptor ExpressionIsAlwaysEqualToTrueOrFalse = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse, + id: DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse, title: "Expression is always equal to true/false", messageFormat: "Expression is always equal to '{0}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse, + helpLinkUri: DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse, customTags: Array.Empty()); /// RCS1216 public static readonly DiagnosticDescriptor UnnecessaryUnsafeContext = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryUnsafeContext, + id: DiagnosticIds.UnnecessaryUnsafeContext, title: "Unnecessary unsafe context", messageFormat: "Unnecessary unsafe context", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryUnsafeContext, + helpLinkUri: DiagnosticIds.UnnecessaryUnsafeContext, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1217 public static readonly DiagnosticDescriptor ConvertInterpolatedStringToConcatenation = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ConvertInterpolatedStringToConcatenation, + id: DiagnosticIds.ConvertInterpolatedStringToConcatenation, title: "Convert interpolated string to concatenation", messageFormat: "Convert interpolated string to concatenation", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ConvertInterpolatedStringToConcatenation, + helpLinkUri: DiagnosticIds.ConvertInterpolatedStringToConcatenation, customTags: Array.Empty()); public static readonly DiagnosticDescriptor ConvertInterpolatedStringToConcatenationFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(ConvertInterpolatedStringToConcatenation); /// RCS1218 public static readonly DiagnosticDescriptor SimplifyCodeBranching = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyCodeBranching, + id: DiagnosticIds.SimplifyCodeBranching, title: "Simplify code branching", messageFormat: "Simplify code branching", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyCodeBranching, + helpLinkUri: DiagnosticIds.SimplifyCodeBranching, customTags: Array.Empty()); /// RCS1220 public static readonly DiagnosticDescriptor UsePatternMatchingInsteadOfIsAndCast = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast, + id: DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast, title: "Use pattern matching instead of combination of 'is' operator and cast operator", messageFormat: "Use pattern matching instead of combination of 'is' operator and cast operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast, + helpLinkUri: DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast, customTags: Array.Empty()); /// RCS1221 public static readonly DiagnosticDescriptor UsePatternMatchingInsteadOfAsAndNullCheck = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck, + id: DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck, title: "Use pattern matching instead of combination of 'as' operator and null check", messageFormat: "Use pattern matching instead of combination of 'as' operator and null check", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck, + helpLinkUri: DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck, customTags: Array.Empty()); /// RCS1222 public static readonly DiagnosticDescriptor MergePreprocessorDirectives = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MergePreprocessorDirectives, + id: DiagnosticIds.MergePreprocessorDirectives, title: "Merge preprocessor directives", messageFormat: "Merge preprocessor directives", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MergePreprocessorDirectives, + helpLinkUri: DiagnosticIds.MergePreprocessorDirectives, customTags: Array.Empty()); /// RCS1223 public static readonly DiagnosticDescriptor MarkTypeWithDebuggerDisplayAttribute = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute, + id: DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute, title: "Mark publicly visible type with DebuggerDisplay attribute", messageFormat: "Mark '{0}' with DebuggerDisplay attribute", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute, + helpLinkUri: DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute, customTags: Array.Empty()); /// RCS1224 public static readonly DiagnosticDescriptor MakeMethodExtensionMethod = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MakeMethodExtensionMethod, + id: DiagnosticIds.MakeMethodExtensionMethod, title: "Make method an extension method", messageFormat: "Make method an extension method", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MakeMethodExtensionMethod, + helpLinkUri: DiagnosticIds.MakeMethodExtensionMethod, customTags: Array.Empty()); /// RCS1225 public static readonly DiagnosticDescriptor MakeClassSealed = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MakeClassSealed, + id: DiagnosticIds.MakeClassSealed, title: "Make class sealed", messageFormat: "Make class sealed", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.MakeClassSealed, + helpLinkUri: DiagnosticIds.MakeClassSealed, customTags: Array.Empty()); /// RCS1226 public static readonly DiagnosticDescriptor AddParagraphToDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddParagraphToDocumentationComment, + id: DiagnosticIds.AddParagraphToDocumentationComment, title: "Add paragraph to documentation comment", messageFormat: "Add paragraph to documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AddParagraphToDocumentationComment, + helpLinkUri: DiagnosticIds.AddParagraphToDocumentationComment, customTags: Array.Empty()); /// RCS1227 public static readonly DiagnosticDescriptor ValidateArgumentsCorrectly = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ValidateArgumentsCorrectly, + id: DiagnosticIds.ValidateArgumentsCorrectly, title: "Validate arguments correctly", messageFormat: "Validate arguments correctly", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ValidateArgumentsCorrectly, + helpLinkUri: DiagnosticIds.ValidateArgumentsCorrectly, customTags: Array.Empty()); /// RCS1228 public static readonly DiagnosticDescriptor UnusedElementInDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnusedElementInDocumentationComment, + id: DiagnosticIds.UnusedElementInDocumentationComment, title: "Unused element in a documentation comment", messageFormat: "Unused '{0}' element in a documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnusedElementInDocumentationComment, + helpLinkUri: DiagnosticIds.UnusedElementInDocumentationComment, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1229 public static readonly DiagnosticDescriptor UseAsyncAwait = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseAsyncAwait, + id: DiagnosticIds.UseAsyncAwait, title: "Use async/await when necessary", messageFormat: "Use async/await when necessary", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseAsyncAwait, + helpLinkUri: DiagnosticIds.UseAsyncAwait, customTags: Array.Empty()); /// RCS1230 public static readonly DiagnosticDescriptor UnnecessaryExplicitUseOfEnumerator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator, + id: DiagnosticIds.UnnecessaryExplicitUseOfEnumerator, title: "Unnecessary explicit use of enumerator", messageFormat: "Unnecessary explicit use of enumerator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator, + helpLinkUri: DiagnosticIds.UnnecessaryExplicitUseOfEnumerator, customTags: Array.Empty()); /// RCS1231 public static readonly DiagnosticDescriptor MakeParameterRefReadOnly = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.MakeParameterRefReadOnly, + id: DiagnosticIds.MakeParameterRefReadOnly, title: "Make parameter ref read-only", messageFormat: "Make parameter ref read-only", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.MakeParameterRefReadOnly, + helpLinkUri: DiagnosticIds.MakeParameterRefReadOnly, customTags: Array.Empty()); /// RCS1232 public static readonly DiagnosticDescriptor OrderElementsInDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.OrderElementsInDocumentationComment, + id: DiagnosticIds.OrderElementsInDocumentationComment, title: "Order elements in documentation comment", messageFormat: "Order elements in documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.OrderElementsInDocumentationComment, + helpLinkUri: DiagnosticIds.OrderElementsInDocumentationComment, customTags: Array.Empty()); /// RCS1233 public static readonly DiagnosticDescriptor UseShortCircuitingOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseShortCircuitingOperator, + id: DiagnosticIds.UseShortCircuitingOperator, title: "Use short-circuiting operator", messageFormat: "Use short-circuiting operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseShortCircuitingOperator, + helpLinkUri: DiagnosticIds.UseShortCircuitingOperator, customTags: Array.Empty()); /// RCS1234 public static readonly DiagnosticDescriptor DuplicateEnumValue = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DuplicateEnumValue, + id: DiagnosticIds.DuplicateEnumValue, title: "Duplicate enum value", messageFormat: "Duplicate enum value", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.DuplicateEnumValue, + helpLinkUri: DiagnosticIds.DuplicateEnumValue, customTags: Array.Empty()); /// RCS1235 public static readonly DiagnosticDescriptor OptimizeMethodCall = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.OptimizeMethodCall, + id: DiagnosticIds.OptimizeMethodCall, title: "Optimize method call", messageFormat: "Optimize '{0}' call", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.OptimizeMethodCall, + helpLinkUri: DiagnosticIds.OptimizeMethodCall, customTags: Array.Empty()); /// RCS1236 public static readonly DiagnosticDescriptor UseExceptionFilter = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseExceptionFilter, + id: DiagnosticIds.UseExceptionFilter, title: "Use exception filter", messageFormat: "Use exception filter", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseExceptionFilter, + helpLinkUri: DiagnosticIds.UseExceptionFilter, customTags: Array.Empty()); /// RCS1237 public static readonly DiagnosticDescriptor UseBitShiftOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseBitShiftOperator, + id: DiagnosticIds.UseBitShiftOperator, title: "[deprecated] Use bit shift operator", messageFormat: "([deprecated] Use RCS1254 instead) Use bit shift operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseBitShiftOperator, + helpLinkUri: DiagnosticIds.UseBitShiftOperator, customTags: Array.Empty()); /// RCS1238 public static readonly DiagnosticDescriptor AvoidNestedConditionalOperators = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AvoidNestedConditionalOperators, + id: DiagnosticIds.AvoidNestedConditionalOperators, title: "Avoid nested ?: operators", messageFormat: "Avoid nested ?: operators", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.AvoidNestedConditionalOperators, + helpLinkUri: DiagnosticIds.AvoidNestedConditionalOperators, customTags: Array.Empty()); /// RCS1239 public static readonly DiagnosticDescriptor UseForStatementInsteadOfWhileStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement, + id: DiagnosticIds.UseForStatementInsteadOfWhileStatement, title: "Use 'for' statement instead of 'while' statement", messageFormat: "Use 'for' statement instead of 'while' statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement, + helpLinkUri: DiagnosticIds.UseForStatementInsteadOfWhileStatement, customTags: Array.Empty()); /// RCS1240 public static readonly DiagnosticDescriptor UnnecessaryOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryOperator, + id: DiagnosticIds.UnnecessaryOperator, title: "Operator is unnecessary", messageFormat: "The '{0}' operator is unnecessary", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryOperator, + helpLinkUri: DiagnosticIds.UnnecessaryOperator, customTags: Array.Empty()); /// RCS1241 public static readonly DiagnosticDescriptor ImplementNonGenericCounterpart = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.ImplementNonGenericCounterpart, + id: DiagnosticIds.ImplementNonGenericCounterpart, title: "Implement non-generic counterpart", messageFormat: "Implement {0} when implementing {1}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.ImplementNonGenericCounterpart, + helpLinkUri: DiagnosticIds.ImplementNonGenericCounterpart, customTags: Array.Empty()); /// RCS1242 public static readonly DiagnosticDescriptor DoNotPassNonReadOnlyStructByReadOnlyReference = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DoNotPassNonReadOnlyStructByReadOnlyReference, + id: DiagnosticIds.DoNotPassNonReadOnlyStructByReadOnlyReference, title: "Do not pass non-read-only struct by read-only reference", messageFormat: "Do not pass non-read-only struct by read-only reference", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.DoNotPassNonReadOnlyStructByReadOnlyReference, + helpLinkUri: DiagnosticIds.DoNotPassNonReadOnlyStructByReadOnlyReference, customTags: Array.Empty()); /// RCS1243 public static readonly DiagnosticDescriptor DuplicateWordInComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DuplicateWordInComment, + id: DiagnosticIds.DuplicateWordInComment, title: "Duplicate word in a comment", messageFormat: "Duplicate word in a comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.DuplicateWordInComment, + helpLinkUri: DiagnosticIds.DuplicateWordInComment, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1244 public static readonly DiagnosticDescriptor SimplifyDefaultExpression = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyDefaultExpression, + id: DiagnosticIds.SimplifyDefaultExpression, title: "Simplify 'default' expression", messageFormat: "Simplify 'default' expression", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyDefaultExpression, + helpLinkUri: DiagnosticIds.SimplifyDefaultExpression, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1246 public static readonly DiagnosticDescriptor UseElementAccess = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseElementAccess, + id: DiagnosticIds.UseElementAccess, title: "Use element access", messageFormat: "Use element access", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseElementAccess, + helpLinkUri: DiagnosticIds.UseElementAccess, customTags: Array.Empty()); /// RCS1247 public static readonly DiagnosticDescriptor FixDocumentationCommentTag = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FixDocumentationCommentTag, + id: DiagnosticIds.FixDocumentationCommentTag, title: "Fix documentation comment tag", messageFormat: "Fix documentation comment tag", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.FixDocumentationCommentTag, + helpLinkUri: DiagnosticIds.FixDocumentationCommentTag, customTags: Array.Empty()); /// RCS1248 public static readonly DiagnosticDescriptor NormalizeNullCheck = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.NormalizeNullCheck, + id: DiagnosticIds.NormalizeNullCheck, title: "Normalize null check", messageFormat: "Use {0} to check for null", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.NormalizeNullCheck, + helpLinkUri: DiagnosticIds.NormalizeNullCheck, customTags: Array.Empty()); /// RCS1249 public static readonly DiagnosticDescriptor UnnecessaryNullForgivingOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryNullForgivingOperator, + id: DiagnosticIds.UnnecessaryNullForgivingOperator, title: "Unnecessary null-forgiving operator", messageFormat: "Unnecessary null-forgiving operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryNullForgivingOperator, + helpLinkUri: DiagnosticIds.UnnecessaryNullForgivingOperator, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1250 public static readonly DiagnosticDescriptor UseImplicitOrExplicitObjectCreation = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation, + id: DiagnosticIds.UseImplicitOrExplicitObjectCreation, title: "Use implicit/explicit object creation", messageFormat: "{0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation, + helpLinkUri: DiagnosticIds.UseImplicitOrExplicitObjectCreation, customTags: Array.Empty()); /// RCS1251 public static readonly DiagnosticDescriptor RemoveUnnecessaryBraces = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveUnnecessaryBraces, + id: DiagnosticIds.RemoveUnnecessaryBraces, title: "Remove unnecessary braces from record declaration", messageFormat: "Remove unnecessary braces", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveUnnecessaryBraces, + helpLinkUri: DiagnosticIds.RemoveUnnecessaryBraces, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1252 public static readonly DiagnosticDescriptor NormalizeUsageOfInfiniteLoop = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop, + id: DiagnosticIds.NormalizeUsageOfInfiniteLoop, title: "Normalize usage of infinite loop", messageFormat: "Use '{0}' statement as an infinite loop", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop, + helpLinkUri: DiagnosticIds.NormalizeUsageOfInfiniteLoop, customTags: Array.Empty()); /// RCS1253 public static readonly DiagnosticDescriptor FormatDocumentationCommentSummary = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FormatDocumentationCommentSummary, + id: DiagnosticIds.FormatDocumentationCommentSummary, title: "Format documentation comment summary", messageFormat: "Format documentation comment summary", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FormatDocumentationCommentSummary, + helpLinkUri: DiagnosticIds.FormatDocumentationCommentSummary, customTags: Array.Empty()); /// RCS1254 public static readonly DiagnosticDescriptor NormalizeFormatOfEnumFlagValue = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue, + id: DiagnosticIds.NormalizeFormatOfEnumFlagValue, title: "Normalize format of enum flag value", messageFormat: "{0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue, + helpLinkUri: DiagnosticIds.NormalizeFormatOfEnumFlagValue, customTags: Array.Empty()); /// RCS1255 public static readonly DiagnosticDescriptor SimplifyArgumentNullCheck = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyArgumentNullCheck, + id: DiagnosticIds.SimplifyArgumentNullCheck, title: "Simplify argument null check", messageFormat: "Simplify argument null check", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyArgumentNullCheck, + helpLinkUri: DiagnosticIds.SimplifyArgumentNullCheck, customTags: Array.Empty()); /// RCS1256 public static readonly DiagnosticDescriptor InvalidArgumentNullCheck = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.InvalidArgumentNullCheck, + id: DiagnosticIds.InvalidArgumentNullCheck, title: "Invalid argument null check", messageFormat: "Invalid argument null check", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.InvalidArgumentNullCheck, + helpLinkUri: DiagnosticIds.InvalidArgumentNullCheck, customTags: Array.Empty()); /// RCS1257 public static readonly DiagnosticDescriptor UseEnumFieldExplicitly = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseEnumFieldExplicitly, + id: DiagnosticIds.UseEnumFieldExplicitly, title: "Use enum field explicitly", messageFormat: "Use enum field explicitly", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseEnumFieldExplicitly, + helpLinkUri: DiagnosticIds.UseEnumFieldExplicitly, customTags: Array.Empty()); /// RCS1258 public static readonly DiagnosticDescriptor UnnecessaryEnumFlag = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryEnumFlag, + id: DiagnosticIds.UnnecessaryEnumFlag, title: "Unnecessary enum flag", messageFormat: "Enum flag '{0}' is already contained in flag '{1}'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryEnumFlag, + helpLinkUri: DiagnosticIds.UnnecessaryEnumFlag, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1259 public static readonly DiagnosticDescriptor RemoveEmptySyntax = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveEmptySyntax, + id: DiagnosticIds.RemoveEmptySyntax, title: "Remove empty syntax", messageFormat: "Remove empty {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveEmptySyntax, + helpLinkUri: DiagnosticIds.RemoveEmptySyntax, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1260 public static readonly DiagnosticDescriptor AddOrRemoveTrailingComma = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddOrRemoveTrailingComma, + id: DiagnosticIds.AddOrRemoveTrailingComma, title: "Add/remove trailing comma", messageFormat: "{0} trailing comma", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddOrRemoveTrailingComma, + helpLinkUri: DiagnosticIds.AddOrRemoveTrailingComma, customTags: Array.Empty()); /// RCS1261 public static readonly DiagnosticDescriptor DisposeResourceAsynchronously = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.DisposeResourceAsynchronously, + id: DiagnosticIds.DisposeResourceAsynchronously, title: "Resource can be disposed asynchronously", messageFormat: "Resource can be disposed asynchronously", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.DisposeResourceAsynchronously, + helpLinkUri: DiagnosticIds.DisposeResourceAsynchronously, customTags: Array.Empty()); /// RCS1262 public static readonly DiagnosticDescriptor UnnecessaryRawStringLiteral = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryRawStringLiteral, + id: DiagnosticIds.UnnecessaryRawStringLiteral, title: "Unnecessary raw string literal", messageFormat: "Unnecessary raw string literal", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryRawStringLiteral, + helpLinkUri: DiagnosticIds.UnnecessaryRawStringLiteral, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS1263 public static readonly DiagnosticDescriptor InvalidReferenceInDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.InvalidReferenceInDocumentationComment, + id: DiagnosticIds.InvalidReferenceInDocumentationComment, title: "Invalid reference in a documentation comment", messageFormat: "{0} '{1}' could not be found", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.InvalidReferenceInDocumentationComment, + helpLinkUri: DiagnosticIds.InvalidReferenceInDocumentationComment, customTags: Array.Empty()); /// RCS1264 public static readonly DiagnosticDescriptor UseVarOrExplicitType = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseVarOrExplicitType, + id: DiagnosticIds.UseVarOrExplicitType, title: "Use 'var' or explicit type", messageFormat: "{0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseVarOrExplicitType, + helpLinkUri: DiagnosticIds.UseVarOrExplicitType, customTags: Array.Empty()); /// RCS1265 public static readonly DiagnosticDescriptor RemoveRedundantCatchBlock = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveRedundantCatchBlock, + id: DiagnosticIds.RemoveRedundantCatchBlock, title: "Remove redundant catch block", messageFormat: "Remove redundant catch block", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveRedundantCatchBlock, + helpLinkUri: DiagnosticIds.RemoveRedundantCatchBlock, customTags: Array.Empty()); /// RCS1266 public static readonly DiagnosticDescriptor UseRawStringLiteral = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseRawStringLiteral, + id: DiagnosticIds.UseRawStringLiteral, title: "Use raw string literal", messageFormat: "Use raw string literal", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseRawStringLiteral, + helpLinkUri: DiagnosticIds.UseRawStringLiteral, customTags: Array.Empty()); /// RCS1267 public static readonly DiagnosticDescriptor UseStringInterpolationInsteadOfStringConcat = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat, + id: DiagnosticIds.UseStringInterpolationInsteadOfStringConcat, title: "Use string interpolation instead of 'string.Concat'", messageFormat: "Use string interpolation instead of 'string.Concat'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat, + helpLinkUri: DiagnosticIds.UseStringInterpolationInsteadOfStringConcat, customTags: Array.Empty()); /// RCS1268 public static readonly DiagnosticDescriptor SimplifyNumericComparison = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SimplifyNumericComparison, + id: DiagnosticIds.SimplifyNumericComparison, title: "Simplify numeric comparison", messageFormat: "Simplify numeric comparison", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SimplifyNumericComparison, + helpLinkUri: DiagnosticIds.SimplifyNumericComparison, customTags: Array.Empty()); } diff --git a/src/CodeAnalysis.Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs b/src/Common/CodeAnalysis/CSharp/CodeAnalysisDiagnosticIds.Generated.cs similarity index 94% rename from src/CodeAnalysis.Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs rename to src/Common/CodeAnalysis/CSharp/CodeAnalysisDiagnosticIds.Generated.cs index b24b02d6ba..7f1dc983aa 100644 --- a/src/CodeAnalysis.Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs +++ b/src/Common/CodeAnalysis/CSharp/CodeAnalysisDiagnosticIds.Generated.cs @@ -6,7 +6,7 @@ namespace Roslynator.CodeAnalysis.CSharp { - public static partial class DiagnosticIdentifiers + public static partial class CodeAnalysisDiagnosticIds { public const string UsePatternMatching = "RCS9001"; public const string UsePropertySyntaxNodeSpanStart = "RCS9002"; diff --git a/src/CodeAnalysis.Analyzers/CSharp/DiagnosticRules.Generated.cs b/src/Common/CodeAnalysis/CSharp/CodeAnalysisDiagnosticRules.Generated.cs similarity index 76% rename from src/CodeAnalysis.Analyzers/CSharp/DiagnosticRules.Generated.cs rename to src/Common/CodeAnalysis/CSharp/CodeAnalysisDiagnosticRules.Generated.cs index 33801bbaf6..af9011d222 100644 --- a/src/CodeAnalysis.Analyzers/CSharp/DiagnosticRules.Generated.cs +++ b/src/Common/CodeAnalysis/CSharp/CodeAnalysisDiagnosticRules.Generated.cs @@ -7,140 +7,140 @@ namespace Roslynator.CodeAnalysis.CSharp { - public static partial class DiagnosticRules + public static partial class CodeAnalysisDiagnosticRules { /// RCS9001 public static readonly DiagnosticDescriptor UsePatternMatching = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UsePatternMatching, + id: CodeAnalysisDiagnosticIds.UsePatternMatching, title: "Use pattern matching", messageFormat: "Use pattern matching", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UsePatternMatching, + helpLinkUri: CodeAnalysisDiagnosticIds.UsePatternMatching, customTags: Array.Empty()); /// RCS9002 public static readonly DiagnosticDescriptor UsePropertySyntaxNodeSpanStart = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UsePropertySyntaxNodeSpanStart, + id: CodeAnalysisDiagnosticIds.UsePropertySyntaxNodeSpanStart, title: "Use property SyntaxNode.SpanStart", messageFormat: "Use property SyntaxNode.SpanStart", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UsePropertySyntaxNodeSpanStart, + helpLinkUri: CodeAnalysisDiagnosticIds.UsePropertySyntaxNodeSpanStart, customTags: Array.Empty()); /// RCS9003 public static readonly DiagnosticDescriptor UnnecessaryConditionalAccess = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryConditionalAccess, + id: CodeAnalysisDiagnosticIds.UnnecessaryConditionalAccess, title: "Unnecessary conditional access", messageFormat: "Unnecessary conditional access", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryConditionalAccess, + helpLinkUri: CodeAnalysisDiagnosticIds.UnnecessaryConditionalAccess, customTags: WellKnownDiagnosticTags.Unnecessary); public static readonly DiagnosticDescriptor UnnecessaryConditionalAccessFadeOut = DiagnosticDescriptorFactory.CreateFadeOut(UnnecessaryConditionalAccess); /// RCS9004 public static readonly DiagnosticDescriptor CallAnyInsteadOfAccessingCount = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount, + id: CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount, title: "Call 'Any' instead of accessing 'Count'", messageFormat: "Call 'Any' instead of accessing 'Count'", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount, + helpLinkUri: CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount, customTags: Array.Empty()); /// RCS9005 public static readonly DiagnosticDescriptor UnnecessaryNullCheck = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnnecessaryNullCheck, + id: CodeAnalysisDiagnosticIds.UnnecessaryNullCheck, title: "Unnecessary null check", messageFormat: "Unnecessary null check", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnnecessaryNullCheck, + helpLinkUri: CodeAnalysisDiagnosticIds.UnnecessaryNullCheck, customTags: WellKnownDiagnosticTags.Unnecessary); /// RCS9006 public static readonly DiagnosticDescriptor UseElementAccess = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseElementAccess, + id: CodeAnalysisDiagnosticIds.UseElementAccess, title: "Use element access", messageFormat: "Use element access", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseElementAccess, + helpLinkUri: CodeAnalysisDiagnosticIds.UseElementAccess, customTags: Array.Empty()); /// RCS9007 public static readonly DiagnosticDescriptor UseReturnValue = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseReturnValue, + id: CodeAnalysisDiagnosticIds.UseReturnValue, title: "Use return value", messageFormat: "Use return value", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UseReturnValue, + helpLinkUri: CodeAnalysisDiagnosticIds.UseReturnValue, customTags: Array.Empty()); /// RCS9008 public static readonly DiagnosticDescriptor CallLastInsteadOfUsingElementAccess = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess, + id: CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess, title: "Call 'Last' instead of using []", messageFormat: "Call 'Last' instead of using []", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess, + helpLinkUri: CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess, customTags: Array.Empty()); /// RCS9009 public static readonly DiagnosticDescriptor UnknownLanguageName = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UnknownLanguageName, + id: CodeAnalysisDiagnosticIds.UnknownLanguageName, title: "Unknown language name", messageFormat: "Unknown language name", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.UnknownLanguageName, + helpLinkUri: CodeAnalysisDiagnosticIds.UnknownLanguageName, customTags: Array.Empty()); /// RCS9010 public static readonly DiagnosticDescriptor SpecifyExportCodeRefactoringProviderAttributeName = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SpecifyExportCodeRefactoringProviderAttributeName, + id: CodeAnalysisDiagnosticIds.SpecifyExportCodeRefactoringProviderAttributeName, title: "Specify ExportCodeRefactoringProviderAttribute.Name", messageFormat: "Specify ExportCodeRefactoringProviderAttribute.Name", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SpecifyExportCodeRefactoringProviderAttributeName, + helpLinkUri: CodeAnalysisDiagnosticIds.SpecifyExportCodeRefactoringProviderAttributeName, customTags: Array.Empty()); /// RCS9011 public static readonly DiagnosticDescriptor SpecifyExportCodeFixProviderAttributeName = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.SpecifyExportCodeFixProviderAttributeName, + id: CodeAnalysisDiagnosticIds.SpecifyExportCodeFixProviderAttributeName, title: "Specify ExportCodeFixProviderAttribute.Name", messageFormat: "Specify ExportCodeFixProviderAttribute.Name", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true, description: null, - helpLinkUri: DiagnosticIdentifiers.SpecifyExportCodeFixProviderAttributeName, + helpLinkUri: CodeAnalysisDiagnosticIds.SpecifyExportCodeFixProviderAttributeName, customTags: Array.Empty()); } diff --git a/src/Common/Formatting/CSharp/DiagnosticIdentifiers.Generated.cs b/src/Common/Formatting/CSharp/DiagnosticIdentifiers.Generated.cs new file mode 100644 index 0000000000..2f95a462b2 --- /dev/null +++ b/src/Common/Formatting/CSharp/DiagnosticIdentifiers.Generated.cs @@ -0,0 +1,12 @@ +// Copyright (c) .NET Foundation and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +// + +using System; + +namespace Roslynator.Formatting.CSharp +{ + public static partial class DiagnosticIdentifiers2 + { + } +} \ No newline at end of file diff --git a/src/Common/Formatting/CSharp/DiagnosticRules.Generated.cs b/src/Common/Formatting/CSharp/DiagnosticRules.Generated.cs new file mode 100644 index 0000000000..653927f07e --- /dev/null +++ b/src/Common/Formatting/CSharp/DiagnosticRules.Generated.cs @@ -0,0 +1,13 @@ +// Copyright (c) .NET Foundation and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +// + +using System; +using Microsoft.CodeAnalysis; + +namespace Roslynator.Formatting.CSharp +{ + public static partial class DiagnosticRules2 + { + } +} \ No newline at end of file diff --git a/src/Formatting.Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs b/src/Common/Formatting/CSharp/FormattingDiagnosticIds.Generated.cs similarity index 98% rename from src/Formatting.Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs rename to src/Common/Formatting/CSharp/FormattingDiagnosticIds.Generated.cs index 937b9df58b..54ebc5fabd 100644 --- a/src/Formatting.Analyzers/CSharp/DiagnosticIdentifiers.Generated.cs +++ b/src/Common/Formatting/CSharp/FormattingDiagnosticIds.Generated.cs @@ -6,7 +6,7 @@ namespace Roslynator.Formatting.CSharp { - public static partial class DiagnosticIdentifiers + public static partial class FormattingDiagnosticIds { public const string AddBlankLineAfterEmbeddedStatement = "RCS0001"; public const string AddBlankLineAfterRegionDirective = "RCS0002"; diff --git a/src/Formatting.Analyzers/CSharp/DiagnosticRules.Generated.cs b/src/Common/Formatting/CSharp/FormattingDiagnosticRules.Generated.cs similarity index 75% rename from src/Formatting.Analyzers/CSharp/DiagnosticRules.Generated.cs rename to src/Common/Formatting/CSharp/FormattingDiagnosticRules.Generated.cs index bb553cf2b9..dd735918ad 100644 --- a/src/Formatting.Analyzers/CSharp/DiagnosticRules.Generated.cs +++ b/src/Common/Formatting/CSharp/FormattingDiagnosticRules.Generated.cs @@ -7,642 +7,642 @@ namespace Roslynator.Formatting.CSharp { - public static partial class DiagnosticRules + public static partial class FormattingDiagnosticRules { /// RCS0001 public static readonly DiagnosticDescriptor AddBlankLineAfterEmbeddedStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement, + id: FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement, title: "Add blank line after embedded statement", messageFormat: "Add blank line after embedded statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement, customTags: Array.Empty()); /// RCS0002 public static readonly DiagnosticDescriptor AddBlankLineAfterRegionDirective = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineAfterRegionDirective, + id: FormattingDiagnosticIds.AddBlankLineAfterRegionDirective, title: "Add blank line after #region", messageFormat: "Add blank line after #region", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineAfterRegionDirective, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineAfterRegionDirective, customTags: Array.Empty()); /// RCS0003 public static readonly DiagnosticDescriptor AddBlankLineAfterUsingDirectiveList = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList, + id: FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList, title: "Add blank line after using directive list", messageFormat: "Add blank line after using directive list", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList, customTags: Array.Empty()); /// RCS0005 public static readonly DiagnosticDescriptor AddBlankLineBeforeEndRegionDirective = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective, + id: FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective, title: "Add blank line before #endregion", messageFormat: "Add blank line before #endregion", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective, customTags: Array.Empty()); /// RCS0006 public static readonly DiagnosticDescriptor AddBlankLineBeforeUsingDirectiveList = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList, + id: FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList, title: "Add blank line before using directive list", messageFormat: "Add blank line before using directive list", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList, customTags: Array.Empty()); /// RCS0007 public static readonly DiagnosticDescriptor AddBlankLineBetweenAccessors = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBetweenAccessors, + id: FormattingDiagnosticIds.AddBlankLineBetweenAccessors, title: "Add blank line between accessors", messageFormat: "Add blank line between accessors", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBetweenAccessors, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBetweenAccessors, customTags: Array.Empty()); /// RCS0008 public static readonly DiagnosticDescriptor AddBlankLineBetweenClosingBraceAndNextStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement, + id: FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement, title: "Add blank line between closing brace and next statement", messageFormat: "Add blank line between closing brace and next statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement, customTags: Array.Empty()); /// RCS0009 public static readonly DiagnosticDescriptor AddBlankLineBetweenDeclarationAndDocumentationComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment, + id: FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment, title: "Add blank line between declaration and documentation comment", messageFormat: "Add blank line between declaration and documentation comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment, customTags: Array.Empty()); /// RCS0010 public static readonly DiagnosticDescriptor AddBlankLineBetweenDeclarations = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBetweenDeclarations, + id: FormattingDiagnosticIds.AddBlankLineBetweenDeclarations, title: "Add blank line between declarations", messageFormat: "Add blank line between declarations", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBetweenDeclarations, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBetweenDeclarations, customTags: Array.Empty()); /// RCS0011 public static readonly DiagnosticDescriptor BlankLineBetweenSingleLineAccessors = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors, + id: FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors, title: "Add/remove blank line between single-line accessors", messageFormat: "{0} blank line between single-line accessors", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors, + helpLinkUri: FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors, customTags: Array.Empty()); /// RCS0012 public static readonly DiagnosticDescriptor AddBlankLineBetweenSingleLineDeclarations = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations, + id: FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations, title: "Add blank line between single-line declarations", messageFormat: "Add blank line between single-line declarations", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations, customTags: Array.Empty()); /// RCS0013 public static readonly DiagnosticDescriptor AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind, + id: FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind, title: "Add blank line between single-line declarations of different kind", messageFormat: "Add blank line between single-line declarations of different kind", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind, customTags: Array.Empty()); /// RCS0014 public static readonly DiagnosticDescriptor AddBlankLineBetweenSwitchSections = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections, + id: FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections, title: "[deprecated] Add blank line between switch sections", messageFormat: "([deprecated] Use RCS0061 instead) Add blank line between switch sections", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections, customTags: Array.Empty()); /// RCS0015 public static readonly DiagnosticDescriptor BlankLineBetweenUsingDirectives = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.BlankLineBetweenUsingDirectives, + id: FormattingDiagnosticIds.BlankLineBetweenUsingDirectives, title: "Add/remove blank line between using directives", messageFormat: "{0} blank line between using directives", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.BlankLineBetweenUsingDirectives, + helpLinkUri: FormattingDiagnosticIds.BlankLineBetweenUsingDirectives, customTags: Array.Empty()); /// RCS0016 public static readonly DiagnosticDescriptor PutAttributeListOnItsOwnLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutAttributeListOnItsOwnLine, + id: FormattingDiagnosticIds.PutAttributeListOnItsOwnLine, title: "Put attribute list on its own line", messageFormat: "Put attribute list on its own line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutAttributeListOnItsOwnLine, + helpLinkUri: FormattingDiagnosticIds.PutAttributeListOnItsOwnLine, customTags: Array.Empty()); /// RCS0020 public static readonly DiagnosticDescriptor FormatAccessorBraces = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FormatAccessorBraces, + id: FormattingDiagnosticIds.FormatAccessorBraces, title: "Format accessor's braces on a single line or multiple lines", messageFormat: "Format braces on {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FormatAccessorBraces, + helpLinkUri: FormattingDiagnosticIds.FormatAccessorBraces, customTags: Array.Empty()); /// RCS0021 public static readonly DiagnosticDescriptor FormatBlockBraces = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FormatBlockBraces, + id: FormattingDiagnosticIds.FormatBlockBraces, title: "Format block's braces on a single line or multiple lines", messageFormat: "Format braces on {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FormatBlockBraces, + helpLinkUri: FormattingDiagnosticIds.FormatBlockBraces, customTags: Array.Empty()); /// RCS0022 public static readonly DiagnosticDescriptor AddNewLineAfterOpeningBraceOfEmptyBlock = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddNewLineAfterOpeningBraceOfEmptyBlock, + id: FormattingDiagnosticIds.AddNewLineAfterOpeningBraceOfEmptyBlock, title: "[deprecated] Add new line after opening brace of empty block", messageFormat: "([deprecated] Use RCS0021 instead) Format braces on multiple lines", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddNewLineAfterOpeningBraceOfEmptyBlock, + helpLinkUri: FormattingDiagnosticIds.AddNewLineAfterOpeningBraceOfEmptyBlock, customTags: Array.Empty()); /// RCS0023 public static readonly DiagnosticDescriptor FormatTypeDeclarationBraces = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FormatTypeDeclarationBraces, + id: FormattingDiagnosticIds.FormatTypeDeclarationBraces, title: "Format type declaration's braces", messageFormat: "Format type declaration's braces", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FormatTypeDeclarationBraces, + helpLinkUri: FormattingDiagnosticIds.FormatTypeDeclarationBraces, customTags: Array.Empty()); /// RCS0024 public static readonly DiagnosticDescriptor AddNewLineAfterSwitchLabel = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddNewLineAfterSwitchLabel, + id: FormattingDiagnosticIds.AddNewLineAfterSwitchLabel, title: "Add new line after switch label", messageFormat: "Add new line after switch label", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddNewLineAfterSwitchLabel, + helpLinkUri: FormattingDiagnosticIds.AddNewLineAfterSwitchLabel, customTags: Array.Empty()); /// RCS0025 public static readonly DiagnosticDescriptor PutFullAccessorOnItsOwnLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine, + id: FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine, title: "Put full accessor on its own line", messageFormat: "Put full accessor on its own line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine, + helpLinkUri: FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine, customTags: Array.Empty()); /// RCS0027 public static readonly DiagnosticDescriptor PlaceNewLineAfterOrBeforeBinaryOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator, + id: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator, title: "Place new line after/before binary operator", messageFormat: "Place new line {0} binary operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator, + helpLinkUri: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator, customTags: Array.Empty()); /// RCS0028 public static readonly DiagnosticDescriptor PlaceNewLineAfterOrBeforeConditionalOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator, + id: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator, title: "Place new line after/before '?:' operator", messageFormat: "Place new line {0} operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator, + helpLinkUri: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator, customTags: Array.Empty()); /// RCS0029 public static readonly DiagnosticDescriptor PutConstructorInitializerOnItsOwnLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutConstructorInitializerOnItsOwnLine, + id: FormattingDiagnosticIds.PutConstructorInitializerOnItsOwnLine, title: "Put constructor initializer on its own line", messageFormat: "Put constructor initializer on its own line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutConstructorInitializerOnItsOwnLine, + helpLinkUri: FormattingDiagnosticIds.PutConstructorInitializerOnItsOwnLine, customTags: Array.Empty()); /// RCS0030 public static readonly DiagnosticDescriptor PutEmbeddedStatementOnItsOwnLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine, + id: FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine, title: "Put embedded statement on its own line", messageFormat: "Put embedded statement on its own line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine, + helpLinkUri: FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine, customTags: Array.Empty()); /// RCS0031 public static readonly DiagnosticDescriptor PutEnumMemberOnItsOwnLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutEnumMemberOnItsOwnLine, + id: FormattingDiagnosticIds.PutEnumMemberOnItsOwnLine, title: "Put enum member on its own line", messageFormat: "Put enum member on its own line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutEnumMemberOnItsOwnLine, + helpLinkUri: FormattingDiagnosticIds.PutEnumMemberOnItsOwnLine, customTags: Array.Empty()); /// RCS0032 public static readonly DiagnosticDescriptor PlaceNewLineAfterOrBeforeArrowToken = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeArrowToken, + id: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeArrowToken, title: "Place new line after/before arrow token", messageFormat: "Place new line {0} arrow token", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeArrowToken, + helpLinkUri: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeArrowToken, customTags: Array.Empty()); /// RCS0033 public static readonly DiagnosticDescriptor PutStatementOnItsOwnLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutStatementOnItsOwnLine, + id: FormattingDiagnosticIds.PutStatementOnItsOwnLine, title: "Put statement on its own line", messageFormat: "Put statement on its own line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutStatementOnItsOwnLine, + helpLinkUri: FormattingDiagnosticIds.PutStatementOnItsOwnLine, customTags: Array.Empty()); /// RCS0034 public static readonly DiagnosticDescriptor PutTypeParameterConstraintOnItsOwnLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine, + id: FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine, title: "Put type parameter constraint on its own line", messageFormat: "Put type parameter constraint on its own line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine, + helpLinkUri: FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine, customTags: Array.Empty()); /// RCS0036 public static readonly DiagnosticDescriptor RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind, + id: FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind, title: "Remove blank line between single-line declarations of same kind", messageFormat: "Remove blank line between single-line declarations of same kind", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind, + helpLinkUri: FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind, customTags: Array.Empty()); /// RCS0038 public static readonly DiagnosticDescriptor RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, + id: FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, title: "[deprecated] Remove blank line between using directives with same root namespace", messageFormat: "([deprecated] Use RCS0015 instead) Remove blank line between using directives", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, + helpLinkUri: FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, customTags: Array.Empty()); /// RCS0039 public static readonly DiagnosticDescriptor RemoveNewLineBeforeBaseList = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveNewLineBeforeBaseList, + id: FormattingDiagnosticIds.RemoveNewLineBeforeBaseList, title: "Remove new line before base list", messageFormat: "Remove new line before base list", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveNewLineBeforeBaseList, + helpLinkUri: FormattingDiagnosticIds.RemoveNewLineBeforeBaseList, customTags: Array.Empty()); /// RCS0041 public static readonly DiagnosticDescriptor RemoveNewLineBetweenIfKeywordAndElseKeyword = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.RemoveNewLineBetweenIfKeywordAndElseKeyword, + id: FormattingDiagnosticIds.RemoveNewLineBetweenIfKeywordAndElseKeyword, title: "Remove new line between 'if' keyword and 'else' keyword", messageFormat: "Remove new line between 'if' keyword and 'else' keyword", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.RemoveNewLineBetweenIfKeywordAndElseKeyword, + helpLinkUri: FormattingDiagnosticIds.RemoveNewLineBetweenIfKeywordAndElseKeyword, customTags: Array.Empty()); /// RCS0042 public static readonly DiagnosticDescriptor PutAutoAccessorsOnSingleLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine, + id: FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine, title: "Put auto-accessors on a single line", messageFormat: "Put auto-accessors on a single line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine, + helpLinkUri: FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine, customTags: Array.Empty()); /// RCS0043 public static readonly DiagnosticDescriptor FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine, + id: FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine, title: "[deprecated] Format accessor's braces on a single line when expression is on single line", messageFormat: "([deprecated] Use RCS0020 with option 'roslynator_accessor_braces_style = single_line_when_expression_is_on_single_line') Format braces on a single line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine, + helpLinkUri: FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine, customTags: Array.Empty()); /// RCS0044 public static readonly DiagnosticDescriptor UseCarriageReturnAndLinefeedAsNewLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseCarriageReturnAndLinefeedAsNewLine, + id: FormattingDiagnosticIds.UseCarriageReturnAndLinefeedAsNewLine, title: "Use carriage return + linefeed as new line", messageFormat: "Use carriage return + linefeed as new line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseCarriageReturnAndLinefeedAsNewLine, + helpLinkUri: FormattingDiagnosticIds.UseCarriageReturnAndLinefeedAsNewLine, customTags: Array.Empty()); /// RCS0045 public static readonly DiagnosticDescriptor UseLinefeedAsNewLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseLinefeedAsNewLine, + id: FormattingDiagnosticIds.UseLinefeedAsNewLine, title: "Use linefeed as new line", messageFormat: "Use linefeed as new line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseLinefeedAsNewLine, + helpLinkUri: FormattingDiagnosticIds.UseLinefeedAsNewLine, customTags: Array.Empty()); /// RCS0046 public static readonly DiagnosticDescriptor UseSpacesInsteadOfTab = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.UseSpacesInsteadOfTab, + id: FormattingDiagnosticIds.UseSpacesInsteadOfTab, title: "Use spaces instead of tab", messageFormat: "Use spaces instead of tab", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.UseSpacesInsteadOfTab, + helpLinkUri: FormattingDiagnosticIds.UseSpacesInsteadOfTab, customTags: Array.Empty()); /// RCS0047 public static readonly DiagnosticDescriptor WrapAndIndentEachNodeInList = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.WrapAndIndentEachNodeInList, + id: FormattingDiagnosticIds.WrapAndIndentEachNodeInList, title: "[deprecated] Wrap and indent each node in list", messageFormat: "([deprecated] Use RCS0053 instead) Wrap and indent each node in list", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.WrapAndIndentEachNodeInList, + helpLinkUri: FormattingDiagnosticIds.WrapAndIndentEachNodeInList, customTags: Array.Empty()); /// RCS0048 public static readonly DiagnosticDescriptor PutInitializerOnSingleLine = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PutInitializerOnSingleLine, + id: FormattingDiagnosticIds.PutInitializerOnSingleLine, title: "Put initializer on a single line", messageFormat: "Put initializer on a single line", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PutInitializerOnSingleLine, + helpLinkUri: FormattingDiagnosticIds.PutInitializerOnSingleLine, customTags: Array.Empty()); /// RCS0049 public static readonly DiagnosticDescriptor AddBlankLineAfterTopComment = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineAfterTopComment, + id: FormattingDiagnosticIds.AddBlankLineAfterTopComment, title: "Add blank line after top comment", messageFormat: "Add blank line after top comment", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineAfterTopComment, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineAfterTopComment, customTags: Array.Empty()); /// RCS0050 public static readonly DiagnosticDescriptor AddBlankLineBeforeTopDeclaration = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration, + id: FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration, title: "Add blank line before top declaration", messageFormat: "Add blank line before top declaration", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration, + helpLinkUri: FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration, customTags: Array.Empty()); /// RCS0051 public static readonly DiagnosticDescriptor AddOrRemoveNewLineBeforeWhileInDoStatement = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement, + id: FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement, title: "Add/remove new line before 'while' in 'do' statement", messageFormat: "{0} new line before 'while' in 'do' statement", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement, + helpLinkUri: FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement, customTags: Array.Empty()); /// RCS0052 public static readonly DiagnosticDescriptor PlaceNewLineAfterOrBeforeEqualsToken = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken, + id: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken, title: "Place new line after/before equals token", messageFormat: "Place new line {0} equals token", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken, + helpLinkUri: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken, customTags: Array.Empty()); /// RCS0053 public static readonly DiagnosticDescriptor FixFormattingOfList = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FixFormattingOfList, + id: FormattingDiagnosticIds.FixFormattingOfList, title: "Fix formatting of a list", messageFormat: "Fix formatting of {0}", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FixFormattingOfList, + helpLinkUri: FormattingDiagnosticIds.FixFormattingOfList, customTags: Array.Empty()); /// RCS0054 public static readonly DiagnosticDescriptor FixFormattingOfCallChain = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FixFormattingOfCallChain, + id: FormattingDiagnosticIds.FixFormattingOfCallChain, title: "Fix formatting of a call chain", messageFormat: "Fix formatting of a call chain", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FixFormattingOfCallChain, + helpLinkUri: FormattingDiagnosticIds.FixFormattingOfCallChain, customTags: Array.Empty()); /// RCS0055 public static readonly DiagnosticDescriptor FixFormattingOfBinaryExpressionChain = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain, + id: FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain, title: "Fix formatting of a binary expression chain", messageFormat: "Fix formatting of a binary expression chain", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain, + helpLinkUri: FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain, customTags: Array.Empty()); /// RCS0056 public static readonly DiagnosticDescriptor LineIsTooLong = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.LineIsTooLong, + id: FormattingDiagnosticIds.LineIsTooLong, title: "A line is too long", messageFormat: "A line is too long ({0} characters)", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.LineIsTooLong, + helpLinkUri: FormattingDiagnosticIds.LineIsTooLong, customTags: Array.Empty()); /// RCS0057 public static readonly DiagnosticDescriptor NormalizeWhitespaceAtBeginningOfFile = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile, + id: FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile, title: "Normalize whitespace at the beginning of a file", messageFormat: "Normalize whitespace at the beginning of a file", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile, + helpLinkUri: FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile, customTags: Array.Empty()); /// RCS0058 public static readonly DiagnosticDescriptor NormalizeWhitespaceAtEndOfFile = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile, + id: FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile, title: "Normalize whitespace at the end of a file", messageFormat: "Normalize whitespace at the end of a file", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile, + helpLinkUri: FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile, customTags: Array.Empty()); /// RCS0059 public static readonly DiagnosticDescriptor PlaceNewLineAfterOrBeforeNullConditionalOperator = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator, + id: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator, title: "Place new line after/before null-conditional operator", messageFormat: "Place new line {0} null-conditional operator", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator, + helpLinkUri: FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator, customTags: Array.Empty()); /// RCS0060 public static readonly DiagnosticDescriptor BlankLineAfterFileScopedNamespaceDeclaration = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration, + id: FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration, title: "Add/remove line after file scoped namespace declaration", messageFormat: "{0} line after file scoped namespace declaration", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration, + helpLinkUri: FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration, customTags: Array.Empty()); /// RCS0061 public static readonly DiagnosticDescriptor BlankLineBetweenSwitchSections = DiagnosticDescriptorFactory.Create( - id: DiagnosticIdentifiers.BlankLineBetweenSwitchSections, + id: FormattingDiagnosticIds.BlankLineBetweenSwitchSections, title: "Add/remove blank line between switch sections", messageFormat: "{0} blank line between switch sections", category: DiagnosticCategories.Roslynator, defaultSeverity: DiagnosticSeverity.Info, isEnabledByDefault: false, description: null, - helpLinkUri: DiagnosticIdentifiers.BlankLineBetweenSwitchSections, + helpLinkUri: FormattingDiagnosticIds.BlankLineBetweenSwitchSections, customTags: Array.Empty()); } diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/AccessorDeclarationCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/AccessorDeclarationCodeFixProvider.cs index 79b84551ad..faa8d70720 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/AccessorDeclarationCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/AccessorDeclarationCodeFixProvider.cs @@ -22,9 +22,9 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine, - DiagnosticIdentifiers.FormatAccessorBraces, - DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine); + FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine, + FormattingDiagnosticIds.FormatAccessorBraces, + FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine); } } @@ -40,8 +40,8 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.FormatAccessorBraces: - case DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine: + case FormattingDiagnosticIds.FormatAccessorBraces: + case FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine: { bool isSingleLine = accessorDeclaration.IsSingleLine(includeExteriorTrivia: false); string title = (isSingleLine) @@ -58,7 +58,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine: + case FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine: { CodeAction codeAction = CodeAction.Create( "Put accessor on its own line", diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/AccessorListCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/AccessorListCodeFixProvider.cs index 97b90ee887..63ec3504ff 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/AccessorListCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/AccessorListCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class AccessorListCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -35,7 +35,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine: + case FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine: { CodeAction codeAction = CodeAction.Create( (accessorList.Accessors.Count == 1) ? "Put accessor on a single line" : "Put accessors on a single line", diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/AddBlankLineBeforeAndAfterUsingDirectiveListCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/AddBlankLineBeforeAndAfterUsingDirectiveListCodeFixProvider.cs index ee33cda6f7..66f68115ce 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/AddBlankLineBeforeAndAfterUsingDirectiveListCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/AddBlankLineBeforeAndAfterUsingDirectiveListCodeFixProvider.cs @@ -19,8 +19,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList, - DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList); + FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList, + FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList); } } diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/BinaryExpressionCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/BinaryExpressionCodeFixProvider.cs index a765640aa9..75e8ca99cb 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/BinaryExpressionCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/BinaryExpressionCodeFixProvider.cs @@ -17,7 +17,7 @@ public sealed class BinaryExpressionCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator); } } public override Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/BlankLineBetweenDeclarationsCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/BlankLineBetweenDeclarationsCodeFixProvider.cs index c2b8df6f8a..31deffc2c0 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/BlankLineBetweenDeclarationsCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/BlankLineBetweenDeclarationsCodeFixProvider.cs @@ -19,11 +19,11 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.AddBlankLineBetweenDeclarations, - DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations, - DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment, - DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind, - DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind); + FormattingDiagnosticIds.AddBlankLineBetweenDeclarations, + FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations, + FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment, + FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind, + FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind); } } diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/BlockCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/BlockCodeFixProvider.cs index 092359eb43..6eeac2aa84 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/BlockCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/BlockCodeFixProvider.cs @@ -22,8 +22,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.FormatBlockBraces, - DiagnosticIdentifiers.AddNewLineAfterOpeningBraceOfEmptyBlock); + FormattingDiagnosticIds.FormatBlockBraces, + FormattingDiagnosticIds.AddNewLineAfterOpeningBraceOfEmptyBlock); } } @@ -39,8 +39,8 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.FormatBlockBraces: - case DiagnosticIdentifiers.AddNewLineAfterOpeningBraceOfEmptyBlock: + case FormattingDiagnosticIds.FormatBlockBraces: + case FormattingDiagnosticIds.AddNewLineAfterOpeningBraceOfEmptyBlock: { bool isSingleLine = block.IsSingleLine(includeExteriorTrivia: false); string title = (isSingleLine) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/CompilationUnitCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/CompilationUnitCodeFixProvider.cs index 9da7f29429..97173869fa 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/CompilationUnitCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/CompilationUnitCodeFixProvider.cs @@ -19,7 +19,7 @@ public sealed class CompilationUnitCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -34,7 +34,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile: + case FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile: { SyntaxToken token = compilationUnit.EndOfFileToken; diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/ConditionalAccessExpressionCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/ConditionalAccessExpressionCodeFixProvider.cs index 7d3ca21142..d68384ab69 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/ConditionalAccessExpressionCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/ConditionalAccessExpressionCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class ConditionalAccessExpressionCodeFixProvider : BaseCodeFixProv { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator); } } public override Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/DirectiveTriviaCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/DirectiveTriviaCodeFixProvider.cs index e8f51b3155..04de12a63d 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/DirectiveTriviaCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/DirectiveTriviaCodeFixProvider.cs @@ -23,8 +23,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.AddBlankLineAfterRegionDirective, - DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective); + FormattingDiagnosticIds.AddBlankLineAfterRegionDirective, + FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective); } } @@ -40,8 +40,8 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.AddBlankLineAfterRegionDirective: - case DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective: + case FormattingDiagnosticIds.AddBlankLineAfterRegionDirective: + case FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective: { CodeAction codeAction = CodeAction.Create( CodeFixTitles.AddBlankLine, diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/EnumDeclarationCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/EnumDeclarationCodeFixProvider.cs index 4c623387c9..15e1f24f6e 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/EnumDeclarationCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/EnumDeclarationCodeFixProvider.cs @@ -16,7 +16,7 @@ public sealed class EnumDeclarationCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.PutEnumMemberOnItsOwnLine); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.PutEnumMemberOnItsOwnLine); } } public override Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/FileScopedNamespaceDeclarationCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/FileScopedNamespaceDeclarationCodeFixProvider.cs index b157774366..bef2f0c79c 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/FileScopedNamespaceDeclarationCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/FileScopedNamespaceDeclarationCodeFixProvider.cs @@ -16,7 +16,7 @@ public sealed class FileScopedNamespaceDeclarationCodeFixProvider : BaseCodeFixP { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration); } } public override Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfBinaryExpressionChainCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfBinaryExpressionChainCodeFixProvider.cs index bc57de4c1b..944f5557cf 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfBinaryExpressionChainCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfBinaryExpressionChainCodeFixProvider.cs @@ -17,7 +17,7 @@ public sealed class FixFormattingOfBinaryExpressionChainCodeFixProvider : BaseCo { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfCallChainCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfCallChainCodeFixProvider.cs index fe27e84bd0..3425b3dc00 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfCallChainCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfCallChainCodeFixProvider.cs @@ -20,7 +20,7 @@ public sealed class FixFormattingOfCallChainCodeFixProvider : BaseCodeFixProvide { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.FixFormattingOfCallChain); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.FixFormattingOfCallChain); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfListCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfListCodeFixProvider.cs index d43f36a793..d49a7ec96d 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfListCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/FixFormattingOfListCodeFixProvider.cs @@ -22,7 +22,7 @@ public sealed class FixFormattingOfListCodeFixProvider : BaseCodeFixProvider public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.FixFormattingOfList); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.FixFormattingOfList); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/InitializerCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/InitializerCodeFixProvider.cs index 9a2328be43..43b76aeb5a 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/InitializerCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/InitializerCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class InitializerCodeFixProvider : BaseCodeFixProvider { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.PutInitializerOnSingleLine); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.PutInitializerOnSingleLine); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -33,7 +33,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.PutInitializerOnSingleLine: + case FormattingDiagnosticIds.PutInitializerOnSingleLine: { CodeAction codeAction = CodeAction.Create( "Put initializer on a single line", diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/LineIsTooLong/LineIsTooLongCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/LineIsTooLong/LineIsTooLongCodeFixProvider.cs index f25d27fe77..db0d8eb1e2 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/LineIsTooLong/LineIsTooLongCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/LineIsTooLong/LineIsTooLongCodeFixProvider.cs @@ -28,7 +28,7 @@ public sealed class LineIsTooLongCodeFixProvider : BaseCodeFixProvider private const string Title = "Wrap line"; public override ImmutableArray FixableDiagnosticIds - => ImmutableArray.Create(DiagnosticIdentifiers.LineIsTooLong); + => ImmutableArray.Create(FormattingDiagnosticIds.LineIsTooLong); public override async Task RegisterCodeFixesAsync(CodeFixContext context) { diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/MemberDeclarationCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/MemberDeclarationCodeFixProvider.cs index 3f61eb2495..f1f4fc0c3b 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/MemberDeclarationCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/MemberDeclarationCodeFixProvider.cs @@ -23,8 +23,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.FormatTypeDeclarationBraces, - DiagnosticIdentifiers.PutConstructorInitializerOnItsOwnLine); + FormattingDiagnosticIds.FormatTypeDeclarationBraces, + FormattingDiagnosticIds.PutConstructorInitializerOnItsOwnLine); } } @@ -32,7 +32,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { Diagnostic diagnostic = context.Diagnostics[0]; - if (diagnostic.Id == DiagnosticIdentifiers.PutConstructorInitializerOnItsOwnLine) + if (diagnostic.Id == FormattingDiagnosticIds.PutConstructorInitializerOnItsOwnLine) { await CodeActionFactory.RegisterCodeActionForNewLineAsync( context, @@ -48,7 +48,7 @@ await CodeActionFactory.RegisterCodeActionForNewLineAsync( Document document = context.Document; - if (diagnostic.Id == DiagnosticIdentifiers.FormatTypeDeclarationBraces) + if (diagnostic.Id == FormattingDiagnosticIds.FormatTypeDeclarationBraces) { CodeAction codeAction = CodeAction.Create( "Format braces on multiple lines", diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/NormalizeWhitespaceAtEndOfFileCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/NormalizeWhitespaceAtEndOfFileCodeFixProvider.cs index da2c618c54..c169cffa81 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/NormalizeWhitespaceAtEndOfFileCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/NormalizeWhitespaceAtEndOfFileCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class NormalizeWhitespaceAtEndOfFileCodeFixProvider : BaseCodeFixP { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) @@ -33,7 +33,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile: + case FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile: { bool preferNewLineAtEndOfFile = document.GetConfigOptions(compilationUnit.SyntaxTree).PreferNewLineAtEndOfFile() ?? false; diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/ReplaceTabWithSpacesCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/ReplaceTabWithSpacesCodeFixProvider.cs index da36f52390..4e13f0d0a7 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/ReplaceTabWithSpacesCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/ReplaceTabWithSpacesCodeFixProvider.cs @@ -18,8 +18,8 @@ public sealed class ReplaceTabWithSpacesCodeFixProvider : BaseCodeFixProvider { public ReplaceTabWithSpacesCodeFixProvider() { - TwoSpacesEquivalenceKey = GetEquivalenceKey(DiagnosticIdentifiers.UseSpacesInsteadOfTab, "TwoSpaces"); - FourSpacesEquivalenceKey = GetEquivalenceKey(DiagnosticIdentifiers.UseSpacesInsteadOfTab, "FourSpaces"); + TwoSpacesEquivalenceKey = GetEquivalenceKey(FormattingDiagnosticIds.UseSpacesInsteadOfTab, "TwoSpaces"); + FourSpacesEquivalenceKey = GetEquivalenceKey(FormattingDiagnosticIds.UseSpacesInsteadOfTab, "FourSpaces"); } internal string TwoSpacesEquivalenceKey { get; } @@ -28,7 +28,7 @@ public ReplaceTabWithSpacesCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.UseSpacesInsteadOfTab); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.UseSpacesInsteadOfTab); } } public override Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/StatementCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/StatementCodeFixProvider.cs index 68d234b069..a24a12dcbd 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/StatementCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/StatementCodeFixProvider.cs @@ -19,10 +19,10 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.PutStatementOnItsOwnLine, - DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine, - DiagnosticIdentifiers.AddNewLineAfterSwitchLabel, - DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement); + FormattingDiagnosticIds.PutStatementOnItsOwnLine, + FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine, + FormattingDiagnosticIds.AddNewLineAfterSwitchLabel, + FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement); } } @@ -32,18 +32,18 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.PutStatementOnItsOwnLine: + case FormattingDiagnosticIds.PutStatementOnItsOwnLine: { await CodeActionFactory.RegisterCodeActionForNewLineAsync(context).ConfigureAwait(false); break; } - case DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine: - case DiagnosticIdentifiers.AddNewLineAfterSwitchLabel: + case FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine: + case FormattingDiagnosticIds.AddNewLineAfterSwitchLabel: { await CodeActionFactory.RegisterCodeActionForNewLineAsync(context, increaseIndentation: true).ConfigureAwait(false); break; } - case DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement: + case FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement: { await CodeActionFactory.RegisterCodeActionForBlankLineAsync(context).ConfigureAwait(false); break; diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/SwitchSectionCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/SwitchSectionCodeFixProvider.cs index 2ed03adf3e..a3dbf1ca13 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/SwitchSectionCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/SwitchSectionCodeFixProvider.cs @@ -19,8 +19,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections, - DiagnosticIdentifiers.BlankLineBetweenSwitchSections); + FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections, + FormattingDiagnosticIds.BlankLineBetweenSwitchSections); } } diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/SyntaxTokenCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/SyntaxTokenCodeFixProvider.cs index 6d6330cd05..629d0e5b06 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/SyntaxTokenCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/SyntaxTokenCodeFixProvider.cs @@ -20,12 +20,12 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement, - DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator, - DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeArrowToken, - DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken, - DiagnosticIdentifiers.PutAttributeListOnItsOwnLine, - DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement); + FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement, + FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator, + FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeArrowToken, + FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken, + FormattingDiagnosticIds.PutAttributeListOnItsOwnLine, + FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement); } } @@ -35,28 +35,28 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement: + case FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement: { await CodeActionFactory.RegisterCodeActionForBlankLineAsync(context).ConfigureAwait(false); break; } - case DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator: + case FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator: { await CodeActionFactory.RegisterCodeActionForNewLineAroundTokenAsync(context, token => token.IsParentKind(SyntaxKind.ConditionalExpression)).ConfigureAwait(false); break; } - case DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeArrowToken: + case FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeArrowToken: { await CodeActionFactory.RegisterCodeActionForNewLineAroundTokenAsync(context, token => token.IsKind(SyntaxKind.EqualsGreaterThanToken)).ConfigureAwait(false); break; } - case DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken: + case FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken: { await CodeActionFactory.RegisterCodeActionForNewLineAroundTokenAsync(context, token => token.IsKind(SyntaxKind.EqualsToken)).ConfigureAwait(false); break; } - case DiagnosticIdentifiers.PutAttributeListOnItsOwnLine: - case DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement: + case FormattingDiagnosticIds.PutAttributeListOnItsOwnLine: + case FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement: { await CodeActionFactory.RegisterCodeActionForNewLineAsync(context).ConfigureAwait(false); break; diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/SyntaxTriviaCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/SyntaxTriviaCodeFixProvider.cs index 244dc9ac8b..afc7775b93 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/SyntaxTriviaCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/SyntaxTriviaCodeFixProvider.cs @@ -19,14 +19,14 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.AddBlankLineAfterTopComment, - DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration, - DiagnosticIdentifiers.AddBlankLineBetweenAccessors, - DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors, - DiagnosticIdentifiers.BlankLineBetweenUsingDirectives, - DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, - DiagnosticIdentifiers.RemoveNewLineBetweenIfKeywordAndElseKeyword, - DiagnosticIdentifiers.RemoveNewLineBeforeBaseList); + FormattingDiagnosticIds.AddBlankLineAfterTopComment, + FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration, + FormattingDiagnosticIds.AddBlankLineBetweenAccessors, + FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors, + FormattingDiagnosticIds.BlankLineBetweenUsingDirectives, + FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, + FormattingDiagnosticIds.RemoveNewLineBetweenIfKeywordAndElseKeyword, + FormattingDiagnosticIds.RemoveNewLineBeforeBaseList); } } @@ -36,18 +36,18 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration: - case DiagnosticIdentifiers.AddBlankLineBetweenAccessors: - case DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors: - case DiagnosticIdentifiers.BlankLineBetweenUsingDirectives: - case DiagnosticIdentifiers.AddBlankLineAfterTopComment: - case DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace: + case FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration: + case FormattingDiagnosticIds.AddBlankLineBetweenAccessors: + case FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors: + case FormattingDiagnosticIds.BlankLineBetweenUsingDirectives: + case FormattingDiagnosticIds.AddBlankLineAfterTopComment: + case FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace: { await CodeActionFactory.RegisterCodeActionForBlankLineAsync(context).ConfigureAwait(false); return; } - case DiagnosticIdentifiers.RemoveNewLineBeforeBaseList: - case DiagnosticIdentifiers.RemoveNewLineBetweenIfKeywordAndElseKeyword: + case FormattingDiagnosticIds.RemoveNewLineBeforeBaseList: + case FormattingDiagnosticIds.RemoveNewLineBetweenIfKeywordAndElseKeyword: { await CodeActionFactory.RegisterCodeActionForNewLineAsync(context).ConfigureAwait(false); break; diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/TypeParameterConstraintClauseSyntaxCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/TypeParameterConstraintClauseSyntaxCodeFixProvider.cs index 9625463ffb..bb2b7d01d8 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/TypeParameterConstraintClauseSyntaxCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/TypeParameterConstraintClauseSyntaxCodeFixProvider.cs @@ -18,7 +18,7 @@ public sealed class TypeParameterConstraintClauseSyntaxCodeFixProvider : BaseCod { public override ImmutableArray FixableDiagnosticIds { - get { return ImmutableArray.Create(DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine); } + get { return ImmutableArray.Create(FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine); } } public override async Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Formatting.Analyzers.CodeFixes/NewLineCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/NewLineCodeFixProvider.cs index 450d75dd13..011c51561b 100644 --- a/src/Formatting.Analyzers.CodeFixes/NewLineCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/NewLineCodeFixProvider.cs @@ -20,8 +20,8 @@ public override ImmutableArray FixableDiagnosticIds get { return ImmutableArray.Create( - DiagnosticIdentifiers.UseLinefeedAsNewLine, - DiagnosticIdentifiers.UseCarriageReturnAndLinefeedAsNewLine); + FormattingDiagnosticIds.UseLinefeedAsNewLine, + FormattingDiagnosticIds.UseCarriageReturnAndLinefeedAsNewLine); } } @@ -33,7 +33,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context) switch (diagnostic.Id) { - case DiagnosticIdentifiers.UseLinefeedAsNewLine: + case FormattingDiagnosticIds.UseLinefeedAsNewLine: { CodeAction codeAction = CodeAction.Create( "Use linefeed as newline", @@ -43,7 +43,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context) context.RegisterCodeFix(codeAction, diagnostic); break; } - case DiagnosticIdentifiers.UseCarriageReturnAndLinefeedAsNewLine: + case FormattingDiagnosticIds.UseCarriageReturnAndLinefeedAsNewLine: { CodeAction codeAction = CodeAction.Create( "Use carriage return + linefeed as newline", diff --git a/src/Formatting.Analyzers/CSharp/AccessorListAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AccessorListAnalyzer.cs index 0a42363dec..c45e7ff98e 100644 --- a/src/Formatting.Analyzers/CSharp/AccessorListAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AccessorListAnalyzer.cs @@ -24,8 +24,8 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.PutAutoAccessorsOnSingleLine, - DiagnosticRules.PutFullAccessorOnItsOwnLine); + FormattingDiagnosticRules.PutAutoAccessorsOnSingleLine, + FormattingDiagnosticRules.PutFullAccessorOnItsOwnLine); } return _supportedDiagnostics; @@ -47,7 +47,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) if (accessors.Any(f => f.BodyOrExpressionBody() is not null)) { - if (DiagnosticRules.PutFullAccessorOnItsOwnLine.IsEffective(context)) + if (FormattingDiagnosticRules.PutFullAccessorOnItsOwnLine.IsEffective(context)) { SyntaxToken token = accessorList.OpenBraceToken; @@ -58,7 +58,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PutFullAccessorOnItsOwnLine, + FormattingDiagnosticRules.PutFullAccessorOnItsOwnLine, Location.Create(accessor.SyntaxTree, new TextSpan(accessor.SpanStart, 0))); break; @@ -71,7 +71,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) } } } - else if (DiagnosticRules.PutAutoAccessorsOnSingleLine.IsEffective(context)) + else if (FormattingDiagnosticRules.PutAutoAccessorsOnSingleLine.IsEffective(context)) { SyntaxNode parent = accessorList.Parent; @@ -97,7 +97,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) .DescendantTrivia(span) .All(f => f.IsWhitespaceOrEndOfLineTrivia())) { - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.PutAutoAccessorsOnSingleLine, accessorList); + DiagnosticHelpers.ReportDiagnostic(context, FormattingDiagnosticRules.PutAutoAccessorsOnSingleLine, accessorList); } } } @@ -130,7 +130,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) .DescendantTrivia(span) .All(f => f.IsWhitespaceOrEndOfLineTrivia())) { - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.PutAutoAccessorsOnSingleLine, accessorList); + DiagnosticHelpers.ReportDiagnostic(context, FormattingDiagnosticRules.PutAutoAccessorsOnSingleLine, accessorList); } } } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineAfterEmbeddedStatementAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineAfterEmbeddedStatementAnalyzer.cs index 4274beef43..0f60734119 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineAfterEmbeddedStatementAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineAfterEmbeddedStatementAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineAfterEmbeddedStatement); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineAfterEmbeddedStatement); return _supportedDiagnostics; } @@ -148,7 +148,7 @@ private static void Analyze( DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineAfterEmbeddedStatement, + FormattingDiagnosticRules.AddBlankLineAfterEmbeddedStatement, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineAfterRegionDirectiveAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineAfterRegionDirectiveAnalyzer.cs index 5d1db2ac28..2f9a9a780e 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineAfterRegionDirectiveAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineAfterRegionDirectiveAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineAfterRegionDirective); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineAfterRegionDirective); return _supportedDiagnostics; } @@ -40,7 +40,7 @@ private static void AnalyzeRegionDirectiveTrivia(SyntaxNodeAnalysisContext conte { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineAfterRegionDirective, + FormattingDiagnosticRules.AddBlankLineAfterRegionDirective, Location.Create(regionDirective.SyntaxTree, regionDirective.EndOfDirectiveToken.Span)); } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineAfterTopCommentAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineAfterTopCommentAnalyzer.cs index 96441f47b3..d6421dc4ee 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineAfterTopCommentAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineAfterTopCommentAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineAfterTopComment); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineAfterTopComment); return _supportedDiagnostics; } @@ -51,7 +51,7 @@ private static void AnalyzeCompilationUnit(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineAfterTopComment, + FormattingDiagnosticRules.AddBlankLineAfterTopComment, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineAfterUsingDirectiveListAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineAfterUsingDirectiveListAnalyzer.cs index 17c9da1c6a..fff8aa20f4 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineAfterUsingDirectiveListAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineAfterUsingDirectiveListAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineAfterUsingDirectiveList); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineAfterUsingDirectiveList); return _supportedDiagnostics; } @@ -84,7 +84,7 @@ private static void Analyze( DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineAfterUsingDirectiveList, + FormattingDiagnosticRules.AddBlankLineAfterUsingDirectiveList, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeEndRegionDirectiveAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeEndRegionDirectiveAnalyzer.cs index b35027152b..e2616930aa 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeEndRegionDirectiveAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeEndRegionDirectiveAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineBeforeEndRegionDirective); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineBeforeEndRegionDirective); return _supportedDiagnostics; } @@ -40,7 +40,7 @@ private static void AnalyzeEndRegionDirectiveTrivia(SyntaxNodeAnalysisContext co { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineBeforeEndRegionDirective, + FormattingDiagnosticRules.AddBlankLineBeforeEndRegionDirective, Location.Create(endRegionDirective.SyntaxTree, endRegionDirective.Span.WithLength(0))); } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeTopDeclarationAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeTopDeclarationAnalyzer.cs index 64cdeb028b..499d962725 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeTopDeclarationAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeTopDeclarationAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineBeforeTopDeclaration); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineBeforeTopDeclaration); return _supportedDiagnostics; } @@ -56,7 +56,7 @@ private static void AnalyzeCompilationUnit(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineBeforeTopDeclaration, + FormattingDiagnosticRules.AddBlankLineBeforeTopDeclaration, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeUsingDirectiveListAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeUsingDirectiveListAnalyzer.cs index 0c6056b77e..5971cc9621 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeUsingDirectiveListAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineBeforeUsingDirectiveListAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineBeforeUsingDirectiveList); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineBeforeUsingDirectiveList); return _supportedDiagnostics; } @@ -52,7 +52,7 @@ private static void AnalyzeCompilationUnit(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineBeforeUsingDirectiveList, + FormattingDiagnosticRules.AddBlankLineBeforeUsingDirectiveList, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineBetweenClosingBraceAndNextStatementAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineBetweenClosingBraceAndNextStatementAnalyzer.cs index 07be46030f..bbd365cb0e 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineBetweenClosingBraceAndNextStatementAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineBetweenClosingBraceAndNextStatementAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineBetweenClosingBraceAndNextStatement); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineBetweenClosingBraceAndNextStatement); return _supportedDiagnostics; } @@ -141,7 +141,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context, SyntaxToken close DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineBetweenClosingBraceAndNextStatement, + FormattingDiagnosticRules.AddBlankLineBetweenClosingBraceAndNextStatement, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/AddBlankLineBetweenSwitchSectionsAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddBlankLineBetweenSwitchSectionsAnalyzer.cs index 1501e8c1c4..69c754f9ef 100644 --- a/src/Formatting.Analyzers/CSharp/AddBlankLineBetweenSwitchSectionsAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddBlankLineBetweenSwitchSectionsAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddBlankLineBetweenSwitchSections); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddBlankLineBetweenSwitchSections); return _supportedDiagnostics; } @@ -61,7 +61,7 @@ private static void AnalyzeSwitchStatement(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddBlankLineBetweenSwitchSections, + FormattingDiagnosticRules.AddBlankLineBetweenSwitchSections, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/AddNewLineAfterSwitchLabelAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddNewLineAfterSwitchLabelAnalyzer.cs index 3ba577ca7e..52be419632 100644 --- a/src/Formatting.Analyzers/CSharp/AddNewLineAfterSwitchLabelAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddNewLineAfterSwitchLabelAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddNewLineAfterSwitchLabel); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddNewLineAfterSwitchLabel); return _supportedDiagnostics; } @@ -52,7 +52,7 @@ private static void AnalyzeSwitchSection(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddNewLineAfterSwitchLabel, + FormattingDiagnosticRules.AddNewLineAfterSwitchLabel, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/AddOrRemoveNewLineBeforeWhileInDoStatementAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AddOrRemoveNewLineBeforeWhileInDoStatementAnalyzer.cs index e90b2d2e47..fbf63d37bb 100644 --- a/src/Formatting.Analyzers/CSharp/AddOrRemoveNewLineBeforeWhileInDoStatementAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AddOrRemoveNewLineBeforeWhileInDoStatementAnalyzer.cs @@ -22,7 +22,7 @@ public override ImmutableArray SupportedDiagnostics { if (_supportedDiagnostics.IsDefault) { - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement); } return _supportedDiagnostics; @@ -60,7 +60,7 @@ private static void AnalyzeDoStatement(SyntaxNodeAnalysisContext context) if (newLineStyle == NewLineStyle.Add) { context.ReportDiagnostic( - DiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement, + FormattingDiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement, block.GetLocation(), "Add"); } @@ -68,7 +68,7 @@ private static void AnalyzeDoStatement(SyntaxNodeAnalysisContext context) else if (newLineStyle == NewLineStyle.Remove) { context.ReportDiagnostic( - DiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement, + FormattingDiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement, block.GetLocation(), "Remove"); } diff --git a/src/Formatting.Analyzers/CSharp/AnalyzerOptionIsObsoleteAnalyzer.cs b/src/Formatting.Analyzers/CSharp/AnalyzerOptionIsObsoleteAnalyzer.cs index d1f5573dd9..1797fafb33 100644 --- a/src/Formatting.Analyzers/CSharp/AnalyzerOptionIsObsoleteAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/AnalyzerOptionIsObsoleteAnalyzer.cs @@ -42,13 +42,13 @@ public override void Initialize(AnalysisContext context) AnalyzerConfigOptions configOptions = context.GetConfigOptions(); - Validate(ref context, compilationOptions, configOptions, Flags.AddOrRemoveNewLineBeforeWhileInDoStatement, ref flags, DiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement, ConfigOptions.NewLineBeforeWhileInDoStatement, LegacyConfigOptions.RemoveNewLineBetweenClosingBraceAndWhileKeyword, "false"); - Validate(ref context, compilationOptions, configOptions, Flags.BlankLineBetweenSingleLineAccessors, ref flags, DiagnosticRules.BlankLineBetweenSingleLineAccessors, ConfigOptions.BlankLineBetweenSingleLineAccessors, LegacyConfigOptions.RemoveEmptyLineBetweenSingleLineAccessors, "false"); - Validate(ref context, compilationOptions, configOptions, Flags.BlankLineBetweenUsingDirectives, ref flags, DiagnosticRules.BlankLineBetweenUsingDirectives, ConfigOptions.BlankLineBetweenUsingDirectives, LegacyConfigOptions.RemoveEmptyLineBetweenUsingDirectivesWithDifferentRootNamespace, ConfigOptionValues.BlankLineBetweenUsingDirectives_Never); - Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeArrowToken, ref flags, DiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken, ConfigOptions.ArrowTokenNewLine, LegacyConfigOptions.AddNewLineAfterExpressionBodyArrowInsteadOfBeforeIt, "after"); - Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeConditionalOperator, ref flags, DiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator, ConfigOptions.ConditionalOperatorNewLine, LegacyConfigOptions.AddNewLineAfterConditionalOperatorInsteadOfBeforeIt, "after"); - Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeBinaryOperator, ref flags, DiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator, ConfigOptions.BinaryOperatorNewLine, LegacyConfigOptions.AddNewLineAfterBinaryOperatorInsteadOfBeforeIt, "after"); - Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeEqualsToken, ref flags, DiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken, ConfigOptions.EqualsTokenNewLine, LegacyConfigOptions.AddNewLineAfterEqualsSignInsteadOfBeforeIt, "after"); + Validate(ref context, compilationOptions, configOptions, Flags.AddOrRemoveNewLineBeforeWhileInDoStatement, ref flags, FormattingDiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement, ConfigOptions.NewLineBeforeWhileInDoStatement, LegacyConfigOptions.RemoveNewLineBetweenClosingBraceAndWhileKeyword, "false"); + Validate(ref context, compilationOptions, configOptions, Flags.BlankLineBetweenSingleLineAccessors, ref flags, FormattingDiagnosticRules.BlankLineBetweenSingleLineAccessors, ConfigOptions.BlankLineBetweenSingleLineAccessors, LegacyConfigOptions.RemoveEmptyLineBetweenSingleLineAccessors, "false"); + Validate(ref context, compilationOptions, configOptions, Flags.BlankLineBetweenUsingDirectives, ref flags, FormattingDiagnosticRules.BlankLineBetweenUsingDirectives, ConfigOptions.BlankLineBetweenUsingDirectives, LegacyConfigOptions.RemoveEmptyLineBetweenUsingDirectivesWithDifferentRootNamespace, ConfigOptionValues.BlankLineBetweenUsingDirectives_Never); + Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeArrowToken, ref flags, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken, ConfigOptions.ArrowTokenNewLine, LegacyConfigOptions.AddNewLineAfterExpressionBodyArrowInsteadOfBeforeIt, "after"); + Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeConditionalOperator, ref flags, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator, ConfigOptions.ConditionalOperatorNewLine, LegacyConfigOptions.AddNewLineAfterConditionalOperatorInsteadOfBeforeIt, "after"); + Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeBinaryOperator, ref flags, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator, ConfigOptions.BinaryOperatorNewLine, LegacyConfigOptions.AddNewLineAfterBinaryOperatorInsteadOfBeforeIt, "after"); + Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeEqualsToken, ref flags, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken, ConfigOptions.EqualsTokenNewLine, LegacyConfigOptions.AddNewLineAfterEqualsSignInsteadOfBeforeIt, "after"); }); }); } diff --git a/src/Formatting.Analyzers/CSharp/BlankLineAfterFileScopedNamespaceDeclarationAnalyzer.cs b/src/Formatting.Analyzers/CSharp/BlankLineAfterFileScopedNamespaceDeclarationAnalyzer.cs index 6c7093e515..db42f7ed9a 100644 --- a/src/Formatting.Analyzers/CSharp/BlankLineAfterFileScopedNamespaceDeclarationAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/BlankLineAfterFileScopedNamespaceDeclarationAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.BlankLineAfterFileScopedNamespaceDeclaration); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.BlankLineAfterFileScopedNamespaceDeclaration); return _supportedDiagnostics; } @@ -63,7 +63,7 @@ private static void AnalyzeFileScopedNamespaceDeclaration(SyntaxNodeAnalysisCont if (style == BlankLineStyle.Remove) { context.ReportDiagnostic( - DiagnosticRules.BlankLineAfterFileScopedNamespaceDeclaration, + FormattingDiagnosticRules.BlankLineAfterFileScopedNamespaceDeclaration, block.GetLocation(), "Remove"); } @@ -71,7 +71,7 @@ private static void AnalyzeFileScopedNamespaceDeclaration(SyntaxNodeAnalysisCont else if (style == BlankLineStyle.Add) { context.ReportDiagnostic( - DiagnosticRules.BlankLineAfterFileScopedNamespaceDeclaration, + FormattingDiagnosticRules.BlankLineAfterFileScopedNamespaceDeclaration, block.GetLocation(), "Add"); } diff --git a/src/Formatting.Analyzers/CSharp/BlankLineBetweenAccessorsAnalyzer.cs b/src/Formatting.Analyzers/CSharp/BlankLineBetweenAccessorsAnalyzer.cs index 207d36d622..d05513c89c 100644 --- a/src/Formatting.Analyzers/CSharp/BlankLineBetweenAccessorsAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/BlankLineBetweenAccessorsAnalyzer.cs @@ -25,8 +25,8 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.AddBlankLineBetweenAccessors, - DiagnosticRules.BlankLineBetweenSingleLineAccessors); + FormattingDiagnosticRules.AddBlankLineBetweenAccessors, + FormattingDiagnosticRules.BlankLineBetweenSingleLineAccessors); } return _supportedDiagnostics; @@ -69,7 +69,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) if (accessorList.SyntaxTree.IsSingleLineSpan(accessor1.Span, context.CancellationToken) && accessorList.SyntaxTree.IsSingleLineSpan(accessor2.Span, context.CancellationToken)) { - if (DiagnosticRules.BlankLineBetweenSingleLineAccessors.IsEffective(context)) + if (FormattingDiagnosticRules.BlankLineBetweenSingleLineAccessors.IsEffective(context)) { BlankLineStyle style = context.GetBlankLineBetweenSingleLineAccessors(); @@ -79,7 +79,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.BlankLineBetweenSingleLineAccessors, + FormattingDiagnosticRules.BlankLineBetweenSingleLineAccessors, block.GetLocation(), properties: DiagnosticProperties.AnalyzerOption_Invert, "Remove"); @@ -89,7 +89,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.BlankLineBetweenSingleLineAccessors, + FormattingDiagnosticRules.BlankLineBetweenSingleLineAccessors, block.GetLocation(), "Add"); } @@ -99,7 +99,7 @@ private static void AnalyzeAccessorList(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnosticIfEffective( context, - DiagnosticRules.AddBlankLineBetweenAccessors, + FormattingDiagnosticRules.AddBlankLineBetweenAccessors, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/BlankLineBetweenDeclarationsAnalyzer.cs b/src/Formatting.Analyzers/CSharp/BlankLineBetweenDeclarationsAnalyzer.cs index f96260cdde..ab91144260 100644 --- a/src/Formatting.Analyzers/CSharp/BlankLineBetweenDeclarationsAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/BlankLineBetweenDeclarationsAnalyzer.cs @@ -24,11 +24,11 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.AddBlankLineBetweenDeclarations, - DiagnosticRules.AddBlankLineBetweenSingleLineDeclarations, - DiagnosticRules.AddBlankLineBetweenDeclarationAndDocumentationComment, - DiagnosticRules.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind, - DiagnosticRules.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind); + FormattingDiagnosticRules.AddBlankLineBetweenDeclarations, + FormattingDiagnosticRules.AddBlankLineBetweenSingleLineDeclarations, + FormattingDiagnosticRules.AddBlankLineBetweenDeclarationAndDocumentationComment, + FormattingDiagnosticRules.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind, + FormattingDiagnosticRules.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind); } return _supportedDiagnostics; @@ -109,7 +109,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context, SyntaxList SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.BlankLineBetweenSwitchSections); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.BlankLineBetweenSwitchSections); return _supportedDiagnostics; } @@ -88,7 +88,7 @@ private static void AnalyzeSwitchStatement(SyntaxNodeAnalysisContext context) private static void ReportDiagnostic(SyntaxNodeAnalysisContext context, TriviaBlock block, string messageArg) { context.ReportDiagnostic( - DiagnosticRules.BlankLineBetweenSwitchSections, + FormattingDiagnosticRules.BlankLineBetweenSwitchSections, block.GetLocation(), messageArg); } diff --git a/src/Formatting.Analyzers/CSharp/BlankLineBetweenUsingDirectivesAnalyzer.cs b/src/Formatting.Analyzers/CSharp/BlankLineBetweenUsingDirectivesAnalyzer.cs index 5a311d0eaa..a219af02fe 100644 --- a/src/Formatting.Analyzers/CSharp/BlankLineBetweenUsingDirectivesAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/BlankLineBetweenUsingDirectivesAnalyzer.cs @@ -24,8 +24,8 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, - DiagnosticRules.BlankLineBetweenUsingDirectives); + FormattingDiagnosticRules.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, + FormattingDiagnosticRules.BlankLineBetweenUsingDirectives); } return _supportedDiagnostics; @@ -98,26 +98,26 @@ private static void AnalyzeUsings(SyntaxNodeAnalysisContext context, SyntaxList< { if (block.Kind == TriviaBlockKind.BlankLine) { - if (DiagnosticRules.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace.IsEffective(context)) + if (FormattingDiagnosticRules.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace.IsEffective(context)) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, + FormattingDiagnosticRules.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace, block.GetLocation()); } - if (DiagnosticRules.BlankLineBetweenUsingDirectives.IsEffective(context) + if (FormattingDiagnosticRules.BlankLineBetweenUsingDirectives.IsEffective(context) && context.GetBlankLineBetweenUsingDirectives() == UsingDirectiveBlankLineStyle.Never) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.BlankLineBetweenUsingDirectives, + FormattingDiagnosticRules.BlankLineBetweenUsingDirectives, block.GetLocation(), "Remove"); } } } - else if (DiagnosticRules.BlankLineBetweenUsingDirectives.IsEffective(context)) + else if (FormattingDiagnosticRules.BlankLineBetweenUsingDirectives.IsEffective(context)) { UsingDirectiveBlankLineStyle style = context.GetBlankLineBetweenUsingDirectives(); @@ -127,7 +127,7 @@ private static void AnalyzeUsings(SyntaxNodeAnalysisContext context, SyntaxList< { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.BlankLineBetweenUsingDirectives, + FormattingDiagnosticRules.BlankLineBetweenUsingDirectives, block.GetLocation(), "Remove"); } @@ -136,7 +136,7 @@ private static void AnalyzeUsings(SyntaxNodeAnalysisContext context, SyntaxList< { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.BlankLineBetweenUsingDirectives, + FormattingDiagnosticRules.BlankLineBetweenUsingDirectives, block.GetLocation(), "Add"); } diff --git a/src/Formatting.Analyzers/CSharp/FixFormattingOfBinaryExpressionChainAnalyzer.cs b/src/Formatting.Analyzers/CSharp/FixFormattingOfBinaryExpressionChainAnalyzer.cs index 3a8f812978..85bf5fc65a 100644 --- a/src/Formatting.Analyzers/CSharp/FixFormattingOfBinaryExpressionChainAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/FixFormattingOfBinaryExpressionChainAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.FixFormattingOfBinaryExpressionChain); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.FixFormattingOfBinaryExpressionChain); return _supportedDiagnostics; } @@ -177,7 +177,7 @@ void ReportDiagnostic() { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FixFormattingOfBinaryExpressionChain, + FormattingDiagnosticRules.FixFormattingOfBinaryExpressionChain, topBinaryExpression); } } diff --git a/src/Formatting.Analyzers/CSharp/FixFormattingOfCallChainAnalyzer.cs b/src/Formatting.Analyzers/CSharp/FixFormattingOfCallChainAnalyzer.cs index 8140fdc8a3..6af967481a 100644 --- a/src/Formatting.Analyzers/CSharp/FixFormattingOfCallChainAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/FixFormattingOfCallChainAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.FixFormattingOfCallChain); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.FixFormattingOfCallChain); return _supportedDiagnostics; } @@ -183,7 +183,7 @@ void ReportDiagnostic() { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FixFormattingOfCallChain, + FormattingDiagnosticRules.FixFormattingOfCallChain, expression); } } diff --git a/src/Formatting.Analyzers/CSharp/FixFormattingOfListAnalyzer.cs b/src/Formatting.Analyzers/CSharp/FixFormattingOfListAnalyzer.cs index e9566a80b0..9087e6b2c1 100644 --- a/src/Formatting.Analyzers/CSharp/FixFormattingOfListAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/FixFormattingOfListAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.FixFormattingOfList); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.FixFormattingOfList); return _supportedDiagnostics; } @@ -248,7 +248,7 @@ void ReportDiagnostic() { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FixFormattingOfList, + FormattingDiagnosticRules.FixFormattingOfList, Location.Create(first.SyntaxTree, nodes.Span), GetTitle()); } diff --git a/src/Formatting.Analyzers/CSharp/FormatAccessorBracesAnalyzer.cs b/src/Formatting.Analyzers/CSharp/FormatAccessorBracesAnalyzer.cs index 1073331568..3db05762a8 100644 --- a/src/Formatting.Analyzers/CSharp/FormatAccessorBracesAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/FormatAccessorBracesAnalyzer.cs @@ -25,8 +25,8 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.FormatAccessorBraces, - DiagnosticRules.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine); + FormattingDiagnosticRules.FormatAccessorBraces, + FormattingDiagnosticRules.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine); } return _supportedDiagnostics; @@ -60,13 +60,13 @@ private static void AnalyzeAccessorDeclaration(SyntaxNodeAnalysisContext context if (openBrace.IsMissing) return; - if (DiagnosticRules.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine.IsEffective(context) + if (FormattingDiagnosticRules.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine.IsEffective(context) && accessor.SyntaxTree.IsMultiLineSpan(TextSpan.FromBounds(accessor.Keyword.SpanStart, accessor.Span.End)) && CanBeMadeSingleLine(accessor)) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine, + FormattingDiagnosticRules.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine, accessor); } @@ -82,7 +82,7 @@ private static void AnalyzeAccessorDeclaration(SyntaxNodeAnalysisContext context { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FormatAccessorBraces, + FormattingDiagnosticRules.FormatAccessorBraces, block.OpenBraceToken, "multiple lines"); } @@ -92,7 +92,7 @@ private static void AnalyzeAccessorDeclaration(SyntaxNodeAnalysisContext context { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FormatAccessorBraces, + FormattingDiagnosticRules.FormatAccessorBraces, block.OpenBraceToken, "a single line"); } diff --git a/src/Formatting.Analyzers/CSharp/FormatBlockBracesAnalyzer.cs b/src/Formatting.Analyzers/CSharp/FormatBlockBracesAnalyzer.cs index c08a5f662c..c235bd8469 100644 --- a/src/Formatting.Analyzers/CSharp/FormatBlockBracesAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/FormatBlockBracesAnalyzer.cs @@ -24,8 +24,8 @@ public override ImmutableArray SupportedDiagnostics { Immutable.InterlockedInitialize( ref _supportedDiagnostics, - DiagnosticRules.FormatBlockBraces, - DiagnosticRules.AddNewLineAfterOpeningBraceOfEmptyBlock); + FormattingDiagnosticRules.FormatBlockBraces, + FormattingDiagnosticRules.AddNewLineAfterOpeningBraceOfEmptyBlock); } return _supportedDiagnostics; @@ -54,12 +54,12 @@ private static void AnalyzeBlock(SyntaxNodeAnalysisContext context) if (openBrace.IsMissing) return; - if (DiagnosticRules.AddNewLineAfterOpeningBraceOfEmptyBlock.IsEffective(context) + if (FormattingDiagnosticRules.AddNewLineAfterOpeningBraceOfEmptyBlock.IsEffective(context) && block.SyntaxTree.IsSingleLineSpan(block.Span)) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.AddNewLineAfterOpeningBraceOfEmptyBlock, + FormattingDiagnosticRules.AddNewLineAfterOpeningBraceOfEmptyBlock, Location.Create(block.SyntaxTree, new TextSpan(openBrace.Span.End, 0))); } @@ -75,7 +75,7 @@ private static void AnalyzeBlock(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FormatBlockBraces, + FormattingDiagnosticRules.FormatBlockBraces, block.OpenBraceToken, "multiple lines"); } @@ -85,7 +85,7 @@ private static void AnalyzeBlock(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FormatBlockBraces, + FormattingDiagnosticRules.FormatBlockBraces, block.OpenBraceToken, "a single line"); } diff --git a/src/Formatting.Analyzers/CSharp/FormatTypeDeclarationBracesAnalyzer.cs b/src/Formatting.Analyzers/CSharp/FormatTypeDeclarationBracesAnalyzer.cs index b15b8b7625..9863deb98e 100644 --- a/src/Formatting.Analyzers/CSharp/FormatTypeDeclarationBracesAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/FormatTypeDeclarationBracesAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.FormatTypeDeclarationBraces); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.FormatTypeDeclarationBraces); return _supportedDiagnostics; } @@ -63,7 +63,7 @@ private static void AnalyzeTypeDeclaration(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.FormatTypeDeclarationBraces, + FormattingDiagnosticRules.FormatTypeDeclarationBraces, openBrace); } } diff --git a/src/Formatting.Analyzers/CSharp/LineIsTooLongAnalyzer.cs b/src/Formatting.Analyzers/CSharp/LineIsTooLongAnalyzer.cs index c72bbfe6cd..2b6ab9875c 100644 --- a/src/Formatting.Analyzers/CSharp/LineIsTooLongAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/LineIsTooLongAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.LineIsTooLong); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, Roslynator.Formatting.CSharp.FormattingDiagnosticRules.LineIsTooLong); return _supportedDiagnostics; } @@ -203,7 +203,7 @@ private static void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context) DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.LineIsTooLong, + Roslynator.Formatting.CSharp.FormattingDiagnosticRules.LineIsTooLong, Location.Create(tree, line.Span), line.Span.Length); } diff --git a/src/Formatting.Analyzers/CSharp/NormalizeWhitespaceAtBeginningOfFileAnalyzer.cs b/src/Formatting.Analyzers/CSharp/NormalizeWhitespaceAtBeginningOfFileAnalyzer.cs index 52b0b4c867..21495b2fdd 100644 --- a/src/Formatting.Analyzers/CSharp/NormalizeWhitespaceAtBeginningOfFileAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/NormalizeWhitespaceAtBeginningOfFileAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.NormalizeWhitespaceAtBeginningOfFile); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.NormalizeWhitespaceAtBeginningOfFile); return _supportedDiagnostics; } @@ -64,7 +64,7 @@ static void ReportDiagnostic(SyntaxNodeAnalysisContext context, SyntaxToken toke { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.NormalizeWhitespaceAtBeginningOfFile, + FormattingDiagnosticRules.NormalizeWhitespaceAtBeginningOfFile, Location.Create(token.SyntaxTree, new TextSpan(0, 0))); } } diff --git a/src/Formatting.Analyzers/CSharp/NormalizeWhitespaceAtEndOfFileAnalyzer.cs b/src/Formatting.Analyzers/CSharp/NormalizeWhitespaceAtEndOfFileAnalyzer.cs index 42c736f3cf..6fa52e3a64 100644 --- a/src/Formatting.Analyzers/CSharp/NormalizeWhitespaceAtEndOfFileAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/NormalizeWhitespaceAtEndOfFileAnalyzer.cs @@ -22,7 +22,7 @@ public override ImmutableArray SupportedDiagnostics { if (_supportedDiagnostics.IsDefault) { - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.NormalizeWhitespaceAtEndOfFile); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.NormalizeWhitespaceAtEndOfFile); } return _supportedDiagnostics; @@ -128,7 +128,7 @@ private static void AnalyzeCompilationUnit(SyntaxNodeAnalysisContext context) static void ReportDiagnostic(SyntaxNodeAnalysisContext context, SyntaxToken eof) { - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.NormalizeWhitespaceAtEndOfFile, eof); + DiagnosticHelpers.ReportDiagnostic(context, FormattingDiagnosticRules.NormalizeWhitespaceAtEndOfFile, eof); } } } diff --git a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeArrowTokenAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeArrowTokenAnalyzer.cs index 5c90473abf..3938e19e7f 100644 --- a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeArrowTokenAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeArrowTokenAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken); return _supportedDiagnostics; } @@ -47,7 +47,7 @@ private static void AnalyzeArrowExpressionClause(SyntaxNodeAnalysisContext conte { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken, + FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken, block.GetLocation(), (newLinePosition == NewLinePosition.Before) ? "before" : "after"); } diff --git a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeBinaryOperatorAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeBinaryOperatorAnalyzer.cs index ffc6d29b20..120cc194ff 100644 --- a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeBinaryOperatorAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeBinaryOperatorAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics { if (_supportedDiagnostics.IsDefault) { - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator); } return _supportedDiagnostics; @@ -78,7 +78,7 @@ private static void AnalyzeBinaryExpression(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator, + FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator, block.GetLocation(), (block.First.IsToken) ? "before" : "after"); } diff --git a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeConditionalOperatorAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeConditionalOperatorAnalyzer.cs index b9019487a8..14ad86ddad 100644 --- a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeConditionalOperatorAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeConditionalOperatorAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator); return _supportedDiagnostics; } @@ -65,7 +65,7 @@ static void ReportDiagnostic( { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator, + FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator, block.GetLocation(), (block.First.IsToken) ? "before" : "after"); } diff --git a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeEqualsTokenAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeEqualsTokenAnalyzer.cs index 211224cc9f..36ca017278 100644 --- a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeEqualsTokenAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeEqualsTokenAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics { if (_supportedDiagnostics.IsDefault) { - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken); } return _supportedDiagnostics; @@ -107,7 +107,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context, SyntaxToken token { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken, + FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken, block.GetLocation(), (block.First.IsToken) ? "before" : "after"); } diff --git a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeNullConditionalOperatorAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeNullConditionalOperatorAnalyzer.cs index e0ca726f87..b378bf64be 100644 --- a/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeNullConditionalOperatorAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PlaceNewLineAfterOrBeforeNullConditionalOperatorAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics { if (_supportedDiagnostics.IsDefault) { - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PlaceNewLineAfterOrBeforeNullConditionalOperator); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeNullConditionalOperator); } return _supportedDiagnostics; @@ -57,7 +57,7 @@ private static void AnalyzeConditionalAccess(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PlaceNewLineAfterOrBeforeNullConditionalOperator, + FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeNullConditionalOperator, block.GetLocation(), (block.First.IsToken) ? "before" : "after"); } diff --git a/src/Formatting.Analyzers/CSharp/PutAttributeListOnItsOwnLineAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PutAttributeListOnItsOwnLineAnalyzer.cs index a0c1bb2a10..e9b545d658 100644 --- a/src/Formatting.Analyzers/CSharp/PutAttributeListOnItsOwnLineAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PutAttributeListOnItsOwnLineAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PutAttributeListOnItsOwnLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PutAttributeListOnItsOwnLine); return _supportedDiagnostics; } @@ -318,7 +318,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context, AttributeListSynt { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PutAttributeListOnItsOwnLine, + FormattingDiagnosticRules.PutAttributeListOnItsOwnLine, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/PutConstructorInitializerOnItsOwnLineAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PutConstructorInitializerOnItsOwnLineAnalyzer.cs index a22c89dcdc..5ed990a94e 100644 --- a/src/Formatting.Analyzers/CSharp/PutConstructorInitializerOnItsOwnLineAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PutConstructorInitializerOnItsOwnLineAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PutConstructorInitializerOnItsOwnLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PutConstructorInitializerOnItsOwnLine); return _supportedDiagnostics; } @@ -45,7 +45,7 @@ private static void AnalyzeConstructorInitializer(SyntaxNodeAnalysisContext cont { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PutConstructorInitializerOnItsOwnLine, + FormattingDiagnosticRules.PutConstructorInitializerOnItsOwnLine, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/PutEmbeddedStatementOnItsOwnLineAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PutEmbeddedStatementOnItsOwnLineAnalyzer.cs index 0f0fd4a26a..24c17a3234 100644 --- a/src/Formatting.Analyzers/CSharp/PutEmbeddedStatementOnItsOwnLineAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PutEmbeddedStatementOnItsOwnLineAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PutEmbeddedStatementOnItsOwnLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PutEmbeddedStatementOnItsOwnLine); return _supportedDiagnostics; } @@ -127,7 +127,7 @@ private static void ReportDiagnostic(SyntaxNodeAnalysisContext context, TriviaBl { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PutEmbeddedStatementOnItsOwnLine, + FormattingDiagnosticRules.PutEmbeddedStatementOnItsOwnLine, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/PutEnumMemberOnItsOwnLineAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PutEnumMemberOnItsOwnLineAnalyzer.cs index ed3e57ab00..1e3d071ee4 100644 --- a/src/Formatting.Analyzers/CSharp/PutEnumMemberOnItsOwnLineAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PutEnumMemberOnItsOwnLineAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PutEnumMemberOnItsOwnLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PutEnumMemberOnItsOwnLine); return _supportedDiagnostics; } @@ -47,7 +47,7 @@ private static void AnalyzeEnumDeclaration(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PutEnumMemberOnItsOwnLine, + FormattingDiagnosticRules.PutEnumMemberOnItsOwnLine, block.GetLocation()); } diff --git a/src/Formatting.Analyzers/CSharp/PutInitializerOnSingleLineAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PutInitializerOnSingleLineAnalyzer.cs index 51ceb4754d..2ccc3853c4 100644 --- a/src/Formatting.Analyzers/CSharp/PutInitializerOnSingleLineAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PutInitializerOnSingleLineAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PutInitializerOnSingleLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PutInitializerOnSingleLine); return _supportedDiagnostics; } @@ -74,6 +74,6 @@ private static void AnalyzeInitializerExpression(SyntaxNodeAnalysisContext conte if (!initializer.OpenBraceToken.GetPreviousToken().TrailingTrivia.IsEmptyOrWhitespace()) return; - DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.PutInitializerOnSingleLine, initializer); + DiagnosticHelpers.ReportDiagnostic(context, FormattingDiagnosticRules.PutInitializerOnSingleLine, initializer); } } diff --git a/src/Formatting.Analyzers/CSharp/PutStatementOnItsOwnLineAnalyzer.cs b/src/Formatting.Analyzers/CSharp/PutStatementOnItsOwnLineAnalyzer.cs index fb8c6f1a27..66bfdc9d44 100644 --- a/src/Formatting.Analyzers/CSharp/PutStatementOnItsOwnLineAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/PutStatementOnItsOwnLineAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PutStatementOnItsOwnLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PutStatementOnItsOwnLine); return _supportedDiagnostics; } @@ -70,7 +70,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context, SyntaxList SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.PutTypeParameterConstraintOnItsOwnLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.PutTypeParameterConstraintOnItsOwnLine); return _supportedDiagnostics; } @@ -104,7 +104,7 @@ private static void Analyze( { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.PutTypeParameterConstraintOnItsOwnLine, + FormattingDiagnosticRules.PutTypeParameterConstraintOnItsOwnLine, block.GetLocation()); } diff --git a/src/Formatting.Analyzers/CSharp/RemoveNewLineBeforeBaseListAnalyzer.cs b/src/Formatting.Analyzers/CSharp/RemoveNewLineBeforeBaseListAnalyzer.cs index aa7ec8eac2..f0676a2bef 100644 --- a/src/Formatting.Analyzers/CSharp/RemoveNewLineBeforeBaseListAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/RemoveNewLineBeforeBaseListAnalyzer.cs @@ -19,7 +19,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.RemoveNewLineBeforeBaseList); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.RemoveNewLineBeforeBaseList); return _supportedDiagnostics; } @@ -85,7 +85,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context, BaseListSyntax ba { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.RemoveNewLineBeforeBaseList, + FormattingDiagnosticRules.RemoveNewLineBeforeBaseList, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/RemoveNewLineBetweenIfKeywordAndElseKeywordAnalyzer.cs b/src/Formatting.Analyzers/CSharp/RemoveNewLineBetweenIfKeywordAndElseKeywordAnalyzer.cs index cf18ecf3f3..7f693de1ea 100644 --- a/src/Formatting.Analyzers/CSharp/RemoveNewLineBetweenIfKeywordAndElseKeywordAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/RemoveNewLineBetweenIfKeywordAndElseKeywordAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.RemoveNewLineBetweenIfKeywordAndElseKeyword); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.RemoveNewLineBetweenIfKeywordAndElseKeyword); return _supportedDiagnostics; } @@ -52,7 +52,7 @@ private static void AnalyzeElseClause(SyntaxNodeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.RemoveNewLineBetweenIfKeywordAndElseKeyword, + FormattingDiagnosticRules.RemoveNewLineBetweenIfKeywordAndElseKeyword, block.GetLocation()); } } diff --git a/src/Formatting.Analyzers/CSharp/RequiredConfigOptionNotSetAnalyzer.cs b/src/Formatting.Analyzers/CSharp/RequiredConfigOptionNotSetAnalyzer.cs index 78a95e86bf..27fcfba1a6 100644 --- a/src/Formatting.Analyzers/CSharp/RequiredConfigOptionNotSetAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/RequiredConfigOptionNotSetAnalyzer.cs @@ -42,13 +42,13 @@ public override void Initialize(AnalysisContext context) AnalyzerConfigOptions configOptions = context.GetConfigOptions(); - Validate(ref context, compilationOptions, configOptions, Flags.AddOrRemoveNewLineBeforeWhileInDoStatement, ref flags, DiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement, ConfigOptions.NewLineBeforeWhileInDoStatement); - Validate(ref context, compilationOptions, configOptions, Flags.BlankLineBetweenSingleLineAccessors, ref flags, DiagnosticRules.BlankLineBetweenSingleLineAccessors, ConfigOptions.BlankLineBetweenSingleLineAccessors); - Validate(ref context, compilationOptions, configOptions, Flags.BlankLineBetweenUsingDirectiveGroups, ref flags, DiagnosticRules.BlankLineBetweenUsingDirectives, ConfigOptions.BlankLineBetweenUsingDirectives); - Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeArrowToken, ref flags, DiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken, ConfigOptions.ArrowTokenNewLine); - Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeConditionalOperator, ref flags, DiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator, ConfigOptions.ConditionalOperatorNewLine); - Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeBinaryOperator, ref flags, DiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator, ConfigOptions.BinaryOperatorNewLine); - Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeEqualsToken, ref flags, DiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken, ConfigOptions.EqualsTokenNewLine); + Validate(ref context, compilationOptions, configOptions, Flags.AddOrRemoveNewLineBeforeWhileInDoStatement, ref flags, FormattingDiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement, ConfigOptions.NewLineBeforeWhileInDoStatement); + Validate(ref context, compilationOptions, configOptions, Flags.BlankLineBetweenSingleLineAccessors, ref flags, FormattingDiagnosticRules.BlankLineBetweenSingleLineAccessors, ConfigOptions.BlankLineBetweenSingleLineAccessors); + Validate(ref context, compilationOptions, configOptions, Flags.BlankLineBetweenUsingDirectiveGroups, ref flags, FormattingDiagnosticRules.BlankLineBetweenUsingDirectives, ConfigOptions.BlankLineBetweenUsingDirectives); + Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeArrowToken, ref flags, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken, ConfigOptions.ArrowTokenNewLine); + Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeConditionalOperator, ref flags, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator, ConfigOptions.ConditionalOperatorNewLine); + Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeBinaryOperator, ref flags, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator, ConfigOptions.BinaryOperatorNewLine); + Validate(ref context, compilationOptions, configOptions, Flags.PlaceNewLineAfterOrBeforeEqualsToken, ref flags, FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken, ConfigOptions.EqualsTokenNewLine); }); }); } diff --git a/src/Formatting.Analyzers/CSharp/UseSpacesInsteadOfTabAnalyzer.cs b/src/Formatting.Analyzers/CSharp/UseSpacesInsteadOfTabAnalyzer.cs index 4db7ea1461..c92ab98508 100644 --- a/src/Formatting.Analyzers/CSharp/UseSpacesInsteadOfTabAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/UseSpacesInsteadOfTabAnalyzer.cs @@ -21,7 +21,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.UseSpacesInsteadOfTab); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.UseSpacesInsteadOfTab); return _supportedDiagnostics; } @@ -81,7 +81,7 @@ public override void VisitTrivia(SyntaxTrivia trivia) while (i < text.Length && text[i] == '\t'); AnalysisContext.ReportDiagnostic( - DiagnosticRules.UseSpacesInsteadOfTab, + FormattingDiagnosticRules.UseSpacesInsteadOfTab, Location.Create(AnalysisContext.Tree, new TextSpan(trivia.SpanStart + index, i - index))); } } diff --git a/src/Formatting.Analyzers/CSharp/WrapAndIndentEachNodeInListAnalyzer.cs b/src/Formatting.Analyzers/CSharp/WrapAndIndentEachNodeInListAnalyzer.cs index e72c585c7e..d8ca7e319c 100644 --- a/src/Formatting.Analyzers/CSharp/WrapAndIndentEachNodeInListAnalyzer.cs +++ b/src/Formatting.Analyzers/CSharp/WrapAndIndentEachNodeInListAnalyzer.cs @@ -20,7 +20,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.WrapAndIndentEachNodeInList); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.WrapAndIndentEachNodeInList); return _supportedDiagnostics; } @@ -194,7 +194,7 @@ void ReportDiagnostic() { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.WrapAndIndentEachNodeInList, + FormattingDiagnosticRules.WrapAndIndentEachNodeInList, Location.Create(syntaxTree, TextSpan.FromBounds(nodes[0].SpanStart, nodes.Last().Span.End))); } } diff --git a/src/Formatting.Analyzers/UseCarriageReturnAndLinefeedAsNewLineAnalyzer.cs b/src/Formatting.Analyzers/UseCarriageReturnAndLinefeedAsNewLineAnalyzer.cs index d78c3d6208..124de8d63c 100644 --- a/src/Formatting.Analyzers/UseCarriageReturnAndLinefeedAsNewLineAnalyzer.cs +++ b/src/Formatting.Analyzers/UseCarriageReturnAndLinefeedAsNewLineAnalyzer.cs @@ -18,7 +18,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.UseCarriageReturnAndLinefeedAsNewLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.UseCarriageReturnAndLinefeedAsNewLine); return _supportedDiagnostics; } @@ -45,7 +45,7 @@ private static void Analyze(SyntaxTreeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.UseCarriageReturnAndLinefeedAsNewLine, + FormattingDiagnosticRules.UseCarriageReturnAndLinefeedAsNewLine, Location.Create(context.Tree, new TextSpan(end, 1))); } } diff --git a/src/Formatting.Analyzers/UseLinefeedAsNewLineAnalyzer.cs b/src/Formatting.Analyzers/UseLinefeedAsNewLineAnalyzer.cs index 7b47435172..79321ee38e 100644 --- a/src/Formatting.Analyzers/UseLinefeedAsNewLineAnalyzer.cs +++ b/src/Formatting.Analyzers/UseLinefeedAsNewLineAnalyzer.cs @@ -18,7 +18,7 @@ public override ImmutableArray SupportedDiagnostics get { if (_supportedDiagnostics.IsDefault) - Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.UseLinefeedAsNewLine); + Immutable.InterlockedInitialize(ref _supportedDiagnostics, FormattingDiagnosticRules.UseLinefeedAsNewLine); return _supportedDiagnostics; } @@ -46,7 +46,7 @@ private static void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context) { DiagnosticHelpers.ReportDiagnostic( context, - DiagnosticRules.UseLinefeedAsNewLine, + FormattingDiagnosticRules.UseLinefeedAsNewLine, Location.Create(context.Tree, new TextSpan(end, 2))); } } diff --git a/src/Tests/Analyzers.Tests/RCS1004RemoveBracesFromIfElseTests.cs b/src/Tests/Analyzers.Tests/RCS1004RemoveBracesFromIfElseTests.cs index 3f1d5790ea..0bf55ae59c 100644 --- a/src/Tests/Analyzers.Tests/RCS1004RemoveBracesFromIfElseTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1004RemoveBracesFromIfElseTests.cs @@ -12,7 +12,7 @@ public class RCS1004RemoveBracesFromIfElseTests : AbstractCSharpDiagnosticVerifi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveBracesFromIfElse; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBracesFromIfElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveBracesFromIfElse)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -48,7 +48,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBracesFromIfElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveBracesFromIfElse)] public async Task Test2() { await VerifyDiagnosticAndFixAsync(@" @@ -84,7 +84,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBracesFromIfElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveBracesFromIfElse)] public async Task TestNoDiagnostic_SimpleIfInsideIfWithElse() { await VerifyNoDiagnosticAsync(@" @@ -107,7 +107,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBracesFromIfElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveBracesFromIfElse)] public async Task TestNoDiagnostic_SimpleIfInsideIfWithElse2() { await VerifyNoDiagnosticAsync(@" @@ -130,7 +130,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBracesFromIfElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveBracesFromIfElse)] public async Task TestNoDiagnostic_CommentAboveStatement() { await VerifyNoDiagnosticAsync(@" @@ -152,7 +152,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBracesFromIfElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveBracesFromIfElse)] public async Task TestNoDiagnostic_CommentBelowStatement() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1005SimplifyNestedUsingStatementTests.cs b/src/Tests/Analyzers.Tests/RCS1005SimplifyNestedUsingStatementTests.cs index 0caf8b8049..63bc0068c3 100644 --- a/src/Tests/Analyzers.Tests/RCS1005SimplifyNestedUsingStatementTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1005SimplifyNestedUsingStatementTests.cs @@ -12,7 +12,7 @@ public class RCS1005SimplifyNestedUsingStatementTests : AbstractCSharpDiagnostic { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyNestedUsingStatement; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNestedUsingStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNestedUsingStatement)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -56,7 +56,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNestedUsingStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNestedUsingStatement)] public async Task Test_OpenBraceAtTheEndOfLine() { await VerifyDiagnosticAndFixAsync(@" @@ -98,7 +98,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNestedUsingStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNestedUsingStatement)] public async Task TestNoDiagnostic_MultipleStatement() { await VerifyNoDiagnosticAsync(@" @@ -124,7 +124,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNestedUsingStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNestedUsingStatement)] public async Task TestNoDiagnostic_WithComment() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1007AddBracesTests.cs b/src/Tests/Analyzers.Tests/RCS1007AddBracesTests.cs index c4d0828dab..7a7635280e 100644 --- a/src/Tests/Analyzers.Tests/RCS1007AddBracesTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1007AddBracesTests.cs @@ -12,7 +12,7 @@ public class RCS1007AddBracesTests : AbstractCSharpDiagnosticVerifier x) ", options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task Test_CollectionExpressionToImplicit_NotArray() { await VerifyNoDiagnosticAsync(@" @@ -504,7 +504,7 @@ void M(List x) .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task Test_CollectionExpressionToImplicit_EmptyArray() { await VerifyDiagnosticAndFixAsync(""" @@ -541,7 +541,7 @@ void M2() .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task Test_CollectionExpressionToExplicit_EmptyArray() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1014UseImplicitlyTypedArrayTests.cs b/src/Tests/Analyzers.Tests/RCS1014UseImplicitlyTypedArrayTests.cs index 8faf890acb..1570e46ed8 100644 --- a/src/Tests/Analyzers.Tests/RCS1014UseImplicitlyTypedArrayTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1014UseImplicitlyTypedArrayTests.cs @@ -12,7 +12,7 @@ public class RCS1014UseImplicitlyTypedArrayTests : AbstractCSharpDiagnosticVerif { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseExplicitlyOrImplicitlyTypedArray; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task Test() { await VerifyDiagnosticAndFixAsync(""" @@ -34,7 +34,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task Test_TypeIsNotObvious() { await VerifyDiagnosticAndFixAsync(@" @@ -60,7 +60,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task Test_TypeIsObvious() { await VerifyDiagnosticAndFixAsync(""" @@ -82,7 +82,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task Test_TypesAreNotEqual() { await VerifyNoDiagnosticAsync(@" @@ -108,7 +108,7 @@ class B : A ", options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task Test_NestedArray() { await VerifyDiagnosticAndFixAsync(""" @@ -130,7 +130,7 @@ class C """, options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task TestNoDiagnostic_TypeIsObvious() { await VerifyNoDiagnosticAsync(""" @@ -150,7 +150,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task TestNoDiagnostic_NoInitializer() { await VerifyNoDiagnosticAsync(@" @@ -164,7 +164,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task TestNoDiagnostic_ArrayInitializer_DerivedType() { await VerifyNoDiagnosticAsync(@" @@ -182,7 +182,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ArrayCreationTypeStyle, ConfigOptionValues.ArrayCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitlyOrImplicitlyTypedArray)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitlyOrImplicitlyTypedArray)] public async Task TestNoDiagnostic_UseVarInsteadOfObjectCreation() { await VerifyNoDiagnosticAsync(@" @@ -197,7 +197,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_UseVarInsteadOfImplicitCreation() { await VerifyDiagnosticAndFixAsync(""" @@ -232,7 +232,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task TestNoDiagnostic_UseVarInsteadOfImplicitCreation() { await VerifyNoDiagnosticAsync(""" @@ -252,7 +252,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task TestNoDiagnostic_UseVarInsteadOfImplicitCreation_CollectionExpression() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1015UseNameOfOperatorTests.cs b/src/Tests/Analyzers.Tests/RCS1015UseNameOfOperatorTests.cs index 4ceea511b8..f30b1265da 100644 --- a/src/Tests/Analyzers.Tests/RCS1015UseNameOfOperatorTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1015UseNameOfOperatorTests.cs @@ -12,7 +12,7 @@ public class RCS1015UseNameOfOperatorTests : AbstractCSharpDiagnosticVerifier _options_ConvertExpressionBodyToBlockBodyWhenDeclarationIsMultiLine ??= Options.EnableConfigOption(ConfigOptionKeys.UseBlockBodyWhenDeclarationSpansOverMultipleLines); - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Method_MultilineExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -49,7 +49,7 @@ string M(object x, object y) ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Method_MultilineExpression2() { await VerifyDiagnosticAndFixAsync(@" @@ -73,7 +73,7 @@ string M(object x, object y) ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Method_MultilineExpression_NoIndentation() { await VerifyDiagnosticAndFixAsync(@" @@ -97,7 +97,7 @@ string M(object x, object y) ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Method_MultilineExpression_IndentationsDiffer() { await VerifyDiagnosticAndFixAsync(@" @@ -123,7 +123,7 @@ string M(object x, object y, object z) ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_LocalFunction_MultilineExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -156,7 +156,7 @@ string LF() ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetter_MultilineExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -186,7 +186,7 @@ string P ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetter_MultilineDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -215,7 +215,7 @@ class C ", options: Options_ConvertExpressionBodyToBlockBodyWhenDeclarationIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetterAndSetter_MultilineExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -256,7 +256,7 @@ public string P ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetterAndInitSetter() { await VerifyDiagnosticAndFixAsync(@" @@ -291,7 +291,7 @@ public string P ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine.AddAllowedCompilerDiagnosticId("CS0518")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Method_MultilineDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -314,7 +314,7 @@ string M( ", options: Options_ConvertExpressionBodyToBlockBodyWhenDeclarationIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Method_Multiline_WithComment() { await VerifyDiagnosticAndFixAsync(@" @@ -338,7 +338,7 @@ object M(string p) ", options: Options_ConvertExpressionBodyToBlockBodyWhenDeclarationIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_PreprocessorDirective() { await VerifyNoDiagnosticAsync(@" @@ -354,7 +354,7 @@ string M() => ", options: Options_ConvertExpressionBodyToBlockBodyWhenExpressionIsMultiLine); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_MethodWithAttributes() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1016UseExpressionBodyTests.cs b/src/Tests/Analyzers.Tests/RCS1016UseExpressionBodyTests.cs index 74d2071d90..d0619a3718 100644 --- a/src/Tests/Analyzers.Tests/RCS1016UseExpressionBodyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1016UseExpressionBodyTests.cs @@ -12,7 +12,7 @@ public class RCS1016UseExpressionBodyTests : AbstractCSharpDiagnosticVerifier M( ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Method_MultilineExpression2() { await VerifyDiagnosticAndFixAsync(@" @@ -125,7 +125,7 @@ string M(object x, object y, object z) => M( ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_VoidMethod() { await VerifyDiagnosticAndFixAsync(@" @@ -144,7 +144,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_LocalFunction() { await VerifyDiagnosticAndFixAsync(@" @@ -169,7 +169,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_LocalFunction_MultilineExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -202,7 +202,7 @@ string LF() => M( ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_VoidLocalFunction() { await VerifyDiagnosticAndFixAsync(@" @@ -227,7 +227,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetter() { await VerifyDiagnosticAndFixAsync(@" @@ -246,7 +246,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetter_MultilineExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -276,7 +276,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetterAndSetter() { await VerifyDiagnosticAndFixAsync(@" @@ -317,7 +317,7 @@ public string P ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetterAndInitSetter() { await VerifyDiagnosticAndFixAsync(@" @@ -358,7 +358,7 @@ public string P ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression).AddAllowedCompilerDiagnosticId("CS0518")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_IndexerWithGetter() { await VerifyDiagnosticAndFixAsync(@" @@ -377,7 +377,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_IndexerWithGetterAndSetter() { await VerifyDiagnosticAndFixAsync(@" @@ -405,7 +405,7 @@ string this[int index] ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Operator() { await VerifyDiagnosticAndFixAsync(@" @@ -424,7 +424,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_ConversionOperator() { await VerifyDiagnosticAndFixAsync(@" @@ -443,7 +443,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Constructor_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -466,7 +466,7 @@ void M() { } ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Destructor_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -485,7 +485,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Method_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -504,7 +504,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_VoidMethod_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -523,7 +523,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_LocalFunction_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -548,7 +548,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_VoidLocalFunction_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -573,7 +573,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetter_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -592,7 +592,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_PropertyWithGetterAndSetter_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -620,7 +620,7 @@ public string P ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_IndexerWithGetter_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -639,7 +639,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_IndexerWithGetterAndSetter_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -667,7 +667,7 @@ string this[int index] ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_Operator_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -686,7 +686,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task Test_ConversionOperator_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -705,7 +705,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_MethodWithMultipleStatements() { await VerifyNoDiagnosticAsync(@" @@ -720,7 +720,7 @@ string M() ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_MethodWithLocalFunction() { await VerifyNoDiagnosticAsync(@" @@ -734,7 +734,7 @@ void LF() { } ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_VoidMethodWithNoStatements() { await VerifyNoDiagnosticAsync(@" @@ -747,7 +747,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_VoidMethodWithMultipleStatements() { await VerifyNoDiagnosticAsync(@" @@ -762,7 +762,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_MethodWithMultilineStatement() { await VerifyNoDiagnosticAsync(""" @@ -777,7 +777,7 @@ string M() """, options: Options.EnableConfigOption(ConfigOptionKeys.UseBlockBodyWhenExpressionSpansOverMultipleLines)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_PropertyWithMultipleStatement() { await VerifyNoDiagnosticAsync(@" @@ -797,7 +797,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_PropertyInvalidStatement() { await VerifyNoDiagnosticAsync(@" @@ -813,7 +813,7 @@ string P .AddAllowedCompilerDiagnosticId(CompilerDiagnosticIdentifiers.CS0161_NotAllCodePathsReturnValue)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_AccessorWithAttribute() { await VerifyNoDiagnosticAsync(@" @@ -833,7 +833,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_IndexerWithMultipleStatements() { await VerifyNoDiagnosticAsync(@" @@ -855,7 +855,7 @@ string this[int index] ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_ExpressionBody() { await VerifyNoDiagnosticAsync(@" @@ -904,7 +904,7 @@ public string P2 ", options: Options.AddConfigOption(ConfigOptionKeys.BodyStyle, ConfigOptionValues.BodyStyle_Expression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_LanguageVersion() { await VerifyNoDiagnosticAsync(@" @@ -918,7 +918,7 @@ string M() ", options: WellKnownCSharpTestOptions.Default_CSharp5); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseBlockBodyOrExpressionBody)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseBlockBodyOrExpressionBody)] public async Task TestNoDiagnostic_PreprocessorDirective() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1018AddAccessibilityModifiersTests.cs b/src/Tests/Analyzers.Tests/RCS1018AddAccessibilityModifiersTests.cs index 58e8b43d36..a72c798b6e 100644 --- a/src/Tests/Analyzers.Tests/RCS1018AddAccessibilityModifiersTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1018AddAccessibilityModifiersTests.cs @@ -12,7 +12,7 @@ public class RCS1018AddAccessibilityModifiersTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddOrRemoveAccessibilityModifiers; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_NonNestedType() { await VerifyDiagnosticAndFixAsync(@" @@ -54,7 +54,7 @@ internal struct S { } ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_MemberDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -142,7 +142,7 @@ private object this[int index] ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_OperatorDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -198,7 +198,7 @@ public static explicit operator string(C value) ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit).AddAllowedCompilerDiagnosticId(CompilerDiagnosticIdentifiers.CS0558_UserDefinedOperatorMustBeDeclaredStaticAndPublic)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass() { await VerifyDiagnosticAndFixAsync(@" @@ -234,7 +234,7 @@ partial void M() ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass2() { await VerifyDiagnosticAndFixAsync(@" @@ -270,7 +270,7 @@ protected internal partial interface S { } ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass3() { await VerifyDiagnosticAndFixAsync(@" @@ -290,7 +290,7 @@ internal protected partial class C { } ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass4() { await VerifyDiagnosticAndFixAsync(@" @@ -310,7 +310,7 @@ protected partial class C { } ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass5() { await VerifyDiagnosticAndFixAsync(@" @@ -330,7 +330,7 @@ internal partial class C { } ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass6() { await VerifyDiagnosticAndFixAsync(@" @@ -350,7 +350,7 @@ internal partial class C { } ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass7() { await VerifyDiagnosticAndFixAsync(@" @@ -370,7 +370,7 @@ private partial class C { } ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass8() { await VerifyDiagnosticAndFixAsync(@" @@ -404,7 +404,7 @@ public class C3 : C ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task TestNoDiagnostic_StaticConstructor() { await VerifyNoDiagnosticAsync(@" @@ -417,7 +417,7 @@ static C() ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task TestNoDiagnostic_Destructor() { await VerifyNoDiagnosticAsync(@" @@ -430,7 +430,7 @@ public class C ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, "implicit")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task TestNoDiagnostic_ExplicitInterfaceImplementation() { await VerifyNoDiagnosticAsync(@" @@ -475,7 +475,7 @@ object I.this[int index] ", options: Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task TestNoDiagnostic_FileAccessModifier() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1018RemoveAccessibilityModifiersTests.cs b/src/Tests/Analyzers.Tests/RCS1018RemoveAccessibilityModifiersTests.cs index 7a72f3c99c..ceacd81fde 100644 --- a/src/Tests/Analyzers.Tests/RCS1018RemoveAccessibilityModifiersTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1018RemoveAccessibilityModifiersTests.cs @@ -17,7 +17,7 @@ public override CSharpTestOptions Options get { return base.Options.AddConfigOption(ConfigOptionKeys.AccessibilityModifiers, ConfigOptionValues.AccessibilityModifiers_Implicit); } } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_NonNestedType() { await VerifyDiagnosticAndFixAsync(@" @@ -59,7 +59,7 @@ struct S { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_MemberDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -147,7 +147,7 @@ object this[int index] "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass() { await VerifyDiagnosticAndFixAsync(@" @@ -175,7 +175,7 @@ partial class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task Test_PartialClass2() { await VerifyDiagnosticAndFixAsync(@" @@ -203,7 +203,7 @@ partial class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveAccessibilityModifiers)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveAccessibilityModifiers)] public async Task TestNoDiagnostic_OperatorDeclaration() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1019OrderModifiersTests.cs b/src/Tests/Analyzers.Tests/RCS1019OrderModifiersTests.cs index e03b428f9b..155626fe47 100644 --- a/src/Tests/Analyzers.Tests/RCS1019OrderModifiersTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1019OrderModifiersTests.cs @@ -12,7 +12,7 @@ public class RCS1019OrderModifiersTests : AbstractCSharpDiagnosticVerifier M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task Test_YieldReturnExpression_NoSpace() { await VerifyDiagnosticAndFixAsync(@" @@ -150,7 +150,7 @@ IEnumerable M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task Test_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -166,7 +166,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task Test_AwaitExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -194,7 +194,7 @@ async Task FooAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task Test_AwaitExpression_NoSpace() { await VerifyDiagnosticAndFixAsync(@" @@ -222,7 +222,7 @@ async Task FooAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task Test_ArrayRankSpecifier() { await VerifyDiagnosticAndFixAsync(@" @@ -244,7 +244,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] [InlineData("while ([|(|]true)) { }", "while (true) { }")] [InlineData("do { } while ([|(|]true));", "do { } while (true);")] [InlineData("using ([|(|](IDisposable)null)) { }", "using ((IDisposable)null) { }")] @@ -285,7 +285,7 @@ void M(string s) ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] [InlineData("f = ![|(|]f);", "f = !f;")] [InlineData(@"f = ![|(|]s.StartsWith(""""));", @"f = !s.StartsWith("""");")] [InlineData("f = ![|(|]foo.Value);", "f = !foo.Value;")] @@ -314,7 +314,7 @@ public bool this[int i] ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] [InlineData("[|(|]f) == [|(|]true)", "f == true")] [InlineData("[|(|]f) != [|(|]true)", "f != true")] public async Task Test_EqualsNotEquals(string source, string expected) @@ -332,7 +332,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] [InlineData("[|(|]i) > [|(|]0)", "i > 0")] [InlineData("[|(|]i) >= [|(|]0)", "i >= 0")] [InlineData("[|(|]i) < [|(|]0)", "i < 0")] @@ -352,7 +352,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] [InlineData("[|(|]i) * [|(|]0)", "i * 0")] [InlineData("[|(|]i) % [|(|]0)", "i % 0")] [InlineData("[|(|]i) / [|(|]0)", "i / 0")] @@ -382,7 +382,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] [InlineData("[|(|]i * 0) * i", "i * 0 * i")] [InlineData("[|(|]i % 0) % i", "i % 0 % i")] [InlineData("[|(|]i / 0) / i", "i / 0 / i")] @@ -412,7 +412,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestDiagnostic_LambdaInArgument() { await VerifyDiagnosticAndFixAsync(@" @@ -440,7 +440,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestNoDiagnostic_AssignmentInInitializer() { await VerifyNoDiagnosticAsync(""" @@ -457,7 +457,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestNoDiagnostic_ConditionalExpressionInInterpolatedString() { await VerifyNoDiagnosticAsync(""" @@ -471,7 +471,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestNoDiagnostic_AssignmentInAwaitExpression() { await VerifyNoDiagnosticAsync(@" @@ -485,7 +485,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestNoDiagnostic_ForEach() { await VerifyNoDiagnosticAsync(@" @@ -508,7 +508,7 @@ void M(IEnumerable items) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestNoDiagnostic_BinaryExpressionChain_ParenthesizedRight() { await VerifyNoDiagnosticAsync(@" @@ -538,7 +538,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestNoDiagnostic_AliasQualifiedNameInInterpolatedString() { await VerifyNoDiagnosticAsync(""" @@ -569,7 +569,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestNoDiagnostic_SwitchExpressionInsideAwaitExpression() { await VerifyNoDiagnosticAsync(""" @@ -592,7 +592,7 @@ async Task M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantParentheses)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantParentheses)] public async Task TestNoDiagnostic_GrammarAmbiguity() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1036RemoveUnnecessaryBlankLineTests.cs b/src/Tests/Analyzers.Tests/RCS1036RemoveUnnecessaryBlankLineTests.cs index 93cc914e34..f16f128363 100644 --- a/src/Tests/Analyzers.Tests/RCS1036RemoveUnnecessaryBlankLineTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1036RemoveUnnecessaryBlankLineTests.cs @@ -12,7 +12,7 @@ public class RCS1036RemoveUnnecessaryBlankLineTests : AbstractCSharpDiagnosticVe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveUnnecessaryBlankLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_ObjectInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -50,7 +50,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_ObjectInitializer_WithTrailingComma() { await VerifyDiagnosticAndFixAsync(@" @@ -88,7 +88,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_ArrayInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -120,7 +120,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_CollectionInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -156,7 +156,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EmptyDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -171,7 +171,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EmptyBlock() { await VerifyDiagnosticAndFixAsync(@" @@ -192,7 +192,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EmptyLineAfterDocComment() { await VerifyDiagnosticAndFixAsync(@" @@ -215,7 +215,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EndOfFile() { await VerifyDiagnosticAndFixAsync(@" @@ -230,7 +230,7 @@ class C ", options: Options.EnableConfigOption(ConfigOptionKeys.BlankLineBetweenClosingBraceAndSwitchSection)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EndOfFile2() { await VerifyDiagnosticAndFixAsync(@" @@ -246,7 +246,7 @@ class C ", options: Options.EnableConfigOption(ConfigOptionKeys.BlankLineBetweenClosingBraceAndSwitchSection)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_LastEmptyLineInDoStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -275,7 +275,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EmptyLineAfterLastEnumMember_NoTrailingComma() { await VerifyDiagnosticAndFixAsync(@" @@ -300,7 +300,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EmptyLineAfterLastEnumMember_TrailingComma() { await VerifyDiagnosticAndFixAsync(@" @@ -325,7 +325,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EmptyLineBeforeFirstEnumMember() { await VerifyDiagnosticAndFixAsync(@" @@ -350,7 +350,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_ObjectInitializer() { await VerifyNoDiagnosticAsync(@" @@ -371,7 +371,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_ObjectInitializer_Singleline() { await VerifyNoDiagnosticAsync(@" @@ -388,7 +388,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_ObjectInitializer_Empty() { await VerifyNoDiagnosticAsync(@" @@ -402,7 +402,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_EmptyLineBetweenClosingBraceAndSwitchSection() { await VerifyNoDiagnosticAsync(""" @@ -428,7 +428,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_EmptyLineAtEndOfFile() { await VerifyNoDiagnosticAsync(@" @@ -438,7 +438,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_EmptyLineAtEndOfFileAfterMultiLineComment() { await VerifyNoDiagnosticAsync(@" @@ -449,7 +449,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_EmptyLineAtEndOfFileWithWhitespace() { await VerifyNoDiagnosticAsync(@" @@ -459,7 +459,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_EmptyLineAtEndOfFileAfterSingleLineComment() { await VerifyNoDiagnosticAsync(@" @@ -470,7 +470,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task TestNoDiagnostic_EmptyLineAtEndOfFileAfterPreprocessorDirective() { await VerifyNoDiagnosticAsync(@" @@ -482,7 +482,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBlankLine)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBlankLine)] public async Task Test_EmptyLineBetweenClosingBraceAndSwitchSection() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1037RemoveTrailingWhitespaceTests.cs b/src/Tests/Analyzers.Tests/RCS1037RemoveTrailingWhitespaceTests.cs index 8261ec5047..ad5c56c24d 100644 --- a/src/Tests/Analyzers.Tests/RCS1037RemoveTrailingWhitespaceTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1037RemoveTrailingWhitespaceTests.cs @@ -12,7 +12,7 @@ public class RCS1037RemoveTrailingWhitespaceTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveTrailingWhitespace; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveTrailingWhitespace)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveTrailingWhitespace)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@"[| |] @@ -29,7 +29,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveTrailingWhitespace)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveTrailingWhitespace)] public async Task Test_DocumentationComment() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1040RemoveEmptyElseClauseTests.cs b/src/Tests/Analyzers.Tests/RCS1040RemoveEmptyElseClauseTests.cs index cb1c5e0642..f09e73bb4c 100644 --- a/src/Tests/Analyzers.Tests/RCS1040RemoveEmptyElseClauseTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1040RemoveEmptyElseClauseTests.cs @@ -12,7 +12,7 @@ public class RCS1040RemoveEmptyElseClauseTests : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveEmptyElseClause; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyElseClause)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyElseClause)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -45,7 +45,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyElseClause)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyElseClause)] public async Task TestNoDiagnostic_ElseIf() { await VerifyNoDiagnosticAsync(@" @@ -66,7 +66,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyElseClause)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyElseClause)] public async Task TestNoDiagnostic_NonEmptyElse() { await VerifyNoDiagnosticAsync(@" @@ -88,7 +88,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyElseClause)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyElseClause)] public async Task TestNoDiagnostic_IfElseEmbeddedInIfWithElse() { await VerifyNoDiagnosticAsync(@" @@ -109,7 +109,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyElseClause)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyElseClause)] public async Task TestNoDiagnostic_IfElseEmbeddedInIfWithElse2() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1041RemoveEmptyInitializerTests.cs b/src/Tests/Analyzers.Tests/RCS1041RemoveEmptyInitializerTests.cs index ff4f1882ea..bd24960661 100644 --- a/src/Tests/Analyzers.Tests/RCS1041RemoveEmptyInitializerTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1041RemoveEmptyInitializerTests.cs @@ -12,7 +12,7 @@ public class RCS1041RemoveEmptyInitializerTests : AbstractCSharpDiagnosticVerifi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveEmptyInitializer; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyInitializer)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyInitializer)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -34,7 +34,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyInitializer)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyInitializer)] public async Task TestNoDiagnostic_ExpressionTree() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1043RemovePartialModifierFromTypeWithSinglePartTests.cs b/src/Tests/Analyzers.Tests/RCS1043RemovePartialModifierFromTypeWithSinglePartTests.cs index 4a5fcf26c5..46d1d9bd4d 100644 --- a/src/Tests/Analyzers.Tests/RCS1043RemovePartialModifierFromTypeWithSinglePartTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1043RemovePartialModifierFromTypeWithSinglePartTests.cs @@ -12,7 +12,7 @@ public class RCS1043RemovePartialModifierFromTypeWithSinglePartTests : AbstractC { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemovePartialModifierFromTypeWithSinglePart; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task Test_Class() { await VerifyDiagnosticAndFixAsync(@" @@ -26,7 +26,7 @@ public class Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task Test_Interface() { await VerifyDiagnosticAndFixAsync(@" @@ -40,7 +40,7 @@ public interface Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task Test_Struct() { await VerifyDiagnosticAndFixAsync(@" @@ -54,7 +54,7 @@ public struct Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task Test_MultipleMethodsNestedInClass() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task Test_MultipleMethodsNestedInStruct() { await VerifyDiagnosticAndFixAsync(@" @@ -106,7 +106,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task TestNoDiagnostic_NoPartialModifier() { await VerifyNoDiagnosticAsync(@" @@ -116,7 +116,7 @@ public class Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task TestNoDiagnostic_MultipleClassesNestedInStaticClass() { await VerifyNoDiagnosticAsync(@" @@ -133,7 +133,7 @@ public partial class Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task TestNoDiagnostic_MultipleClassesNestedInStruct() { await VerifyNoDiagnosticAsync(@" @@ -150,7 +150,7 @@ public partial class Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task TestNoDiagnostic_MultipleInterfacesNestedInStaticClass() { await VerifyNoDiagnosticAsync(@" @@ -167,7 +167,7 @@ public partial interface Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task TestNoDiagnostic_MultipleInterfacesNestedInStruct() { await VerifyNoDiagnosticAsync(@" @@ -184,7 +184,7 @@ public partial interface Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task TestNoDiagnostic_MultipleNestedClassesWithSameName() { await VerifyNoDiagnosticAsync(@" @@ -212,7 +212,7 @@ private partial class Foo2 "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task TestNoDiagnostic_InheritsFromAspNetCoreComponentBase() { await VerifyNoDiagnosticAsync(@" @@ -229,7 +229,7 @@ class ComponentBase "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemovePartialModifierFromTypeWithSinglePart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemovePartialModifierFromTypeWithSinglePart)] public async Task TestNoDiagnostic_InheritsFromWpfComponentBase() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1044RemoveOriginalExceptionFromThrowStatementTests.cs b/src/Tests/Analyzers.Tests/RCS1044RemoveOriginalExceptionFromThrowStatementTests.cs index d4cf922544..0fa6686f98 100644 --- a/src/Tests/Analyzers.Tests/RCS1044RemoveOriginalExceptionFromThrowStatementTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1044RemoveOriginalExceptionFromThrowStatementTests.cs @@ -12,7 +12,7 @@ public class RCS1044RemoveOriginalExceptionFromThrowStatementTests : AbstractCSh { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveOriginalExceptionFromThrowStatement; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveOriginalExceptionFromThrowStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveOriginalExceptionFromThrowStatement)] public async Task Test_OriginalExceptionUsed() { await VerifyDiagnosticAndFixAsync(@" @@ -52,7 +52,7 @@ public void Foo() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveOriginalExceptionFromThrowStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveOriginalExceptionFromThrowStatement)] public async Task TestNoDiagnostic_OnlyThrowStatement() { await VerifyNoDiagnosticAsync(@" @@ -75,7 +75,7 @@ public void Foo() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveOriginalExceptionFromThrowStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveOriginalExceptionFromThrowStatement)] public async Task TestNoDiagnostic_NewExceptionInstantiated() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1046AsynchronousMethodNameShouldEndWithAsyncTests.cs b/src/Tests/Analyzers.Tests/RCS1046AsynchronousMethodNameShouldEndWithAsyncTests.cs index d9d2ba5a72..5d5364d964 100644 --- a/src/Tests/Analyzers.Tests/RCS1046AsynchronousMethodNameShouldEndWithAsyncTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1046AsynchronousMethodNameShouldEndWithAsyncTests.cs @@ -12,7 +12,7 @@ public class RCS1046AsynchronousMethodNameShouldEndWithAsyncTests : AbstractCSha { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AsynchronousMethodNameShouldEndWithAsync; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync)] public async Task Test_Task() { await VerifyDiagnosticAsync(@" @@ -36,7 +36,7 @@ public override Task Foo() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync)] public async Task Test_Task_TypeParameter() { await VerifyDiagnosticAsync(@" @@ -52,7 +52,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync)] public async Task Test_TaskOfT() { await VerifyDiagnosticAsync(@" @@ -68,7 +68,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync)] public async Task Test_TaskOfT_TypeParameter() { await VerifyDiagnosticAsync(@" @@ -84,7 +84,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync)] public async Task Test_ValueTaskOfT() { await VerifyDiagnosticAsync(@" @@ -100,7 +100,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync)] public async Task Test_DuckTyped() { await VerifyDiagnosticAsync(@" @@ -136,7 +136,7 @@ public void OnCompleted(System.Action continuation) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync)] public async Task TestNoDiagnostic_EntryPointMethod() { await VerifyNoDiagnosticAsync(@" @@ -152,7 +152,7 @@ static async Task Main() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AsynchronousMethodNameShouldEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AsynchronousMethodNameShouldEndWithAsync)] public async Task TestNoDiagnostic_Interface() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1047NonAsynchronousMethodNameShouldNotEndWithAsyncTests.cs b/src/Tests/Analyzers.Tests/RCS1047NonAsynchronousMethodNameShouldNotEndWithAsyncTests.cs index 3691dab2f4..464f82bb5c 100644 --- a/src/Tests/Analyzers.Tests/RCS1047NonAsynchronousMethodNameShouldNotEndWithAsyncTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1047NonAsynchronousMethodNameShouldNotEndWithAsyncTests.cs @@ -12,7 +12,7 @@ public class RCS1047NonAsynchronousMethodNameShouldNotEndWithAsyncTests : Abstra { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.NonAsynchronousMethodNameShouldNotEndWithAsync; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync)] public async Task Test() { await VerifyDiagnosticAsync(@" @@ -27,7 +27,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync)] public async Task Test_Tuple() { await VerifyDiagnosticAsync(@" @@ -43,7 +43,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync)] public async Task Test_String() { await VerifyDiagnosticAsync(@" @@ -59,7 +59,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync)] public async Task Test_Array() { await VerifyDiagnosticAsync(@" @@ -75,7 +75,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync)] public async Task Test_T() { await VerifyDiagnosticAsync(@" @@ -91,7 +91,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync)] public async Task TestNoDiagnostic_Task() { await VerifyNoDiagnosticAsync(@" @@ -177,7 +177,7 @@ public void OnCompleted(System.Action continuation) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NonAsynchronousMethodNameShouldNotEndWithAsync)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NonAsynchronousMethodNameShouldNotEndWithAsync)] public async Task TestNoDiagnostic_AsyncEnumerable() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1049SimplifyBooleanComparisonTests.cs b/src/Tests/Analyzers.Tests/RCS1049SimplifyBooleanComparisonTests.cs index 6f662f75c4..d569d8df83 100644 --- a/src/Tests/Analyzers.Tests/RCS1049SimplifyBooleanComparisonTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1049SimplifyBooleanComparisonTests.cs @@ -12,7 +12,7 @@ public class RCS1049SimplifyBooleanComparisonTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyBooleanComparison; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyBooleanComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyBooleanComparison)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ void M(bool x) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyBooleanComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyBooleanComparison)] public async Task Test2() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ void M(bool x) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyBooleanComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyBooleanComparison)] public async Task Test_IsTrue() { await VerifyDiagnosticAndFixAsync(@" @@ -104,7 +104,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyBooleanComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyBooleanComparison)] public async Task Test_IsFalse() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyBooleanComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyBooleanComparison)] public async Task Test_IsNotTrue() { await VerifyDiagnosticAndFixAsync(@" @@ -152,7 +152,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyBooleanComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyBooleanComparison)] public async Task Test_IsNotFalse() { await VerifyDiagnosticAndFixAsync(@" @@ -176,7 +176,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyBooleanComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyBooleanComparison)] public async Task TestNoDiagnostic_NullableIsTrue() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1050AddOrRemoveParenthesesWhenCreatingNewObjectTests.cs b/src/Tests/Analyzers.Tests/RCS1050AddOrRemoveParenthesesWhenCreatingNewObjectTests.cs index 9263184976..e084d666cb 100644 --- a/src/Tests/Analyzers.Tests/RCS1050AddOrRemoveParenthesesWhenCreatingNewObjectTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1050AddOrRemoveParenthesesWhenCreatingNewObjectTests.cs @@ -12,7 +12,7 @@ public class RCS1050AddOrRemoveParenthesesWhenCreatingNewObjectTests : AbstractC { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.IncludeParenthesesWhenCreatingNewObject; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.IncludeParenthesesWhenCreatingNewObject)] public async Task Test_AddParentheses() { await VerifyDiagnosticAndFixAsync(""" @@ -32,7 +32,7 @@ public class C """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationParenthesesStyle, ConfigOptionValues.ObjectCreationParenthesesStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.IncludeParenthesesWhenCreatingNewObject)] public async Task Test_RemoveParentheses() { await VerifyDiagnosticAndFixAsync(""" @@ -52,7 +52,7 @@ public class C """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationParenthesesStyle, ConfigOptionValues.ObjectCreationParenthesesStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.IncludeParenthesesWhenCreatingNewObject)] public async Task TestNoDiagnostic_AddParentheses() { await VerifyNoDiagnosticAsync(""" @@ -65,7 +65,7 @@ public class C """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationParenthesesStyle, ConfigOptionValues.ObjectCreationParenthesesStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.IncludeParenthesesWhenCreatingNewObject)] public async Task TestNoDiagnostic_RemoveParentheses() { await VerifyNoDiagnosticAsync(""" @@ -78,7 +78,7 @@ public class C """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationParenthesesStyle, ConfigOptionValues.ObjectCreationParenthesesStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.IncludeParenthesesWhenCreatingNewObject)] public async Task TestNoDiagnostic_RemoveParentheses_NoInitializer() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1051AddOrRemoveParenthesesFromConditionOfConditionalExpressionTests.cs b/src/Tests/Analyzers.Tests/RCS1051AddOrRemoveParenthesesFromConditionOfConditionalExpressionTests.cs index 14673e0628..dd78d5685e 100644 --- a/src/Tests/Analyzers.Tests/RCS1051AddOrRemoveParenthesesFromConditionOfConditionalExpressionTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1051AddOrRemoveParenthesesFromConditionOfConditionalExpressionTests.cs @@ -12,7 +12,7 @@ public class RCS1051AddOrRemoveParenthesesFromConditionOfConditionalExpressionTe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddOrRemoveParenthesesFromConditionInConditionalOperator; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator)] public async Task Test_AddParentheses() { await VerifyDiagnosticAndFixAsync(""" @@ -36,7 +36,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorConditionParenthesesStyle, ConfigOptionValues.ConditionalOperatorConditionParenthesesStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator)] public async Task Test_AddParentheses_SingleTokenExpression() { await VerifyDiagnosticAndFixAsync(""" @@ -60,7 +60,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorConditionParenthesesStyle, ConfigOptionValues.ConditionalOperatorConditionParenthesesStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator)] public async Task Test_RemoveParentheses() { await VerifyDiagnosticAndFixAsync(""" @@ -84,7 +84,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorConditionParenthesesStyle, ConfigOptionValues.ConditionalOperatorConditionParenthesesStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator)] public async Task Test_RemoveParentheses_SingleTokenExpression() { await VerifyDiagnosticAndFixAsync(""" @@ -108,7 +108,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorConditionParenthesesStyle, ConfigOptionValues.ConditionalOperatorConditionParenthesesStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator)] public async Task Test_RemoveParentheses_OmitWhenSingleToken() { await VerifyDiagnosticAndFixAsync(""" @@ -132,7 +132,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorConditionParenthesesStyle, ConfigOptionValues.ConditionalOperatorConditionParenthesesStyle_OmitWhenConditionIsSingleToken)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator)] public async Task TestNoDiagnostic_NoParentheses_SingleTokenExpression() { await VerifyNoDiagnosticAsync(""" @@ -147,7 +147,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorConditionParenthesesStyle, ConfigOptionValues.ConditionalOperatorConditionParenthesesStyle_OmitWhenConditionIsSingleToken)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveParenthesesFromConditionInConditionalOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveParenthesesFromConditionInConditionalOperator)] public async Task TestNoDiagnostic_Parentheses_SingleTokenExpression() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1055UnnecessarySemicolonAtEndOfDeclarationAnalyzerTests.cs b/src/Tests/Analyzers.Tests/RCS1055UnnecessarySemicolonAtEndOfDeclarationAnalyzerTests.cs index 57ec079187..f28824695a 100644 --- a/src/Tests/Analyzers.Tests/RCS1055UnnecessarySemicolonAtEndOfDeclarationAnalyzerTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1055UnnecessarySemicolonAtEndOfDeclarationAnalyzerTests.cs @@ -12,7 +12,7 @@ public class RCS1055UnnecessarySemicolonAtEndOfDeclarationAnalyzerTests : Abstra { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessarySemicolonAtEndOfDeclaration; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessarySemicolonAtEndOfDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessarySemicolonAtEndOfDeclaration)] public async Task TestNoDiagnostic_Class() { await VerifyNoDiagnosticAsync(@" @@ -20,7 +20,7 @@ class C; "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessarySemicolonAtEndOfDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessarySemicolonAtEndOfDeclaration)] public async Task TestNoDiagnostic_Struct() { await VerifyNoDiagnosticAsync(@" @@ -28,7 +28,7 @@ struct C; "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessarySemicolonAtEndOfDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessarySemicolonAtEndOfDeclaration)] public async Task TestNoDiagnostic_Interface() { await VerifyNoDiagnosticAsync(@" @@ -36,7 +36,7 @@ interface C; "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessarySemicolonAtEndOfDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessarySemicolonAtEndOfDeclaration)] public async Task TestNoDiagnostic_Enum() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1056AvoidUsageOfUsingAliasDirectiveTests.cs b/src/Tests/Analyzers.Tests/RCS1056AvoidUsageOfUsingAliasDirectiveTests.cs index 4035da41c1..2f36731af0 100644 --- a/src/Tests/Analyzers.Tests/RCS1056AvoidUsageOfUsingAliasDirectiveTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1056AvoidUsageOfUsingAliasDirectiveTests.cs @@ -12,7 +12,7 @@ public class RCS1056AvoidUsageOfUsingAliasDirectiveTests : AbstractCSharpDiagnos { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AvoidUsageOfUsingAliasDirective; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidUsageOfUsingAliasDirective)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -52,7 +52,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidUsageOfUsingAliasDirective)] public async Task Test_FileScopedNamespaces() { await VerifyDiagnosticAndFixAsync(@" @@ -79,7 +79,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidUsageOfUsingAliasDirective)] public async Task Test_AliasQualifiedName() { await VerifyDiagnosticAndFixAsync(@" @@ -93,7 +93,7 @@ class X : object }"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidUsageOfUsingAliasDirective)] public async Task Test_BlockNamespaces() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1058UseCompoundAssignmentTests.cs b/src/Tests/Analyzers.Tests/RCS1058UseCompoundAssignmentTests.cs index 69de9968c8..41703004b2 100644 --- a/src/Tests/Analyzers.Tests/RCS1058UseCompoundAssignmentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1058UseCompoundAssignmentTests.cs @@ -12,7 +12,7 @@ public class RCS1058UseCompoundAssignmentTests : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseCompoundAssignment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] [InlineData("i = i + 1", "i += 1")] [InlineData("i = (i + 1)", "i += 1")] [InlineData("i = i - 1", "i -= 1")] @@ -63,7 +63,7 @@ void M(int i) ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] public async Task Test_CoalesceExpression() { await VerifyDiagnosticAndFixAsync(""" @@ -85,7 +85,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] public async Task Test_LazyInitialization() { await VerifyDiagnosticAndFixAsync(@" @@ -111,7 +111,7 @@ string M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] public async Task TestNoDiagnostic_ObjectInitializer() { await VerifyNoDiagnosticAsync(@" @@ -127,7 +127,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] public async Task TestNoDiagnostic_CoalesceExpression_CSharp6() { await VerifyNoDiagnosticAsync(""" @@ -141,7 +141,7 @@ void M(string s) """, options: WellKnownCSharpTestOptions.Default_CSharp6); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] public async Task TestNoDiagnostic_LazyInitialization_ExpressionsAreNotEquivalent() { await VerifyNoDiagnosticAsync(@" @@ -158,7 +158,7 @@ string M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] public async Task TestNoDiagnostic_LazyInitialization_CSharp7_3() { await VerifyNoDiagnosticAsync(@" @@ -174,7 +174,7 @@ string M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCompoundAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCompoundAssignment)] public async Task TestNoDiagnostic_ThrowExpression() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1060DeclareEachTypeInSeparateFileTests.cs b/src/Tests/Analyzers.Tests/RCS1060DeclareEachTypeInSeparateFileTests.cs index fa5fb6cc18..427238b5ea 100644 --- a/src/Tests/Analyzers.Tests/RCS1060DeclareEachTypeInSeparateFileTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1060DeclareEachTypeInSeparateFileTests.cs @@ -12,7 +12,7 @@ public class RCS1060DeclareEachTypeInSeparateFileTests : AbstractCSharpDiagnosti { public override DiagnosticDescriptor Descriptor => DiagnosticRules.DeclareEachTypeInSeparateFile; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEachTypeInSeparateFile)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEachTypeInSeparateFile)] public async Task Test_Namespace() { await VerifyDiagnosticAndFixAsync(""" @@ -36,7 +36,7 @@ public class C2 """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEachTypeInSeparateFile)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEachTypeInSeparateFile)] public async Task Test_FileScopedNamespace() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1061MergeIfWithNestedIfTests.cs b/src/Tests/Analyzers.Tests/RCS1061MergeIfWithNestedIfTests.cs index f95960db7a..316d9b9f67 100644 --- a/src/Tests/Analyzers.Tests/RCS1061MergeIfWithNestedIfTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1061MergeIfWithNestedIfTests.cs @@ -12,7 +12,7 @@ public class RCS1061MergeIfWithNestedIfTests : AbstractCSharpDiagnosticVerifier< { public override DiagnosticDescriptor Descriptor => DiagnosticRules.MergeIfWithNestedIf; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergeIfWithNestedIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergeIfWithNestedIf)] public async Task Test_MergeIfStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -44,7 +44,7 @@ public static void M(Dictionary settings, string name) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergeIfWithNestedIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergeIfWithNestedIf)] public async Task TestNoDiagnostic_WhenLocalVariablesOverlap() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1066RemoveEmptyFinallyClauseTests.cs b/src/Tests/Analyzers.Tests/RCS1066RemoveEmptyFinallyClauseTests.cs index e413d12440..3dbcab574b 100644 --- a/src/Tests/Analyzers.Tests/RCS1066RemoveEmptyFinallyClauseTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1066RemoveEmptyFinallyClauseTests.cs @@ -12,7 +12,7 @@ public class RCS1066RemoveEmptyFinallyClauseTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveEmptyFinallyClause; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyFinallyClause)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyFinallyClause)] public async Task Test_TryCatchFinally() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyFinallyClause)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyFinallyClause)] public async Task Test_TryFinally() { await VerifyDiagnosticAndFixAsync(@" @@ -83,7 +83,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptyFinallyClause)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptyFinallyClause)] public async Task TestNoDiagnostic_NonEmptyFinally() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1068SimplifyLogicalNegationTests.cs b/src/Tests/Analyzers.Tests/RCS1068SimplifyLogicalNegationTests.cs index 81b69823f7..e4d7bfd648 100644 --- a/src/Tests/Analyzers.Tests/RCS1068SimplifyLogicalNegationTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1068SimplifyLogicalNegationTests.cs @@ -12,7 +12,7 @@ public class RCS1068SimplifyLogicalNegationTests : AbstractCSharpDiagnosticVerif { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyLogicalNegation; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotTrue() { await VerifyDiagnosticAndFixAsync(@" @@ -34,7 +34,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotTrue2() { await VerifyDiagnosticAndFixAsync(@" @@ -56,7 +56,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotFalse() { await VerifyDiagnosticAndFixAsync(@" @@ -78,7 +78,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotNot() { await VerifyDiagnosticAndFixAsync(@" @@ -104,7 +104,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotNot2() { await VerifyDiagnosticAndFixAsync(@" @@ -130,7 +130,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_EqualsExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -156,7 +156,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotEqualsExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -182,7 +182,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_LessThanExpression_Int32() { await VerifyDiagnosticAndFixAsync(@" @@ -208,7 +208,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_LessThanExpression_Single() { await VerifyDiagnosticAndFixAsync(@" @@ -234,7 +234,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_LessThanExpression_Double() { await VerifyDiagnosticAndFixAsync(@" @@ -260,7 +260,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_LessThanOrEqualsExpression_Int32() { await VerifyDiagnosticAndFixAsync(@" @@ -286,7 +286,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_LessThanOrEqualsExpression_Single() { await VerifyDiagnosticAndFixAsync(@" @@ -312,7 +312,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_LessThanOrEqualsExpression_Double() { await VerifyDiagnosticAndFixAsync(@" @@ -338,7 +338,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_GreaterThanExpression_Int32() { await VerifyDiagnosticAndFixAsync(@" @@ -364,7 +364,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_GreaterThanExpression_Single() { await VerifyDiagnosticAndFixAsync(@" @@ -390,7 +390,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_GreaterThanExpression_Double() { await VerifyDiagnosticAndFixAsync(@" @@ -416,7 +416,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_GreaterThanOrEqualsExpression_Int32() { await VerifyDiagnosticAndFixAsync(@" @@ -442,7 +442,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_GreaterThanOrEqualsExpression_Single() { await VerifyDiagnosticAndFixAsync(@" @@ -468,7 +468,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_GreaterThanOrEqualsExpression_Double() { await VerifyDiagnosticAndFixAsync(@" @@ -494,7 +494,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_IsNotNullPattern() { await VerifyDiagnosticAndFixAsync(@" @@ -524,7 +524,7 @@ x is not null //x "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task TestNoDiagnostic_NotEqualsOperator() { await VerifyNoDiagnosticAsync(@" @@ -543,7 +543,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task TestNoDiagnostic_EqualsOperator() { await VerifyNoDiagnosticAsync(@" @@ -562,7 +562,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task TestNoDiagnostic_Double_NaN() { await VerifyNoDiagnosticAsync(@" @@ -581,7 +581,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task TestNoDiagnostic_Float_NaN() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1068SimplifyLogicalNegationTests2.cs b/src/Tests/Analyzers.Tests/RCS1068SimplifyLogicalNegationTests2.cs index 38a1cff7dd..de1c86fd1c 100644 --- a/src/Tests/Analyzers.Tests/RCS1068SimplifyLogicalNegationTests2.cs +++ b/src/Tests/Analyzers.Tests/RCS1068SimplifyLogicalNegationTests2.cs @@ -12,7 +12,7 @@ public class RCS1068SimplifyLogicalNegationTests2 : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyLogicalNegation; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotAny() { await VerifyDiagnosticAndFixAsync(@" @@ -48,7 +48,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotAny2() { await VerifyDiagnosticAndFixAsync(@" @@ -84,7 +84,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotAny3() { await VerifyDiagnosticAndFixAsync(@" @@ -120,7 +120,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotAll() { await VerifyDiagnosticAndFixAsync(@" @@ -156,7 +156,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotAll2() { await VerifyDiagnosticAndFixAsync(@" @@ -192,7 +192,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLogicalNegation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLogicalNegation)] public async Task Test_NotAll3() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1073ConvertIfToReturnStatementTests.cs b/src/Tests/Analyzers.Tests/RCS1073ConvertIfToReturnStatementTests.cs index d5b6c8e544..8516886b9c 100644 --- a/src/Tests/Analyzers.Tests/RCS1073ConvertIfToReturnStatementTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1073ConvertIfToReturnStatementTests.cs @@ -12,7 +12,7 @@ public class RCS1073ConvertIfToReturnStatementTests : AbstractCSharpDiagnosticVe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.ConvertIfToReturnStatement; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertIfToReturnStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertIfToReturnStatement)] public async Task Test_IfElse() { await VerifyDiagnosticAndFixAsync(@" @@ -45,7 +45,7 @@ bool M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertIfToReturnStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertIfToReturnStatement)] public async Task Test_IfReturn() { await VerifyDiagnosticAndFixAsync(@" @@ -76,7 +76,7 @@ bool M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertIfToReturnStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertIfToReturnStatement)] public async Task Test_IfReturn_EqualsToNull() { await VerifyDiagnosticAndFixAsync(@" @@ -109,7 +109,7 @@ string M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertIfToReturnStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertIfToReturnStatement)] public async Task Test_IfReturn_IsNull() { await VerifyDiagnosticAndFixAsync(@" @@ -142,7 +142,7 @@ string M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertIfToReturnStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertIfToReturnStatement)] public async Task TestNoDiagnostic_IfElseContainsComment() { await VerifyNoDiagnosticAsync(@" @@ -165,7 +165,7 @@ bool M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertIfToReturnStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertIfToReturnStatement)] public async Task TestNoDiagnostic_IfElseContainsDirective() { await VerifyNoDiagnosticAsync(@" @@ -189,7 +189,7 @@ bool M() ", options: Options.WithDebugPreprocessorSymbol()); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertIfToReturnStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertIfToReturnStatement)] public async Task TestNoDiagnostic_IfReturnContainsComment() { await VerifyNoDiagnosticAsync(@" @@ -210,7 +210,7 @@ bool M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertIfToReturnStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertIfToReturnStatement)] public async Task TestNoDiagnostic_IfReturnContainsDirective() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1074RemoveRedundantConstructorTests.cs b/src/Tests/Analyzers.Tests/RCS1074RemoveRedundantConstructorTests.cs index c4c1b138e5..0b7d32c140 100644 --- a/src/Tests/Analyzers.Tests/RCS1074RemoveRedundantConstructorTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1074RemoveRedundantConstructorTests.cs @@ -12,7 +12,7 @@ public class RCS1074RemoveRedundantConstructorTests : AbstractCSharpDiagnosticVe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantConstructor; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantConstructor)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantConstructor)] public async Task Test_SingleInstanceConstructor() { await VerifyDiagnosticAndFixAsync(@" @@ -29,7 +29,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantConstructor)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantConstructor)] public async Task TestNoDiagnostic_UsedImplicitlyAttribute() { await VerifyNoDiagnosticAsync(@" @@ -50,7 +50,7 @@ public class UsedImplicitlyAttribute : System.Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantConstructor)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantConstructor)] public async Task TestNoDiagnostic_StructWithFieldInitializer() { await VerifyNoDiagnosticAsync(""" @@ -65,7 +65,7 @@ public C() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantConstructor)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantConstructor)] public async Task TestNoDiagnostic_StructWithPropertyInitializer() { await VerifyNoDiagnosticAsync(""" @@ -80,7 +80,7 @@ public C() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantConstructor)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantConstructor)] public async Task TestNoDiagnostic_RecordStructWithFieldInitializer() { await VerifyNoDiagnosticAsync(""" @@ -95,7 +95,7 @@ public C() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantConstructor)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantConstructor)] public async Task TestNoDiagnostic_RecordStructWithPropertyInitializer() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1077OptimizeLinqMethodCallTests.cs b/src/Tests/Analyzers.Tests/RCS1077OptimizeLinqMethodCallTests.cs index e78825022b..3fc4151e99 100644 --- a/src/Tests/Analyzers.Tests/RCS1077OptimizeLinqMethodCallTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1077OptimizeLinqMethodCallTests.cs @@ -12,7 +12,7 @@ public class RCS1077OptimizeLinqMethodCallTests : AbstractCSharpDiagnosticVerifi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.OptimizeLinqMethodCall; - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("Where(_ => true).Any()", "Any(_ => true)")] [InlineData("Where(_ => true).Count()", "Count(_ => true)")] [InlineData("Where(_ => true).First()", "First(_ => true)")] @@ -38,7 +38,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_Where_Multiline() { await VerifyDiagnosticAndFixAsync(@" @@ -73,7 +73,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("Where(_ => true).Any()", "Any(_ => true)")] [InlineData("Where(_ => true).Count()", "Count(_ => true)")] [InlineData("Where(_ => true).First()", "First(_ => true)")] @@ -100,7 +100,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_WhereAndCount() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ void M(IEnumerable items, int count) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_SelectAndMin() { await VerifyDiagnosticAndFixAsync(@" @@ -154,7 +154,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_SelectAndMax() { await VerifyDiagnosticAndFixAsync(@" @@ -180,7 +180,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_SelectAndAverage() { await VerifyDiagnosticAndFixAsync(@" @@ -206,7 +206,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_SelectAndSum() { await VerifyDiagnosticAndFixAsync(@" @@ -232,7 +232,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_SelectAndMin_ImmutableArray() { await VerifyDiagnosticAndFixAsync(@" @@ -260,7 +260,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_SelectAndMax_ImmutableArray() { await VerifyDiagnosticAndFixAsync(@" @@ -288,7 +288,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("Where(f => f is object).Cast()", "OfType()")] [InlineData("Where((f) => f is object).Cast()", "OfType()")] [InlineData(@"Where(f => @@ -313,7 +313,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData(@"Where(f => f.StartsWith(""a"")).Any(f => f.StartsWith(""b""))", @"Any(f => f.StartsWith(""a"") && f.StartsWith(""b""))")] [InlineData(@"Where((f) => f.StartsWith(""a"")).Any(f => f.StartsWith(""b""))", @"Any((f) => f.StartsWith(""a"") && f.StartsWith(""b""))")] public async Task Test_CombineWhereAndAny(string source, string expected) @@ -334,7 +334,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData(@"Where(f => f.StartsWith(""a"")).Any(f => f.StartsWith(""b""))", @"Any(f => f.StartsWith(""a"") && f.StartsWith(""b""))")] [InlineData(@"Where((f) => f.StartsWith(""a"")).Any(f => f.StartsWith(""b""))", @"Any((f) => f.StartsWith(""a"") && f.StartsWith(""b""))")] public async Task Test_CombineWhereAndAny_ImmutableArray(string source, string expected) @@ -355,7 +355,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.FirstOrDefault(_ => true) != null", "items.Any(_ => true)")] [InlineData("items.FirstOrDefault() != null", "items.Any()")] [InlineData("items.FirstOrDefault() is not null", "items.Any()")] @@ -376,7 +376,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.FirstOrDefault(_ => true) != null", "items.Any(_ => true)")] [InlineData("items.FirstOrDefault() != null", "items.Any()")] [InlineData("items.FirstOrDefault() is not null", "items.Any()")] @@ -397,7 +397,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.FirstOrDefault(_ => true) != null", "items.Any(_ => true)")] [InlineData("items.FirstOrDefault() != null", "items.Any()")] [InlineData("items.FirstOrDefault() is not null", "items.Any()")] @@ -419,7 +419,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.FirstOrDefault(_ => true) != null", "items.Any(_ => true)")] [InlineData("items.FirstOrDefault() != null", "items.Any()")] [InlineData("items.FirstOrDefault() is not null", "items.Any()")] @@ -441,7 +441,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_OptimizeOfType_ValueType() { await VerifyDiagnosticAndFixAsync(@" @@ -473,7 +473,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_OptimizeOfType_TypeParameterWithStructConstraint() { await VerifyDiagnosticAndFixAsync(@" @@ -505,7 +505,7 @@ void M() where T : struct "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallCastInsteadOfSelect_ExtensionMethodCall() { await VerifyDiagnosticAndFixAsync(@" @@ -531,7 +531,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallCastInsteadOfSelect_StaticMethodCall() { await VerifyDiagnosticAndFixAsync(@" @@ -557,7 +557,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallCastInsteadOfSelect_ParenthesizedLambda() { await VerifyDiagnosticAndFixAsync(@" @@ -583,7 +583,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallCastInsteadOfSelect_LambdaWithBlock() { await VerifyDiagnosticAndFixAsync(@" @@ -612,7 +612,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallPeekInsteadOfFirst_Queue() { await VerifyDiagnosticAndFixAsync(@" @@ -644,7 +644,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallPeekInsteadOfFirst_Stack() { await VerifyDiagnosticAndFixAsync(@" @@ -676,7 +676,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallFindInsteadOfFirstOrDefault_List() { await VerifyNoDiagnosticAsync(@" @@ -695,7 +695,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallFindInsteadOfFirstOrDefault_DerivedFromList() { await VerifyNoDiagnosticAsync(@" @@ -714,7 +714,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallFindInsteadOfFirstOrDefault_Array() { await VerifyNoDiagnosticAsync(@" @@ -733,7 +733,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("((List)x).[|Count()|]", "((List)x).Count")] [InlineData("((IList)x).[|Count()|]", "((IList)x).Count")] [InlineData("((IReadOnlyList)x).[|Count()|]", "((IReadOnlyList)x).Count")] @@ -763,7 +763,7 @@ void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.[|Count()|] != 0", "items.Any()")] [InlineData("items.[|Count()|] > 0", "items.Any()")] [InlineData("items.[|Count()|] >= 1", "items.Any()")] @@ -797,7 +797,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallFirstOrDefaultInsteadOfConditionalExpression_ReferenceType() { await VerifyDiagnosticAndFixAsync(@" @@ -853,7 +853,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallFirstOrDefaultInsteadOfConditionalExpression_ValueType() { await VerifyDiagnosticAndFixAsync(@" @@ -901,7 +901,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallOrderByDescendingInsteadOfOrderByAndReverse() { await VerifyDiagnosticAndFixAsync(@" @@ -933,7 +933,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("OrderBy(f => f)")] [InlineData("OrderBy(_ => _)")] [InlineData("OrderBy(@int => @int)")] @@ -968,7 +968,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallOrderByAndWhereInReverseOrder() { await VerifyDiagnosticAndFixAsync(@" @@ -1000,7 +1000,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallOrderByAndWhereInReverseOrder2() { await VerifyDiagnosticAndFixAsync(@" @@ -1032,7 +1032,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallOrderByDescendingAndWhereInReverseOrder() { await VerifyDiagnosticAndFixAsync(@" @@ -1064,7 +1064,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallOrderByDescendingAndWhereInReverseOrder2() { await VerifyDiagnosticAndFixAsync(@" @@ -1096,7 +1096,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallSumInsteadOfSelectManyAndCount() { await VerifyDiagnosticAndFixAsync(@" @@ -1128,7 +1128,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task Test_CallConvertAllInsteadOfSelectAndToList_List() { await VerifyDiagnosticAndFixAsync(@" @@ -1160,7 +1160,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.FirstOrDefault(_ => true) == null")] [InlineData("items.FirstOrDefault(_ => true) is null")] [InlineData("items.FirstOrDefault() == null")] @@ -1182,7 +1182,7 @@ void M() ", source); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.FirstOrDefault(_ => true) == null")] [InlineData("items.FirstOrDefault(_ => true) is null")] [InlineData("items.FirstOrDefault() == null")] @@ -1204,7 +1204,7 @@ void M() ", source); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.FirstOrDefault(_ => true) == null")] [InlineData("items.FirstOrDefault(_ => true) is null")] [InlineData("items.FirstOrDefault() == null")] @@ -1227,7 +1227,7 @@ void M() ", source); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] [InlineData("items.FirstOrDefault(_ => true) == null")] [InlineData("items.FirstOrDefault(_ => true) is null")] [InlineData("items.FirstOrDefault() == null")] @@ -1250,7 +1250,7 @@ void M() ", source); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_CallOfTypeInsteadOfWhereAndCast() { await VerifyNoDiagnosticAsync(@" @@ -1269,7 +1269,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_CombineWhereAndAny() { await VerifyNoDiagnosticAsync(""" @@ -1288,7 +1288,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_FirstOrDefault_ValueType() { await VerifyNoDiagnosticAsync(@" @@ -1318,7 +1318,7 @@ void M2() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_CallCastInsteadOfSelect_Conversion() { await VerifyNoDiagnosticAsync(@" @@ -1347,7 +1347,7 @@ public static explicit operator C(C2 value) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_OptimizeCountCall_IEnumerableOfT() { await VerifyNoDiagnosticAsync(@" @@ -1363,7 +1363,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_OptimizeCountCall_ExpressionCannotBeMemberAccessExpression() { await VerifyNoDiagnosticAsync(@" @@ -1391,7 +1391,7 @@ void M(Action action) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_OptimizeCountCall_InfiniteRecursion() { await VerifyNoDiagnosticAsync(@" @@ -1413,7 +1413,7 @@ public IEnumerator GetEnumerator() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_OptimizeCountCall_InfiniteRecursion2() { await VerifyNoDiagnosticAsync(@" @@ -1438,7 +1438,7 @@ public IEnumerator GetEnumerator() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_CallAnyInsteadOfCount() { await VerifyNoDiagnosticAsync(@" @@ -1473,7 +1473,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_CallFindInsteadOfFirstOrDefault_Array_ConditionalAccess() { await VerifyNoDiagnosticAsync(@" @@ -1493,7 +1493,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_CallSumInsteadOfSelectManyAndCount() { await VerifyNoDiagnosticAsync(@" @@ -1515,7 +1515,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_CannotConvertFuncToPredicate() { await VerifyNoDiagnosticAsync(@" @@ -1537,7 +1537,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeLinqMethodCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeLinqMethodCall)] public async Task TestNoDiagnostic_OrderByToOrder_IQueryable() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1078UseEmptyStringLiteralOrStringEmptyTests.cs b/src/Tests/Analyzers.Tests/RCS1078UseEmptyStringLiteralOrStringEmptyTests.cs index 5ef3013c78..53e10ee0db 100644 --- a/src/Tests/Analyzers.Tests/RCS1078UseEmptyStringLiteralOrStringEmptyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1078UseEmptyStringLiteralOrStringEmptyTests.cs @@ -12,7 +12,7 @@ public class RCS1078UseEmptyStringLiteralOrStringEmptyTests : AbstractCSharpDiag { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseEmptyStringLiteralOrStringEmpty; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEmptyStringLiteralOrStringEmpty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEmptyStringLiteralOrStringEmpty)] public async Task Test_StringEmpty() { await VerifyDiagnosticAndFixAsync(""" @@ -46,7 +46,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.EmptyStringStyle, ConfigOptionValues.EmptyStringStyle_Literal)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEmptyStringLiteralOrStringEmpty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEmptyStringLiteralOrStringEmpty)] public async Task Test_EmptyString() { await VerifyDiagnosticAndFixAsync(""" @@ -78,7 +78,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.EmptyStringStyle, ConfigOptionValues.EmptyStringStyle_Field)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEmptyStringLiteralOrStringEmpty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEmptyStringLiteralOrStringEmpty)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(""" @@ -94,7 +94,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.EmptyStringStyle, ConfigOptionValues.EmptyStringStyle_Field)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEmptyStringLiteralOrStringEmpty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEmptyStringLiteralOrStringEmpty)] public async Task TestNoDiagnostic_ExpressionMustBeConstant() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1080UseCountOrLengthPropertyInsteadOfAnyMethodTests.cs b/src/Tests/Analyzers.Tests/RCS1080UseCountOrLengthPropertyInsteadOfAnyMethodTests.cs index cd96cb7e69..db41c3c392 100644 --- a/src/Tests/Analyzers.Tests/RCS1080UseCountOrLengthPropertyInsteadOfAnyMethodTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1080UseCountOrLengthPropertyInsteadOfAnyMethodTests.cs @@ -12,7 +12,7 @@ public class RCS1080UseCountOrLengthPropertyInsteadOfAnyMethodTests : AbstractCS { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseCountOrLengthPropertyInsteadOfAnyMethod; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_List() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_ListNot() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_IList() { await VerifyDiagnosticAndFixAsync(@" @@ -114,7 +114,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_IListNot() { await VerifyDiagnosticAndFixAsync(@" @@ -148,7 +148,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_IReadOnlyList() { await VerifyDiagnosticAndFixAsync(@" @@ -182,7 +182,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_IReadOnlyListNot() { await VerifyDiagnosticAndFixAsync(@" @@ -216,7 +216,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_Collection() { await VerifyDiagnosticAndFixAsync(@" @@ -250,7 +250,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_CollectionNot() { await VerifyDiagnosticAndFixAsync(@" @@ -284,7 +284,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_ICollection() { await VerifyDiagnosticAndFixAsync(@" @@ -318,7 +318,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_ICollectionNot() { await VerifyDiagnosticAndFixAsync(@" @@ -352,7 +352,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_IReadOnlyCollection() { await VerifyDiagnosticAndFixAsync(@" @@ -386,7 +386,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_IReadOnlyCollectionNot() { await VerifyDiagnosticAndFixAsync(@" @@ -420,7 +420,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_Array() { await VerifyDiagnosticAndFixAsync(@" @@ -452,7 +452,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_ArrayNot() { await VerifyDiagnosticAndFixAsync(@" @@ -484,7 +484,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_String() { await VerifyDiagnosticAndFixAsync(@" @@ -516,7 +516,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_StringNot() { await VerifyDiagnosticAndFixAsync(@" @@ -548,7 +548,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task Test_DerivedFromListOfT() { await VerifyDiagnosticAndFixAsync(@" @@ -592,7 +592,7 @@ public class List2 : List "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task TestNoDiagnostic_ImmutableArray() { await VerifyNoDiagnosticAsync(@" @@ -608,7 +608,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCountOrLengthPropertyInsteadOfAnyMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCountOrLengthPropertyInsteadOfAnyMethod)] public async Task TestNoDiagnostic_IEnumerable() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1081SplitVariableDeclarationTests.cs b/src/Tests/Analyzers.Tests/RCS1081SplitVariableDeclarationTests.cs index f7a622cacb..ba12f9fb1d 100644 --- a/src/Tests/Analyzers.Tests/RCS1081SplitVariableDeclarationTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1081SplitVariableDeclarationTests.cs @@ -12,7 +12,7 @@ public class RCS1081SplitVariableDeclarationTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SplitVariableDeclaration; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SplitVariableDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SplitVariableDeclaration)] public async Task Test_SwitchSection() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests.cs b/src/Tests/Analyzers.Tests/RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests.cs index 1f03116fee..2cb9de1afc 100644 --- a/src/Tests/Analyzers.Tests/RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests.cs @@ -12,7 +12,7 @@ public class RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests : A { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseCoalesceExpressionInsteadOfConditionalExpression; - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression)] [InlineData("s != null ? s : \"\"", "s ?? \"\"")] [InlineData("s == null ? \"\" : s", "s ?? \"\"")] [InlineData("(s != null) ? (s) : (\"\")", "s ?? \"\"")] @@ -32,7 +32,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression)] public async Task Test_PolymorphicType_WithNullable() { await VerifyDiagnosticAndFixAsync(@" @@ -74,7 +74,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression)] public async Task Test_PolymorphicType() { await VerifyDiagnosticAndFixAsync(@" @@ -114,7 +114,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression)] [InlineData("(ni != null) ? ni.Value : 1", "ni ?? 1")] [InlineData("(ni == null) ? 1 : ni.Value", "ni ?? 1")] [InlineData("(ni.HasValue) ? ni.Value : 1", "ni ?? 1")] @@ -135,7 +135,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(""" @@ -152,7 +152,7 @@ public unsafe void M() """, options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression)] public async Task TestNoDiagnostic_Pointer() { await VerifyNoDiagnosticAsync(@" @@ -169,7 +169,7 @@ public unsafe void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfConditionalExpression)] public async Task TestNoDiagnostic_DefaultOfTEqualsToNull() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1085UseAutoPropertyTests.cs b/src/Tests/Analyzers.Tests/RCS1085UseAutoPropertyTests.cs index 3b72a81dbc..c95409de02 100644 --- a/src/Tests/Analyzers.Tests/RCS1085UseAutoPropertyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1085UseAutoPropertyTests.cs @@ -12,7 +12,7 @@ public class RCS1085UseAutoPropertyTests : AbstractCSharpDiagnosticVerifier M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_ValueTask() { await VerifyDiagnosticAndFixAsync(@" @@ -213,7 +213,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_ValueTaskOfT() { await VerifyDiagnosticAndFixAsync(@" @@ -245,7 +245,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_DuckTyped() { await VerifyDiagnosticAndFixAsync(@" @@ -331,7 +331,7 @@ public void GetResult() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_ExtensionMethod() { await VerifyDiagnosticAndFixAsync(@" @@ -407,7 +407,7 @@ public void GetResult() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_Indentation() { await VerifyDiagnosticAndFixAsync(@" @@ -440,7 +440,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_Task() { await VerifyNoDiagnosticAsync(@" @@ -456,7 +456,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_TaskOfT() { await VerifyNoDiagnosticAsync(@" @@ -472,7 +472,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_ValueTaskOfT() { await VerifyNoDiagnosticAsync(@" @@ -490,7 +490,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_ValueTask() { await VerifyNoDiagnosticAsync(@" @@ -508,7 +508,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_ExtensionMethod() { await VerifyNoDiagnosticAsync(@" @@ -549,7 +549,7 @@ public void GetResult() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_Awaitable_Lookalike() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1090RemoveCallToConfigureAwaitTests.cs b/src/Tests/Analyzers.Tests/RCS1090RemoveCallToConfigureAwaitTests.cs index 89060e0489..9ecd0fda4d 100644 --- a/src/Tests/Analyzers.Tests/RCS1090RemoveCallToConfigureAwaitTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1090RemoveCallToConfigureAwaitTests.cs @@ -17,7 +17,7 @@ public override CSharpTestOptions Options get { return base.Options.AddConfigOption(ConfigOptionKeys.ConfigureAwait, "false"); } } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_Task_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_Task_Local() { await VerifyDiagnosticAndFixAsync(@" @@ -75,7 +75,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_Task_Method() { await VerifyDiagnosticAndFixAsync(@" @@ -101,7 +101,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_Task_Parameter() { await VerifyDiagnosticAndFixAsync(@" @@ -127,7 +127,7 @@ async Task M(Task task) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_Task_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -157,7 +157,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_TaskOfT() { await VerifyDiagnosticAndFixAsync(@" @@ -183,7 +183,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_ValueTask() { await VerifyDiagnosticAndFixAsync(@" @@ -213,7 +213,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_ValueTaskOfT() { await VerifyDiagnosticAndFixAsync(@" @@ -245,7 +245,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_DuckTyped() { await VerifyDiagnosticAndFixAsync(@" @@ -331,7 +331,7 @@ public void GetResult() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task Test_ExtensionMethod() { await VerifyDiagnosticAndFixAsync(@" @@ -407,7 +407,7 @@ public void GetResult() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_Task() { await VerifyNoDiagnosticAsync(@" @@ -423,7 +423,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_TaskOfT() { await VerifyNoDiagnosticAsync(@" @@ -439,7 +439,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_ValueTaskOfT() { await VerifyNoDiagnosticAsync(@" @@ -457,7 +457,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_ValueTask() { await VerifyNoDiagnosticAsync(@" @@ -475,7 +475,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_ExtensionMethod() { await VerifyNoDiagnosticAsync(@" @@ -516,7 +516,7 @@ public void GetResult() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_NonAwaitable_Lookalike() { await VerifyNoDiagnosticAsync(@" @@ -556,7 +556,7 @@ public Awaitable ConfigureAwait(bool continueOnCapturedContext) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConfigureAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConfigureAwait)] public async Task TestNoDiagnostic_ConfigureAwaitTrue() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1093FileContainsNoCodeTests.cs b/src/Tests/Analyzers.Tests/RCS1093FileContainsNoCodeTests.cs index 2ef0c7aa28..cc7432b4e0 100644 --- a/src/Tests/Analyzers.Tests/RCS1093FileContainsNoCodeTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1093FileContainsNoCodeTests.cs @@ -12,7 +12,7 @@ public class RCS1093FileContainsNoCodeTests : AbstractCSharpDiagnosticVerifier M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLocalVariable)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLocalVariable)] public async Task Test_VarType() { await VerifyDiagnosticAndFixAsync(@" @@ -101,7 +101,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLocalVariable)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLocalVariable)] public async Task Test_NullableReturnType_ReturnsNullable() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ public class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLocalVariable)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLocalVariable)] public async Task TestNoDiagnostic_YieldReturnIsNotLastStatement() { await VerifyNoDiagnosticAsync(""" @@ -146,7 +146,7 @@ IEnumerable M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLocalVariable)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLocalVariable)] public async Task TestNoDiagnostic_ForEachWithAwait() { await VerifyNoDiagnosticAsync(@" @@ -169,7 +169,7 @@ async Task> GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLocalVariable)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLocalVariable)] public async Task TestNoDiagnostic_SwitchWithAwait() { await VerifyNoDiagnosticAsync(""" @@ -193,7 +193,7 @@ async Task GetAsync() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLocalVariable)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLocalVariable)] public async Task TestNoDiagnostic_Disposable() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1128UseCoalesceExpressionTests.cs b/src/Tests/Analyzers.Tests/RCS1128UseCoalesceExpressionTests.cs index 7cf1b962e4..4948717187 100644 --- a/src/Tests/Analyzers.Tests/RCS1128UseCoalesceExpressionTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1128UseCoalesceExpressionTests.cs @@ -12,7 +12,7 @@ public class RCS1128UseCoalesceExpressionTests : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseCoalesceExpression; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_LocalDeclarationStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -39,7 +39,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_LocalDeclarationStatement_IsNull() { await VerifyDiagnosticAndFixAsync(""" @@ -66,7 +66,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_LocalDeclarationStatement_WithComments() { await VerifyDiagnosticAndFixAsync(""" @@ -102,7 +102,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_LocalDeclarationStatement_EmbeddedStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -127,7 +127,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_LocalDeclarationStatement_CastExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -158,7 +158,7 @@ class B { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_SimpleAssignmentStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -185,7 +185,7 @@ void M(string s, string x) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_SimpleAssignmentStatement_CastExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -216,7 +216,7 @@ class B { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_IfStatement_Nullable() { await VerifyDiagnosticAndFixAsync(@" @@ -243,7 +243,7 @@ void M(int? i) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_IfStatement_Nullable_NotHasValue() { await VerifyDiagnosticAndFixAsync(@" @@ -270,7 +270,7 @@ void M(int? i) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_LocalDeclarationStatement_Nullable() { await VerifyDiagnosticAndFixAsync(@" @@ -297,7 +297,7 @@ void M(int? i) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_SimpleAssignmentStatement_Nullable() { await VerifyDiagnosticAndFixAsync(@" @@ -324,7 +324,7 @@ void M(int? i, int? x) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_NullableReferenceType() { await VerifyDiagnosticAndFixAsync(""" @@ -358,7 +358,7 @@ public void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task TestNoDiagnostic_NotEqualsToNull() { await VerifyNoDiagnosticAsync(""" @@ -375,7 +375,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task TestNoDiagnostic_NotIsNull() { await VerifyNoDiagnosticAsync(""" @@ -392,7 +392,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task TestNoDiagnostic_HasValue() { await VerifyNoDiagnosticAsync(@" @@ -409,7 +409,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task TestNoDiagnostic_RefType() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1128UseCoalesceExpressionTests2.cs b/src/Tests/Analyzers.Tests/RCS1128UseCoalesceExpressionTests2.cs index 6c90009cd5..414fd6e32e 100644 --- a/src/Tests/Analyzers.Tests/RCS1128UseCoalesceExpressionTests2.cs +++ b/src/Tests/Analyzers.Tests/RCS1128UseCoalesceExpressionTests2.cs @@ -12,7 +12,7 @@ public class RCS1128UseCoalesceExpressionTests2 : AbstractCSharpDiagnosticVerifi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseCoalesceExpression; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_GetValueOrDefault() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpression)] public async Task Test_GetValueOrDefault_ConditionalAccess() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1129RemoveRedundantFieldInitializationTests.cs b/src/Tests/Analyzers.Tests/RCS1129RemoveRedundantFieldInitializationTests.cs index 8c8cb9b442..c943b365ec 100644 --- a/src/Tests/Analyzers.Tests/RCS1129RemoveRedundantFieldInitializationTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1129RemoveRedundantFieldInitializationTests.cs @@ -13,7 +13,7 @@ public class RCS1129RemoveRedundantFieldInitializationTests : AbstractCSharpDiag { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantFieldInitialization; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_MultipleDeclarations() { await VerifyDiagnosticAndFixAsync(@" @@ -29,7 +29,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_Number() { await VerifyDiagnosticAndFixAsync(@" @@ -65,7 +65,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_Bool() { await VerifyDiagnosticAndFixAsync(@" @@ -81,7 +81,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_Bool_Nullable() { await VerifyDiagnosticAndFixAsync(@" @@ -99,7 +99,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_Char() { await VerifyDiagnosticAndFixAsync(@" @@ -115,7 +115,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_Int() { await VerifyDiagnosticAndFixAsync(@" @@ -131,7 +131,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_ULong() { await VerifyDiagnosticAndFixAsync(@" @@ -147,7 +147,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_Enum() { await VerifyDiagnosticAndFixAsync(@" @@ -175,7 +175,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task TestString() { await VerifyDiagnosticAndFixAsync(@" @@ -197,7 +197,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task Test_StructWithoutConstructor() { await VerifyDiagnosticAndFixAsync(@" @@ -223,7 +223,7 @@ public C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -239,7 +239,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task TestNoDiagnostic_StructWithConstructor() { await VerifyNoDiagnosticAsync(@" @@ -254,7 +254,7 @@ public C(object p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task TestNoDiagnostic_SuppressNullableWarningExpression() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1132RemoveRedundantOverridingMemberTests.cs b/src/Tests/Analyzers.Tests/RCS1132RemoveRedundantOverridingMemberTests.cs index cdd0263de1..60f73b062f 100644 --- a/src/Tests/Analyzers.Tests/RCS1132RemoveRedundantOverridingMemberTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1132RemoveRedundantOverridingMemberTests.cs @@ -12,7 +12,7 @@ public class RCS1132RemoveRedundantOverridingMemberTests : AbstractCSharpDiagnos { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantOverridingMember; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantOverridingMember)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantOverridingMember)] public async Task TestNoDiagnostic_Record() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1134RemoveRedundantStatementTests.cs b/src/Tests/Analyzers.Tests/RCS1134RemoveRedundantStatementTests.cs index 258c79b80a..dabe221329 100644 --- a/src/Tests/Analyzers.Tests/RCS1134RemoveRedundantStatementTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1134RemoveRedundantStatementTests.cs @@ -12,7 +12,7 @@ public class RCS1134RemoveRedundantStatementTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantStatement; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantStatement)] public async Task Test_SimpleIf_ReturnNull() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ string M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantStatement)] public async Task Test_SimpleIf_ReturnDefault() { await VerifyDiagnosticAndFixAsync(@" @@ -82,7 +82,7 @@ string M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantStatement)] public async Task Test_SimpleIf_ReturnTrue() { await VerifyDiagnosticAndFixAsync(@" @@ -117,7 +117,7 @@ bool M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantStatement)] public async Task Test_SimpleIf_ReturnFalse() { await VerifyDiagnosticAndFixAsync(@" @@ -152,7 +152,7 @@ bool M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantStatement)] public async Task Test_SimpleLambdaBody() { await VerifyDiagnosticAndFixAsync(@" @@ -197,7 +197,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantStatement)] public async Task Test_ParenthesizedLambdaBody() { await VerifyDiagnosticAndFixAsync(@" @@ -242,7 +242,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantStatement)] public async Task Test_AnonymousMethodBody() { await VerifyDiagnosticAndFixAsync(@" @@ -287,7 +287,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantStatement)] public async Task TestNoDiagnostic_SimpleIf_ExpressionsAreNotEquivalent() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1135DeclareEnumMemberWithZeroValueTests.cs b/src/Tests/Analyzers.Tests/RCS1135DeclareEnumMemberWithZeroValueTests.cs index 838bf8b846..df82c044d5 100644 --- a/src/Tests/Analyzers.Tests/RCS1135DeclareEnumMemberWithZeroValueTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1135DeclareEnumMemberWithZeroValueTests.cs @@ -12,7 +12,7 @@ public class RCS1135DeclareEnumMemberWithZeroValueTests : AbstractCSharpDiagnost { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.DeclareEnumMemberWithZeroValue; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumMemberWithZeroValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumMemberWithZeroValue)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -35,7 +35,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumMemberWithZeroValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumMemberWithZeroValue)] public async Task TestNoDiagnostic_HasZeroValue() { await VerifyNoDiagnosticAsync(@" @@ -51,7 +51,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumMemberWithZeroValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumMemberWithZeroValue)] public async Task TestNoDiagnostic_WithoutFlags() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1139AddSummaryElementToDocumentationCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1139AddSummaryElementToDocumentationCommentTests.cs index 4440d63aa0..e7d6f42511 100644 --- a/src/Tests/Analyzers.Tests/RCS1139AddSummaryElementToDocumentationCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1139AddSummaryElementToDocumentationCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1139AddSummaryElementToDocumentationCommentTests : AbstractCShar { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddSummaryElementToDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddSummaryElementToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddSummaryElementToDocumentationComment)] public async Task Test_Class() { await VerifyDiagnosticAndFixAsync(""" @@ -31,7 +31,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddSummaryElementToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddSummaryElementToDocumentationComment)] public async Task TestNoDiagnostic_PartialClassWithContentElement() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1140AddExceptionToDocumentationCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1140AddExceptionToDocumentationCommentTests.cs index 2d34166d12..b4d4e742e1 100644 --- a/src/Tests/Analyzers.Tests/RCS1140AddExceptionToDocumentationCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1140AddExceptionToDocumentationCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1140AddExceptionToDocumentationCommentTests : AbstractCSharpDiag { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddExceptionToDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddExceptionToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddExceptionToDocumentationComment)] public async Task Test_Example_From_Documentation() { await VerifyDiagnosticAndFixAsync(""" @@ -51,7 +51,7 @@ public void Foo(object parameter) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddExceptionToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddExceptionToDocumentationComment)] public async Task Test_No_Diagnostic_If_Exception_Is_Caught_In_Method() { await VerifyNoDiagnosticAsync(""" @@ -76,7 +76,7 @@ public void Foo(object parameter) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddExceptionToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddExceptionToDocumentationComment)] public async Task Test_No_Diagnostic_If_Exception_Is_Caught_In_Method_Nested() { await VerifyNoDiagnosticAsync(""" @@ -105,7 +105,7 @@ public void Foo(object parameter) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddExceptionToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddExceptionToDocumentationComment)] public async Task Test_Diagnostic_If_Not_Correct_Exception_Is_Caught_In_Method() { await VerifyDiagnosticAndFixAsync(""" @@ -152,7 +152,7 @@ public void Foo(object parameter) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddExceptionToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddExceptionToDocumentationComment)] public async Task TestNoDiagnostic_CatchWithoutDeclaration() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1141AddParamElementToDocumentationCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1141AddParamElementToDocumentationCommentTests.cs index 798da76b49..54f28a17ee 100644 --- a/src/Tests/Analyzers.Tests/RCS1141AddParamElementToDocumentationCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1141AddParamElementToDocumentationCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1141AddParamElementToDocumentationCommentTests : AbstractCSharpD { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddParamElementToDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddParamElementToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddParamElementToDocumentationComment)] public async Task Test() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1142AddTypeParamElementToDocumentationCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1142AddTypeParamElementToDocumentationCommentTests.cs index a601cac9b8..a91556f20e 100644 --- a/src/Tests/Analyzers.Tests/RCS1142AddTypeParamElementToDocumentationCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1142AddTypeParamElementToDocumentationCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1142AddTypeParamElementToDocumentationCommentTests : AbstractCSh { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddTypeParamElementToDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddTypeParamElementToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddTypeParamElementToDocumentationComment)] public async Task Test() { await VerifyDiagnosticAndFixAsync(""" @@ -36,7 +36,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddTypeParamElementToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddTypeParamElementToDocumentationComment)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1143SimplifyCoalesceExpressionTests.cs b/src/Tests/Analyzers.Tests/RCS1143SimplifyCoalesceExpressionTests.cs index c154afbcae..20b60351b1 100644 --- a/src/Tests/Analyzers.Tests/RCS1143SimplifyCoalesceExpressionTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1143SimplifyCoalesceExpressionTests.cs @@ -12,7 +12,7 @@ public class RCS1143SimplifyCoalesceExpressionTests : AbstractCSharpDiagnosticVe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyCoalesceExpression; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCoalesceExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCoalesceExpression)] public async Task Test_DefaultOfNullableType() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1145RemoveRedundantAsOperatorTests.cs b/src/Tests/Analyzers.Tests/RCS1145RemoveRedundantAsOperatorTests.cs index 00cca1e9c1..dbfdf02053 100644 --- a/src/Tests/Analyzers.Tests/RCS1145RemoveRedundantAsOperatorTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1145RemoveRedundantAsOperatorTests.cs @@ -12,7 +12,7 @@ public class RCS1145RemoveRedundantAsOperatorTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantAsOperator; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsOperator)] public async Task TestNoDiagnostic_Dynamic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1146UseConditionalAccessTests.cs b/src/Tests/Analyzers.Tests/RCS1146UseConditionalAccessTests.cs index ef1c451928..4d7d5411d9 100644 --- a/src/Tests/Analyzers.Tests/RCS1146UseConditionalAccessTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1146UseConditionalAccessTests.cs @@ -12,7 +12,7 @@ public class RCS1146UseConditionalAccessTests : AbstractCSharpDiagnosticVerifier { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseConditionalAccess; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_IfStatement_ReferenceType() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_IfStatement_ValueType() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_IfStatement_PatternMatching() { await VerifyDiagnosticAndFixAsync(@" @@ -109,7 +109,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_LogicalAnd_ReferenceType() { await VerifyDiagnosticAndFixAsync(""" @@ -212,7 +212,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_LogicalAnd_ReferenceType_PatternMatching() { await VerifyDiagnosticAndFixAsync(@" @@ -238,7 +238,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_LogicalOr_ReferenceType() { await VerifyDiagnosticAndFixAsync(@" @@ -284,7 +284,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_LogicalAnd_ElementAccess() { await VerifyDiagnosticAndFixAsync(""" @@ -322,7 +322,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_LogicalAnd_Nested() { await VerifyDiagnosticAndFixAsync(@" @@ -366,7 +366,7 @@ Foo M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_LogicalAnd_NullableType() { await VerifyDiagnosticAndFixAsync(""" @@ -432,7 +432,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_LogicalOr_NullableType() { await VerifyDiagnosticAndFixAsync(@" @@ -462,7 +462,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task Test_LogicalAnd_Nested_NullableType() { await VerifyDiagnosticAndFixAsync(@" @@ -491,7 +491,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalAnd_ReferenceType() { await VerifyNoDiagnosticAsync(""" @@ -530,7 +530,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalOr_ReferenceType() { await VerifyNoDiagnosticAsync(""" @@ -580,7 +580,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalAnd_ValueType() { await VerifyNoDiagnosticAsync(@" @@ -601,7 +601,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalAnd_ValueTypeFieldAccess() { await VerifyNoDiagnosticAsync(""" @@ -621,7 +621,7 @@ void M(C c) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalAnd_NullableType() { await VerifyNoDiagnosticAsync(@" @@ -668,7 +668,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalOr_NullableType() { await VerifyNoDiagnosticAsync(""" @@ -734,7 +734,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalAnd_OutParameter() { await VerifyNoDiagnosticAsync(@" @@ -756,7 +756,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalAnd_OutParameter2() { await VerifyNoDiagnosticAsync(@" @@ -780,7 +780,7 @@ bool TryGetValue(string key, out string value) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalOr_OutParameter() { await VerifyNoDiagnosticAsync(@" @@ -802,7 +802,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalAnd_ExpressionTree() { await VerifyNoDiagnosticAsync(@" @@ -821,7 +821,7 @@ public void M(Expression> expression) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LogicalOr_ExpressionTree() { await VerifyNoDiagnosticAsync(@" @@ -840,7 +840,7 @@ public void M(Expression> expression) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LocalDeclaration_ExpressionTree() { await VerifyNoDiagnosticAsync(@" @@ -857,7 +857,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_TypeOverloadsOrOperatorAndImplicitConversionToBooleanDoesNotExist() { await VerifyNoDiagnosticAsync(@" @@ -904,7 +904,7 @@ struct SqlBoolean "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_PreprocessorDirective() { await VerifyNoDiagnosticAsync(@" @@ -925,7 +925,7 @@ void M(string s) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_PointerType() { await VerifyNoDiagnosticAsync(@" @@ -945,7 +945,7 @@ void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_LanguageVersion() { await VerifyNoDiagnosticAsync(@" @@ -964,7 +964,7 @@ void M() ", options: WellKnownCSharpTestOptions.Default_CSharp5); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccess)] public async Task TestNoDiagnostic_IsNotPattern() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1151RemoveRedundantCastTests.cs b/src/Tests/Analyzers.Tests/RCS1151RemoveRedundantCastTests.cs index c3d099298d..cd93997fe8 100644 --- a/src/Tests/Analyzers.Tests/RCS1151RemoveRedundantCastTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1151RemoveRedundantCastTests.cs @@ -12,7 +12,7 @@ public class RCS1151RemoveRedundantCastTests : AbstractCSharpDiagnosticVerifier< { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantCast; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task Test_CastToDerivedType() { await VerifyDiagnosticAndFixAsync(@" @@ -52,7 +52,7 @@ class B : C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task Test_CastToDerivedType_ConditionalAccess() { await VerifyDiagnosticAndFixAsync(@" @@ -92,7 +92,7 @@ class B : C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task Test_CastToImplementedInterface() { await VerifyDiagnosticAndFixAsync(@" @@ -122,7 +122,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task Test_CastToImplementedInterface_ConditionalAccess() { await VerifyDiagnosticAndFixAsync(@" @@ -152,7 +152,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task Test_CastToIDisposable() { await VerifyDiagnosticAndFixAsync(@" @@ -196,7 +196,7 @@ public void Dispose() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task Test_Accessibility() { await VerifyDiagnosticAndFixAsync(@" @@ -262,7 +262,7 @@ protected internal void ProtectedInternal() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task Test_Accessibility_ProtectedInternal() { await VerifyDiagnosticAndFixAsync(@" @@ -298,7 +298,7 @@ protected internal void ProtectedInternal() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task TestNoDiagnostic_NotAccessible() { await VerifyNoDiagnosticAsync(@" @@ -321,7 +321,7 @@ void M(B b) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task TestNoDiagnostic_ExplicitImplementation() { await VerifyNoDiagnosticAsync(@" @@ -364,7 +364,7 @@ void IDisposable.Dispose() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task TestNoDiagnostic_ExplicitImplementationOfGenericMethod() { await VerifyNoDiagnosticAsync(@" @@ -385,7 +385,7 @@ void IC.M(T t) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task TestNoDiagnostic_CastToDerivedType() { await VerifyNoDiagnosticAsync(@" @@ -407,7 +407,7 @@ class B : C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] internal async Task TestNoDiagnostic_DefaultInterfaceImplementation() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1151RemoveRedundantCastTests2.cs b/src/Tests/Analyzers.Tests/RCS1151RemoveRedundantCastTests2.cs index fca4b458b6..c4819bb88d 100644 --- a/src/Tests/Analyzers.Tests/RCS1151RemoveRedundantCastTests2.cs +++ b/src/Tests/Analyzers.Tests/RCS1151RemoveRedundantCastTests2.cs @@ -12,7 +12,7 @@ public class RCS1151RemoveRedundantCastTests2 : AbstractCSharpDiagnosticVerifier { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantCast; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task Test_CastToDerivedType() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task TestNoDiagnostic_CastFromObject() { await VerifyNoDiagnosticAsync(@" @@ -66,7 +66,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] public async Task TestNoDiagnostic_CastFromDynamic() { await VerifyNoDiagnosticAsync(@" @@ -85,7 +85,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCast)] internal async Task TestNoDiagnostic_NullableReferenceType() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1154SortEnumMembersTests.cs b/src/Tests/Analyzers.Tests/RCS1154SortEnumMembersTests.cs index ed2756fe5e..2148a827be 100644 --- a/src/Tests/Analyzers.Tests/RCS1154SortEnumMembersTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1154SortEnumMembersTests.cs @@ -12,7 +12,7 @@ public class RCS1154SortEnumMembersTests : AbstractCSharpDiagnosticVerifier }"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.StaticMemberInGenericTypeShouldUseTypeParameter)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.StaticMemberInGenericTypeShouldUseTypeParameter)] public async Task TestNoDiagnostic_Field() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1159UseGenericEventHandlerTests.cs b/src/Tests/Analyzers.Tests/RCS1159UseGenericEventHandlerTests.cs index 6393be1b32..70ea2dc0bf 100644 --- a/src/Tests/Analyzers.Tests/RCS1159UseGenericEventHandlerTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1159UseGenericEventHandlerTests.cs @@ -12,7 +12,7 @@ public class RCS1159UseGenericEventHandlerTests : AbstractCSharpDiagnosticVerifi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseGenericEventHandler; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseGenericEventHandler)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseGenericEventHandler)] public async Task Test_EventField() { await VerifyDiagnosticAndFixAsync(@" @@ -44,7 +44,7 @@ class FooEventArgs : EventArgs "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseGenericEventHandler)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseGenericEventHandler)] public async Task Test_Event() { await VerifyDiagnosticAndFixAsync(@" @@ -84,7 +84,7 @@ class FooEventArgs : EventArgs "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseGenericEventHandler)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseGenericEventHandler)] public async Task Test_Interface() { await VerifyDiagnosticAndFixAsync(@" @@ -116,7 +116,7 @@ public class FooEventArgs : EventArgs "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseGenericEventHandler)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseGenericEventHandler)] public async Task Test_InterfaceImplementation() { await VerifyDiagnosticAndFixAsync(@" @@ -148,7 +148,7 @@ class FooEventArgs : EventArgs "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseGenericEventHandler)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseGenericEventHandler)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -187,7 +187,7 @@ event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseGenericEventHandler)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseGenericEventHandler)] public async Task TestNoDiagnostic_NonVoidDelegate() { await VerifyNoDiagnosticAsync(@" @@ -209,7 +209,7 @@ class FooEventArgs "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseGenericEventHandler)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseGenericEventHandler)] public async Task TestNoDiagnostic_EventArgsIsRefStruct() { await VerifyNoDiagnosticAsync(@" @@ -226,7 +226,7 @@ public interface IEventTest "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseGenericEventHandler)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseGenericEventHandler)] public async Task TestNoDiagnostic_Wpf_RoutedEventHandler() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1161EnumMemberShouldDeclareExplicitValueTests.cs b/src/Tests/Analyzers.Tests/RCS1161EnumMemberShouldDeclareExplicitValueTests.cs index ee795322ea..41a0b65a45 100644 --- a/src/Tests/Analyzers.Tests/RCS1161EnumMemberShouldDeclareExplicitValueTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1161EnumMemberShouldDeclareExplicitValueTests.cs @@ -12,7 +12,7 @@ public class RCS1161EnumShouldDeclareExplicitValuesTests : AbstractCSharpDiagnos { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.EnumShouldDeclareExplicitValues; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_AllValues() { await VerifyDiagnosticAndFixAsync(@" @@ -34,7 +34,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_AllValues_MissingComma() { await VerifyDiagnosticAndFixAsync(@" @@ -56,7 +56,7 @@ enum Foo ", options: Options.AddAllowedCompilerDiagnosticId("CS1003")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_WithComments() { await VerifyDiagnosticAndFixAsync(@" @@ -76,7 +76,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_SomeValues() { await VerifyDiagnosticAndFixAsync(@" @@ -102,7 +102,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_Flags() { await VerifyDiagnosticAndFixAsync(@" @@ -130,7 +130,7 @@ enum Foo ", equivalenceKey: EquivalenceKey.Create(Descriptor.Id)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_Flags_BitShift() { await VerifyDiagnosticAndFixAsync(@" @@ -158,7 +158,7 @@ enum Foo ", equivalenceKey: EquivalenceKey.Create(Descriptor.Id, "BitShift")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_Flags2() { await VerifyDiagnosticAndFixAsync(@" @@ -190,7 +190,7 @@ enum Foo ", equivalenceKey: EquivalenceKey.Create(Descriptor.Id)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_Flags_SByte() { await VerifyDiagnosticAndFixAsync(@" @@ -226,7 +226,7 @@ enum Foo : sbyte ", equivalenceKey: EquivalenceKey.Create(Descriptor.Id)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.EnumShouldDeclareExplicitValues)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.EnumShouldDeclareExplicitValues)] public async Task Test_Flags_SByte_MaxValue() { await VerifyDiagnosticAndNoFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1163UnusedParameterTests.cs b/src/Tests/Analyzers.Tests/RCS1163UnusedParameterTests.cs index c2db0310e1..9e31e97296 100644 --- a/src/Tests/Analyzers.Tests/RCS1163UnusedParameterTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1163UnusedParameterTests.cs @@ -12,7 +12,7 @@ public class RCS1163UnusedParameterTests : AbstractCSharpDiagnosticVerifier M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeFieldReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeFieldReadOnly)] public async Task TestNoDiagnostic_ReturnRef() { await VerifyNoDiagnosticAsync(@" @@ -351,7 +351,7 @@ ref int M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeFieldReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeFieldReadOnly)] public async Task TestNoDiagnostic_SuppressNullableWarning() { await VerifyNoDiagnosticAsync(@" @@ -365,7 +365,7 @@ void M(ref int x) {} "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeFieldReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeFieldReadOnly)] public async Task TestNoDiagnostic_RefInRef() { await VerifyNoDiagnosticAsync(@" @@ -378,7 +378,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeFieldReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeFieldReadOnly)] public async Task TestNoDiagnostic_UnitySerializeAttribute() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1170UseReadOnlyAutoPropertyTests.cs b/src/Tests/Analyzers.Tests/RCS1170UseReadOnlyAutoPropertyTests.cs index 16bd7aae48..94cfa8d196 100644 --- a/src/Tests/Analyzers.Tests/RCS1170UseReadOnlyAutoPropertyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1170UseReadOnlyAutoPropertyTests.cs @@ -13,7 +13,7 @@ public class RCS1170UseReadOnlyAutoPropertyTests : AbstractCSharpDiagnosticVerif { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseReadOnlyAutoProperty; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task Test_InstanceProperty() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ public C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task Test_InstanceProperty_Int32() { await VerifyDiagnosticAndFixAsync(@" @@ -67,7 +67,7 @@ public C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task Test_InstanceProperty_Enum() { await VerifyDiagnosticAndFixAsync(@" @@ -97,7 +97,7 @@ public C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task Test_InstanceProperty_ReadOnlyStruct() { await VerifyDiagnosticAndFixAsync(@" @@ -131,7 +131,7 @@ readonly struct B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task Test_StaticProperty() { await VerifyDiagnosticAndFixAsync(@" @@ -161,7 +161,7 @@ static C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_ReadOnlyProperty() { await VerifyNoDiagnosticAsync(@" @@ -172,7 +172,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_FullProperty() { await VerifyNoDiagnosticAsync(@" @@ -189,7 +189,7 @@ public int P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_Assigned() { await VerifyNoDiagnosticAsync(@" @@ -205,7 +205,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_Struct() { await VerifyNoDiagnosticAsync(@" @@ -220,7 +220,7 @@ struct B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_Tuple() { await VerifyNoDiagnosticAsync(@" @@ -237,7 +237,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_AssignedInConstructor_LocalFunction() { await VerifyNoDiagnosticAsync(@" @@ -256,7 +256,7 @@ void LF() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_AssignedInConstructor_SimpleLambda() { await VerifyNoDiagnosticAsync(@" @@ -281,7 +281,7 @@ public C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_AssignedInConstructor_ParenthesizedLambda() { await VerifyNoDiagnosticAsync(@" @@ -306,7 +306,7 @@ public C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_AssignedInConstructor_AnonymousMethod() { await VerifyNoDiagnosticAsync(@" @@ -331,7 +331,7 @@ public C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_StaticPropertyAssignedInInstanceConstructor() { await VerifyNoDiagnosticAsync(@" @@ -347,7 +347,7 @@ public C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_Generic() { await VerifyNoDiagnosticAsync(@" @@ -367,7 +367,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_VariablePropertyAssignedInConstructor() { await VerifyNoDiagnosticAsync(@" @@ -385,7 +385,7 @@ public C(C c) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_DateMemberAttribute() { await VerifyNoDiagnosticAsync(@" @@ -407,7 +407,7 @@ internal class DataMemberAttribute : Attribute }", options: Options.AddAllowedCompilerDiagnosticId("CS0436")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_SetterHasAttribute() { await VerifyNoDiagnosticAsync(@" @@ -420,7 +420,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_AssignedSymbolIsNull() { await VerifyNoDiagnosticAsync(@" @@ -444,7 +444,7 @@ class C2 ", options: Options.AddAllowedCompilerDiagnosticId("CS1061")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_ReadOnlyAutoPropertyNotAvailableInCSharp5() { await VerifyNoDiagnosticAsync(@" @@ -455,7 +455,7 @@ class C ", options: WellKnownCSharpTestOptions.Default_CSharp5); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_InitSetter() { await VerifyNoDiagnosticAsync(@" @@ -466,7 +466,7 @@ class C ", options: Options.AddAllowedCompilerDiagnosticId("CS0518")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_DependencyAttribute() { await VerifyNoDiagnosticAsync(@" @@ -485,7 +485,7 @@ class DependencyAttribute : Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_ParameterAttribute() { await VerifyNoDiagnosticAsync(@" @@ -508,7 +508,7 @@ class ParameterAttribute : Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_CascadingParameterAttribute() { await VerifyNoDiagnosticAsync(@" @@ -531,7 +531,7 @@ class CascadingParameterAttribute : Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReadOnlyAutoProperty)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseReadOnlyAutoProperty)] public async Task TestNoDiagnostic_InjectAttribute() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1171SimplifyLazyInitializationTests.cs b/src/Tests/Analyzers.Tests/RCS1171SimplifyLazyInitializationTests.cs index 1035484c97..bad3dc51d1 100644 --- a/src/Tests/Analyzers.Tests/RCS1171SimplifyLazyInitializationTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1171SimplifyLazyInitializationTests.cs @@ -12,7 +12,7 @@ public class RCS1171SimplifyLazyInitializationTests : AbstractCSharpDiagnosticVe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyLazyInitialization; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_IfWithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ object M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_IfWithBraces_UseCoalesceAssignment() { await VerifyDiagnosticAndFixAsync(@" @@ -82,7 +82,7 @@ object M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_IfWithoutBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -115,7 +115,7 @@ object M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_NullOnLeftSide() { await VerifyDiagnosticAndFixAsync(@" @@ -150,7 +150,7 @@ object M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_QualifiedWithThis() { await VerifyDiagnosticAndFixAsync(@" @@ -185,7 +185,7 @@ object M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_QualifiedWithThis_UseCoalesceAssignment() { await VerifyDiagnosticAndFixAsync(@" @@ -220,7 +220,7 @@ object M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_MemberInitialization() { await VerifyDiagnosticAndFixAsync(@" @@ -257,7 +257,7 @@ object M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_MemberInitialization_UseCoalesceAssignment() { await VerifyDiagnosticAndFixAsync(@" @@ -294,7 +294,7 @@ object M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -333,7 +333,7 @@ object P ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Indexer() { await VerifyDiagnosticAndFixAsync(@" @@ -374,7 +374,7 @@ object this[int index] ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable() { await VerifyDiagnosticAndFixAsync(@" @@ -409,7 +409,7 @@ class C ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable_Value() { await VerifyDiagnosticAndFixAsync(@" @@ -444,7 +444,7 @@ int M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable_Value_UseCoalesceAssignment() { await VerifyDiagnosticAndFixAsync(@" @@ -479,7 +479,7 @@ int M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable_Value_QualifiedWithThis() { await VerifyDiagnosticAndFixAsync(@" @@ -514,7 +514,7 @@ int M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable_Value_QualifiedWithThis_UseCoalesceAssignment() { await VerifyDiagnosticAndFixAsync(@" @@ -549,7 +549,7 @@ int M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable_Value_MemberInitialization() { await VerifyDiagnosticAndFixAsync(@" @@ -586,7 +586,7 @@ int M() ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable_Value_MemberInitialization_UseCoalesceAssignment() { await VerifyDiagnosticAndFixAsync(@" @@ -623,7 +623,7 @@ int M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable_HasValue() { await VerifyDiagnosticAndFixAsync(@" @@ -658,7 +658,7 @@ class C ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task Test_Nullable_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -697,7 +697,7 @@ class C ", options: WellKnownCSharpTestOptions.Default_CSharp7_3); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task TestNoDiagnostic_OverrideEqualsOperator() { await VerifyNoDiagnosticAsync(@" @@ -725,7 +725,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task TestNoDiagnostic_OverrideBaseEqualsOperator() { await VerifyNoDiagnosticAsync(@" @@ -753,7 +753,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task TestNoDiagnostic_IfElse() { await VerifyNoDiagnosticAsync(@" @@ -779,7 +779,7 @@ object M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyLazyInitialization)] public async Task TestNoDiagnostic_Property_IfElse() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1173UseCoalesceExpressionInsteadOfIfTests.cs b/src/Tests/Analyzers.Tests/RCS1173UseCoalesceExpressionInsteadOfIfTests.cs index 26339f428f..27aaa4bb01 100644 --- a/src/Tests/Analyzers.Tests/RCS1173UseCoalesceExpressionInsteadOfIfTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1173UseCoalesceExpressionInsteadOfIfTests.cs @@ -12,7 +12,7 @@ public class RCS1173UseCoalesceExpressionInsteadOfIfTests : AbstractCSharpDiagno { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseCoalesceExpressionInsteadOfIf; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfIf)] public async Task Test_IfElseToAssignment() { await VerifyDiagnosticAndFixAsync(@" @@ -43,7 +43,7 @@ void M(string x, string y, string z) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfIf)] public async Task Test_IfElseToReturn() { await VerifyDiagnosticAndFixAsync(@" @@ -74,7 +74,7 @@ string M(string x, string y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfIf)] public async Task Test_IfElseToYieldReturn() { await VerifyDiagnosticAndFixAsync(@" @@ -109,7 +109,7 @@ IEnumerable M(string x, string y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfIf)] public async Task Test_IfReturnToReturn() { await VerifyDiagnosticAndFixAsync(@" @@ -138,7 +138,7 @@ string M(string x, string y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfIf)] public async Task TestNoDiagnostic_IfElseContainsComment() { await VerifyNoDiagnosticAsync(@" @@ -160,7 +160,7 @@ void M(string x, string y, string z) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfIf)] public async Task TestNoDiagnostic_IfElseContainsDirective() { await VerifyNoDiagnosticAsync(@" @@ -183,7 +183,7 @@ void M(string x, string y, string z) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfIf)] public async Task TestNoDiagnostic_IfReturnContainsComment() { await VerifyNoDiagnosticAsync(@" @@ -203,7 +203,7 @@ void M(string x, string y, string z) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfIf)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseCoalesceExpressionInsteadOfIf)] public async Task TestNoDiagnostic_IfReturnContainsDirective() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1174RemoveRedundantAsyncAwaitTests.cs b/src/Tests/Analyzers.Tests/RCS1174RemoveRedundantAsyncAwaitTests.cs index e7b11bc8da..38544da07a 100644 --- a/src/Tests/Analyzers.Tests/RCS1174RemoveRedundantAsyncAwaitTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1174RemoveRedundantAsyncAwaitTests.cs @@ -17,7 +17,7 @@ public override CSharpTestOptions Options get { return base.Options.AddAllowedCompilerDiagnosticId(CompilerDiagnosticIdentifiers.CS0162_UnreachableCodeDetected); } } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_Method_Body_ReturnAwait() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ Task GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_Method_Body_ReturnAwait_ConfigureAwait() { await VerifyDiagnosticAndFixAsync(@" @@ -73,7 +73,7 @@ Task GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_Method_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -93,7 +93,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_LocalFunction_Body_ReturnAwait() { await VerifyDiagnosticAndFixAsync(@" @@ -125,7 +125,7 @@ Task GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_LocalFunction_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -151,7 +151,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_SimpleLambda_Body() { await VerifyDiagnosticAndFixAsync(@" @@ -189,7 +189,7 @@ Task GetAsync() ", options: Options.AddAllowedCompilerDiagnosticId("CS1998")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_SimpleLambda_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -221,7 +221,7 @@ Task GetAsync() ", options: Options.AddAllowedCompilerDiagnosticId("CS1998")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_ParenthesizedLambda_Body() { await VerifyDiagnosticAndFixAsync(@" @@ -259,7 +259,7 @@ Task GetAsync() ", options: Options.AddAllowedCompilerDiagnosticId("CS1998")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_ParenthesizedLambda_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -291,7 +291,7 @@ Task GetAsync() ", options: Options.AddAllowedCompilerDiagnosticId("CS1998")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_AnonymousMethod() { await VerifyDiagnosticAndFixAsync(@" @@ -329,7 +329,7 @@ Task GetAsync() ", options: Options.AddAllowedCompilerDiagnosticId("CS1998")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_IfElseIfReturn() { await VerifyDiagnosticAndFixAsync(@" @@ -377,7 +377,7 @@ Task GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_IfElse() { await VerifyDiagnosticAndFixAsync(@" @@ -421,7 +421,7 @@ Task GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_SwitchWithoutDefaultSection() { await VerifyDiagnosticAndFixAsync(@" @@ -475,7 +475,7 @@ Task GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_SwitchWithDefaultSection() { await VerifyDiagnosticAndFixAsync(""" @@ -533,7 +533,7 @@ Task GetAsync() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task Test_DuckTyped_TaskType() { await VerifyDiagnosticAndFixAsync(@" @@ -605,7 +605,7 @@ static class ConfigureAwaitExtensions "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_IfElse_ReturnWithoutAwait() { await VerifyNoDiagnosticAsync(@" @@ -636,7 +636,7 @@ async Task FooAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_IfElse_AwaitWithoutReturn() { await VerifyNoDiagnosticAsync(@" @@ -663,7 +663,7 @@ async Task FooAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_Switch_ReturnWithoutAwait() { await VerifyNoDiagnosticAsync(@" @@ -699,7 +699,7 @@ async Task FooAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_Switch_AwaitWithoutReturn() { await VerifyNoDiagnosticAsync(@" @@ -731,7 +731,7 @@ async Task FooAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_Method_ReturnWithoutAwait() { await VerifyNoDiagnosticAsync(@" @@ -759,7 +759,7 @@ async Task FooAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_Method_AwaitWithoutReturn() { await VerifyNoDiagnosticAsync(@" @@ -787,7 +787,7 @@ async Task FooAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_Method_ReturnsTask() { await VerifyNoDiagnosticAsync(@" @@ -803,7 +803,7 @@ async Task DoAsync() ", options: Options.AddAllowedCompilerDiagnosticId(CompilerDiagnosticIdentifiers.CS1997_SinceMethodIsAsyncMethodThatReturnsTaskReturnKeywordMustNotBeFollowedByObjectExpression)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_ReturnTypeAndAwaitTypeDoNotEqual() { await VerifyNoDiagnosticAsync(""" @@ -923,7 +923,7 @@ async Task SwitchWithDefaultAsync() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_AwaitContainsAwait() { await VerifyNoDiagnosticAsync(""" @@ -1045,7 +1045,7 @@ async Task SwitchWithDefaultAsync() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAsyncAwait)] public async Task TestNoDiagnostic_UsingDeclaration() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1179UnnecessaryAssignmentTests.cs b/src/Tests/Analyzers.Tests/RCS1179UnnecessaryAssignmentTests.cs index b05b4cd460..4a5cec5c19 100644 --- a/src/Tests/Analyzers.Tests/RCS1179UnnecessaryAssignmentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1179UnnecessaryAssignmentTests.cs @@ -12,7 +12,7 @@ public class RCS1179UnnecessaryAssignmentTests : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryAssignment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryAssignment)] public async Task Test_IfStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -55,7 +55,7 @@ int M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryAssignment)] public async Task Test_IfStatement2() { await VerifyDiagnosticAndFixAsync(@" @@ -102,7 +102,7 @@ int M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryAssignment)] public async Task Test_IfStatement_Throw() { await VerifyDiagnosticAndFixAsync(@" @@ -158,7 +158,7 @@ int M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryAssignment)] public async Task Test_SwitchStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -205,7 +205,7 @@ int M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryAssignment)] public async Task Test_SwitchStatement2() { await VerifyDiagnosticAndFixAsync(""" @@ -256,7 +256,7 @@ int M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryAssignment)] public async Task Test_SwitchStatement_Throw() { await VerifyDiagnosticAndFixAsync(""" @@ -312,7 +312,7 @@ int M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryAssignment)] public async Task Test_NoDiagnostic_ForPolymorphicIf() { await VerifyNoDiagnosticAsync( @@ -342,7 +342,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryAssignment)] public async Task Test_NoDiagnostic_ForPolymorphicSwitch() { await VerifyNoDiagnosticAsync( diff --git a/src/Tests/Analyzers.Tests/RCS1180InlineLazyInitializationTests.cs b/src/Tests/Analyzers.Tests/RCS1180InlineLazyInitializationTests.cs index 5c236f505a..3821e1060f 100644 --- a/src/Tests/Analyzers.Tests/RCS1180InlineLazyInitializationTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1180InlineLazyInitializationTests.cs @@ -12,7 +12,7 @@ public class RCS1180InlineLazyInitializationTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.InlineLazyInitialization; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLazyInitialization)] public async Task Test_If() { await VerifyDiagnosticAndFixAsync(""" @@ -51,7 +51,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLazyInitialization)] public async Task Test_If_WithoutBraces() { await VerifyDiagnosticAndFixAsync(""" @@ -88,7 +88,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLazyInitialization)] public async Task Test_If_Trivia() { await VerifyDiagnosticAndFixAsync(""" @@ -132,7 +132,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InlineLazyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InlineLazyInitialization)] public async Task Test_If_CSharp7_3() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1181ConvertCommentToDocumentationCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1181ConvertCommentToDocumentationCommentTests.cs index 4efc5ad076..a6f0adb839 100644 --- a/src/Tests/Analyzers.Tests/RCS1181ConvertCommentToDocumentationCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1181ConvertCommentToDocumentationCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1181ConvertCommentToDocumentationCommentTests : AbstractCSharpDi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.ConvertCommentToDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_LeadingComment() { await VerifyDiagnosticAndFixAsync(@" @@ -36,7 +36,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_LeadingMultipleComments() { await VerifyDiagnosticAndFixAsync(@" @@ -62,7 +62,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_TrailingComment() { await VerifyDiagnosticAndFixAsync(@" @@ -85,7 +85,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_TrailingComment2() { await VerifyDiagnosticAndFixAsync(""" @@ -110,7 +110,7 @@ void M() where T1 : class where T2 : class """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_TrailingComment_EnumMember() { await VerifyDiagnosticAndFixAsync(@" @@ -129,7 +129,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_TrailingComment_EnumMemberWithValueAndWithComma() { await VerifyDiagnosticAndFixAsync(@" @@ -150,7 +150,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_TrailingComment_EnumMemberWithoutValueAndWithComma() { await VerifyDiagnosticAndFixAsync(@" @@ -171,7 +171,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_LeadingTodoCommentTrailingComment() { await VerifyDiagnosticAndFixAsync(@" @@ -196,7 +196,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task Test_CommentContainsXmlSpecialChars() { await VerifyDiagnosticAndFixAsync(""" @@ -227,7 +227,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task TestNoDiagnostic_DocumentationComment() { await VerifyNoDiagnosticAsync(@" @@ -243,7 +243,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task TestNoDiagnostic_DocumentationCommentAndTrailingComment() { await VerifyNoDiagnosticAsync(@" @@ -259,7 +259,7 @@ void M() // x "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task TestNoDiagnostic_DocumentationComment_DocumentationModeIsEqualToNone() { await VerifyNoDiagnosticAsync(@" @@ -275,7 +275,7 @@ void M() ", options: Options.WithParseOptions(Options.ParseOptions.WithDocumentationMode(DocumentationMode.None))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task TestNoDiagnostic_DocumentationCommentAndTrailingComment_DocumentationModeIsEqualToNone() { await VerifyNoDiagnosticAsync(@" @@ -291,7 +291,7 @@ void M() // x ", options: Options.WithParseOptions(Options.ParseOptions.WithDocumentationMode(DocumentationMode.None))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task TestNoDiagnostic_LeadingTaskListItem() { await VerifyNoDiagnosticAsync(@" @@ -333,7 +333,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task TestNoDiagnostic_TrailingTaskListItem() { await VerifyNoDiagnosticAsync(@" @@ -347,7 +347,7 @@ void M1() //todo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task TestNoDiagnostic_LeadingTaskListItemWithNonTaskListItem() { await VerifyNoDiagnosticAsync(@" @@ -362,7 +362,7 @@ void M1() //x "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ConvertCommentToDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ConvertCommentToDocumentationComment)] public async Task TestNoDiagnostic_NamespaceDeclaration() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1182RemoveRedundantBaseInterfaceTests.cs b/src/Tests/Analyzers.Tests/RCS1182RemoveRedundantBaseInterfaceTests.cs index 70eff56b64..07e8f5918d 100644 --- a/src/Tests/Analyzers.Tests/RCS1182RemoveRedundantBaseInterfaceTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1182RemoveRedundantBaseInterfaceTests.cs @@ -12,7 +12,7 @@ public class RCS1182RemoveRedundantBaseInterfaceTests : AbstractCSharpDiagnostic { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantBaseInterface; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantBaseInterface)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantBaseInterface)] public async Task Test_IEnumerableOfT() { await VerifyNoDiagnosticAsync(@" @@ -24,7 +24,7 @@ class Foo1 : List, IEnumerable where T : class "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantBaseInterface)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantBaseInterface)] public async Task TestNoDiagnostic_ExplicitImplementation() { await VerifyNoDiagnosticAsync(@" @@ -40,7 +40,7 @@ IEnumerator IEnumerable.GetEnumerator() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantBaseInterface)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantBaseInterface)] public async Task TestNoDiagnostic_MethodImplementedWithNewKeyword() { await VerifyNoDiagnosticAsync(@" @@ -65,7 +65,7 @@ class C : B, IFoo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantBaseInterface)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantBaseInterface)] public async Task TestNoDiagnostic_PropertyImplementedWithNewKeyword() { await VerifyNoDiagnosticAsync(@" @@ -86,7 +86,7 @@ class C : B, IFoo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantBaseInterface)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantBaseInterface)] public async Task TestNoDiagnostic_IndexerImplementedWithNewKeyword() { await VerifyNoDiagnosticAsync(@" @@ -113,7 +113,7 @@ class C : B, IFoo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantBaseInterface)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantBaseInterface)] public async Task TestNoDiagnostic_EventFieldImplementedWithNewKeyword() { await VerifyNoDiagnosticAsync(@" @@ -136,7 +136,7 @@ class C : B, IFoo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantBaseInterface)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantBaseInterface)] public async Task TestNoDiagnostic_EventImplementedWithNewKeyword() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1186UseRegexInstanceInsteadOfStaticMethodTests.cs b/src/Tests/Analyzers.Tests/RCS1186UseRegexInstanceInsteadOfStaticMethodTests.cs index 74a1a49aef..33158deec7 100644 --- a/src/Tests/Analyzers.Tests/RCS1186UseRegexInstanceInsteadOfStaticMethodTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1186UseRegexInstanceInsteadOfStaticMethodTests.cs @@ -12,7 +12,7 @@ public class RCS1186UseRegexInstanceInsteadOfStaticMethodTests : AbstractCSharpD { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseRegexInstanceInsteadOfStaticMethod; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_IsMatch1() { await VerifyDiagnosticAndFixAsync(""" @@ -53,7 +53,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_IsMatch2() { await VerifyDiagnosticAndFixAsync(""" @@ -86,7 +86,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_IsMatch3() { await VerifyDiagnosticAndFixAsync(""" @@ -117,7 +117,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_IsMatch4() { await VerifyDiagnosticAndFixAsync(""" @@ -148,7 +148,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Match1() { await VerifyDiagnosticAndFixAsync(""" @@ -179,7 +179,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Match2() { await VerifyDiagnosticAndFixAsync(""" @@ -210,7 +210,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Matches1() { await VerifyDiagnosticAndFixAsync(""" @@ -241,7 +241,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Matches2() { await VerifyDiagnosticAndFixAsync(""" @@ -272,7 +272,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Split1() { await VerifyDiagnosticAndFixAsync(""" @@ -303,7 +303,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Split2() { await VerifyDiagnosticAndFixAsync(""" @@ -334,7 +334,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Replace1() { await VerifyDiagnosticAndFixAsync(""" @@ -369,7 +369,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Replace2() { await VerifyDiagnosticAndFixAsync(""" @@ -402,7 +402,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Replace3() { await VerifyDiagnosticAndFixAsync(""" @@ -435,7 +435,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Replace4() { await VerifyDiagnosticAndFixAsync(""" @@ -468,7 +468,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_LambdaExpression() { await VerifyDiagnosticAndFixAsync(""" @@ -501,7 +501,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(""" @@ -542,7 +542,7 @@ string P """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task TestNoDiagnostic_InstanceCall() { await VerifyNoDiagnosticAsync(""" @@ -571,7 +571,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task TestNoDiagnostic_PatternIsLocalConst() { await VerifyNoDiagnosticAsync(""" @@ -591,7 +591,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task TestNoDiagnostic_OptionsIsLocalConst() { await VerifyNoDiagnosticAsync(""" @@ -611,7 +611,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRegexInstanceInsteadOfStaticMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRegexInstanceInsteadOfStaticMethod)] public async Task TestNoDiagnostic_NonConstValue() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1187UseConstantInsteadOfFieldTests.cs b/src/Tests/Analyzers.Tests/RCS1187UseConstantInsteadOfFieldTests.cs index 71439070a6..a8ff9b3ec5 100644 --- a/src/Tests/Analyzers.Tests/RCS1187UseConstantInsteadOfFieldTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1187UseConstantInsteadOfFieldTests.cs @@ -12,7 +12,7 @@ public class RCS1187UseConstantInsteadOfFieldTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseConstantInsteadOfField; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConstantInsteadOfField)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConstantInsteadOfField)] public async Task TestNoDiagnostic_AssignmentInInStaticConstructor() { await VerifyNoDiagnosticAsync(@" @@ -28,7 +28,7 @@ static C() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConstantInsteadOfField)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConstantInsteadOfField)] public async Task TestNoDiagnostic_RefInStaticConstructor() { await VerifyNoDiagnosticAsync(@" @@ -48,7 +48,7 @@ static void M(ref int value) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConstantInsteadOfField)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConstantInsteadOfField)] public async Task TestNoDiagnostic_OutInStaticConstructor() { await VerifyNoDiagnosticAsync(@" @@ -69,7 +69,7 @@ static void M(out int value) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConstantInsteadOfField)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConstantInsteadOfField)] public async Task TestNoDiagnostic_InInStaticConstructor() { await VerifyNoDiagnosticAsync(@" @@ -89,7 +89,7 @@ static void M(in int value) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConstantInsteadOfField)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConstantInsteadOfField)] public async Task TestNoDiagnostic_SelfReference() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1188RemoveRedundantAutoPropertyInitializationTests.cs b/src/Tests/Analyzers.Tests/RCS1188RemoveRedundantAutoPropertyInitializationTests.cs index 0b4674fb4e..837f2508ce 100644 --- a/src/Tests/Analyzers.Tests/RCS1188RemoveRedundantAutoPropertyInitializationTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1188RemoveRedundantAutoPropertyInitializationTests.cs @@ -13,7 +13,7 @@ public class RCS1188RemoveRedundantAutoPropertyInitializationTests : AbstractCSh { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantAutoPropertyInitialization; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task Test_Bool() { await VerifyDiagnosticAndFixAsync(@" @@ -35,7 +35,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task Test_Bool_Nullable() { await VerifyDiagnosticAndFixAsync(@" @@ -59,7 +59,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task Test_Char() { await VerifyDiagnosticAndFixAsync(@" @@ -81,7 +81,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task Test_String() { await VerifyDiagnosticAndFixAsync(@" @@ -105,7 +105,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task Test_Numeric_Int() { await VerifyDiagnosticAndFixAsync(@" @@ -129,7 +129,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task Test_ULong() { await VerifyDiagnosticAndFixAsync(@" @@ -151,7 +151,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task Test_Numeric() { await VerifyDiagnosticAndFixAsync(@" @@ -183,7 +183,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantFieldInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantFieldInitialization)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -199,7 +199,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task TestNoDiagnostic_NoInitializer() { await VerifyNoDiagnosticAsync(@" @@ -210,7 +210,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAutoPropertyInitialization)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAutoPropertyInitialization)] public async Task TestNoDiagnostic_SuppressNullableWarningExpression() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1190JoinStringExpressionsTests.cs b/src/Tests/Analyzers.Tests/RCS1190JoinStringExpressionsTests.cs index 3e2441d650..68c4e0b229 100644 --- a/src/Tests/Analyzers.Tests/RCS1190JoinStringExpressionsTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1190JoinStringExpressionsTests.cs @@ -12,7 +12,7 @@ public class RCS1190JoinStringExpressionsTests : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.JoinStringExpressions; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_Literal_Regular() { await VerifyDiagnosticAndFixAsync(""" @@ -34,7 +34,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_Literal_Regular2() { await VerifyDiagnosticAndFixAsync(""" @@ -56,7 +56,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_Literal_Verbatim() { await VerifyDiagnosticAndFixAsync(""" @@ -78,7 +78,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_Literal_Verbatim2() { await VerifyDiagnosticAndFixAsync(""" @@ -100,7 +100,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_InterpolatedString_Regular() { await VerifyDiagnosticAndFixAsync(""" @@ -122,7 +122,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_InterpolatedString_Regular2() { await VerifyDiagnosticAndFixAsync(""" @@ -144,7 +144,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_InterpolatedString_Verbatim() { await VerifyDiagnosticAndFixAsync(""" @@ -166,7 +166,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_InterpolatedString_Verbatim2() { await VerifyDiagnosticAndFixAsync(""" @@ -188,7 +188,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_Verbatim_Multiline() { await VerifyDiagnosticAndFixAsync(""" @@ -214,7 +214,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task Test_InterpolatedString_Multiline() { await VerifyDiagnosticAndFixAsync(""" @@ -240,7 +240,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task TestNoDiagnostic_Regular_Multiline() { await VerifyNoDiagnosticAsync(""" @@ -255,7 +255,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task TestNoDiagnostic_Verbatim_Multiline() { await VerifyNoDiagnosticAsync(""" @@ -271,7 +271,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task TestNoDiagnostic_RegularAndVerbatim() { await VerifyNoDiagnosticAsync(""" @@ -286,7 +286,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task TestNoDiagnostic_LiteralAndInterpolated() { await VerifyNoDiagnosticAsync(""" @@ -301,7 +301,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task TestNoDiagnostic_LiteralAndInterpolated_Verbatim() { await VerifyNoDiagnosticAsync(""" @@ -316,7 +316,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task TestNoDiagnostic_AddExpressionIsNotStringConcatenation() { await VerifyNoDiagnosticAsync(""" @@ -332,7 +332,7 @@ void M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task TestNoDiagnostic_LiteralsMixedWithExpressions() { await VerifyNoDiagnosticAsync(""" @@ -346,7 +346,7 @@ void M(string s1, string s2, string s3) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.JoinStringExpressions)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.JoinStringExpressions)] public async Task TestNoDiagnostic_HexadecimalDigit() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1191DeclareEnumValueAsCombinationOfNamesTests.cs b/src/Tests/Analyzers.Tests/RCS1191DeclareEnumValueAsCombinationOfNamesTests.cs index de40bf686c..f139fa4a62 100644 --- a/src/Tests/Analyzers.Tests/RCS1191DeclareEnumValueAsCombinationOfNamesTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1191DeclareEnumValueAsCombinationOfNamesTests.cs @@ -12,7 +12,7 @@ public class RCS1191DeclareEnumValueAsCombinationOfNamesTests : AbstractCSharpDi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.DeclareEnumValueAsCombinationOfNames; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumValueAsCombinationOfNames)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -44,7 +44,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumValueAsCombinationOfNames)] public async Task Test2() { await VerifyDiagnosticAndFixAsync(@" @@ -76,7 +76,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumValueAsCombinationOfNames)] public async Task Test3() { await VerifyDiagnosticAndFixAsync(@" @@ -110,7 +110,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumValueAsCombinationOfNames)] public async Task Test4() { await VerifyDiagnosticAndFixAsync(@" @@ -140,7 +140,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumValueAsCombinationOfNames)] public async Task Test5() { await VerifyDiagnosticAndFixAsync(@" @@ -174,7 +174,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumValueAsCombinationOfNames)] public async Task Test6() { await VerifyDiagnosticAndFixAsync(@" @@ -210,7 +210,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DeclareEnumValueAsCombinationOfNames)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DeclareEnumValueAsCombinationOfNames)] public async Task Test_SByte() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1192UnnecessaryUsageOfVerbatimStringLiteralTests.cs b/src/Tests/Analyzers.Tests/RCS1192UnnecessaryUsageOfVerbatimStringLiteralTests.cs index 34f889ca5a..d4b2399019 100644 --- a/src/Tests/Analyzers.Tests/RCS1192UnnecessaryUsageOfVerbatimStringLiteralTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1192UnnecessaryUsageOfVerbatimStringLiteralTests.cs @@ -12,7 +12,7 @@ public class RCS1192UnnecessaryUsageOfVerbatimStringLiteralTests : AbstractCShar { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryUsageOfVerbatimStringLiteral; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)] public async Task Test_EmptyStringLiteral() { await VerifyDiagnosticAndFixAsync(""" @@ -34,7 +34,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)] public async Task Test_NonEmptyStringLiteral() { await VerifyDiagnosticAndFixAsync(""" @@ -56,7 +56,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)] public async Task Test_EmptyInterpolatedString() { await VerifyDiagnosticAndFixAsync(""" @@ -78,7 +78,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)] public async Task Test_EmptyInterpolatedString_AmpersandIsFirst() { await VerifyDiagnosticAndFixAsync(""" @@ -100,7 +100,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)] public async Task Test_NonEmptyInterpolatedString() { await VerifyDiagnosticAndFixAsync(""" @@ -122,7 +122,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)] public async Task TestNoDiagnostic_StringLiteral() { await VerifyNoDiagnosticAsync(""" @@ -141,7 +141,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)] public async Task TestNoDiagnostic_InterpolatedString() { await VerifyNoDiagnosticAsync(""" @@ -163,7 +163,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUsageOfVerbatimStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUsageOfVerbatimStringLiteral)] public async Task TestNoDiagnostic_InterpolatedString_FormatClauseContainsBackslash() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1193OverridingMemberShouldNotChangeParamsModifierTests.cs b/src/Tests/Analyzers.Tests/RCS1193OverridingMemberShouldNotChangeParamsModifierTests.cs index 53eba4e230..d62349e9e4 100644 --- a/src/Tests/Analyzers.Tests/RCS1193OverridingMemberShouldNotChangeParamsModifierTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1193OverridingMemberShouldNotChangeParamsModifierTests.cs @@ -12,7 +12,7 @@ public class RCS1193OverridingMemberShouldNotChangeParamsModifierTests : Abstrac { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.OverridingMemberShouldNotChangeParamsModifier; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OverridingMemberShouldNotChangeParamsModifier)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OverridingMemberShouldNotChangeParamsModifier)] public async Task Test_WithoutParams() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ public virtual void M(params object[] x) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OverridingMemberShouldNotChangeParamsModifier)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OverridingMemberShouldNotChangeParamsModifier)] public async Task Test_WithParams() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ public virtual void M(object[] x) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OverridingMemberShouldNotChangeParamsModifier)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OverridingMemberShouldNotChangeParamsModifier)] public async Task Test_WithoutParams_Indexer() { await VerifyDiagnosticAndFixAsync(@" @@ -106,7 +106,7 @@ class B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OverridingMemberShouldNotChangeParamsModifier)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OverridingMemberShouldNotChangeParamsModifier)] public async Task Test_WithParams_Indexer() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1194ImplementExceptionConstructorsTests.cs b/src/Tests/Analyzers.Tests/RCS1194ImplementExceptionConstructorsTests.cs index 61ad4a10a6..fcb4e224f6 100644 --- a/src/Tests/Analyzers.Tests/RCS1194ImplementExceptionConstructorsTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1194ImplementExceptionConstructorsTests.cs @@ -12,7 +12,7 @@ public class RCS1194ImplementExceptionConstructorsTests : AbstractCSharpDiagnost { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.ImplementExceptionConstructors; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ImplementExceptionConstructors)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ImplementExceptionConstructors)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1196CallExtensionMethodAsInstanceMethodTests.cs b/src/Tests/Analyzers.Tests/RCS1196CallExtensionMethodAsInstanceMethodTests.cs index 1200e701c8..6e19629791 100644 --- a/src/Tests/Analyzers.Tests/RCS1196CallExtensionMethodAsInstanceMethodTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1196CallExtensionMethodAsInstanceMethodTests.cs @@ -12,7 +12,7 @@ public class RCS1196CallExtensionMethodAsInstanceMethodTests : AbstractCSharpDia { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.CallExtensionMethodAsInstanceMethod; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallExtensionMethodAsInstanceMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.CallExtensionMethodAsInstanceMethod)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1197OptimizeStringBuilderAppendCallTests.cs b/src/Tests/Analyzers.Tests/RCS1197OptimizeStringBuilderAppendCallTests.cs index 83fbe119ce..1c03617d58 100644 --- a/src/Tests/Analyzers.Tests/RCS1197OptimizeStringBuilderAppendCallTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1197OptimizeStringBuilderAppendCallTests.cs @@ -12,7 +12,7 @@ public class RCS1197OptimizeStringBuilderAppendCallTests : AbstractCSharpDiagnos { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.OptimizeStringBuilderAppendCall; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_Substring_Int32_Int32() { await VerifyDiagnosticAndFixAsync(@" @@ -44,7 +44,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_Substring_Int32_Int32_Calculation() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_Substring_Int32() { await VerifyDiagnosticAndFixAsync(@" @@ -112,7 +112,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_Substring_Int32_Int32_AppendLine() { await VerifyDiagnosticAndFixAsync(@" @@ -144,7 +144,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_Substring_Int32_AppendLine() { await VerifyDiagnosticAndFixAsync(@" @@ -176,7 +176,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_Remove() { await VerifyDiagnosticAndFixAsync(@" @@ -208,7 +208,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_Remove_AppendLine() { await VerifyDiagnosticAndFixAsync(@" @@ -240,7 +240,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_StringFormat() { await VerifyDiagnosticAndFixAsync(""" @@ -272,7 +272,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_StringFormat_AppendLine() { await VerifyDiagnosticAndFixAsync(""" @@ -304,7 +304,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedString() { await VerifyNoDiagnosticAsync(""" @@ -323,7 +323,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedString_Braces() { await VerifyNoDiagnosticAsync(""" @@ -343,7 +343,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedRawString_ContainingQuotes() { await VerifyNoDiagnosticAsync(""""" @@ -360,7 +360,7 @@ void M() """"", options: WellKnownCSharpTestOptions.Default_CSharp11); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedMultilineRawString_ContainingQuotes() { await VerifyNoDiagnosticAsync("""" @@ -380,7 +380,7 @@ void M() """", options: WellKnownCSharpTestOptions.Default_CSharp11); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedString_Char() { await VerifyNoDiagnosticAsync(""" @@ -399,7 +399,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedString_AppendLine() { await VerifyNoDiagnosticAsync(""" @@ -418,7 +418,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedString_AppendLine2() { await VerifyNoDiagnosticAsync(""" @@ -436,7 +436,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedString_AppendLine3() { await VerifyNoDiagnosticAsync(""" @@ -454,7 +454,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedString_WithFormat_AppendLine() { await VerifyNoDiagnosticAsync(""" @@ -473,7 +473,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_InterpolatedString_WithFormat_AppendLine2() { await VerifyNoDiagnosticAsync(""" @@ -492,7 +492,7 @@ void M(DateTime x) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_Concatenation() { await VerifyNoDiagnosticAsync(""" @@ -511,7 +511,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_Concatenation_Char() { await VerifyNoDiagnosticAsync(""" @@ -531,7 +531,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_Concatenation_AppendLine() { await VerifyNoDiagnosticAsync(""" @@ -550,7 +550,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_Concatenation_AppendLine2() { await VerifyNoDiagnosticAsync(""" @@ -569,7 +569,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_Concatenation_AppendLine3() { await VerifyNoDiagnosticAsync(""" @@ -588,7 +588,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_Concatenation_AppendLine4() { await VerifyNoDiagnosticAsync(""" @@ -607,7 +607,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_Concatenation_AppendLine5() { await VerifyNoDiagnosticAsync(""" @@ -626,7 +626,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_AppendLine() { await VerifyDiagnosticAndFixAsync(""" @@ -656,7 +656,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_AppendLine2() { await VerifyDiagnosticAndFixAsync(@" @@ -688,7 +688,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task Test_Join() { await VerifyDiagnosticAndFixAsync(""" @@ -728,7 +728,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_Const() { await VerifyNoDiagnosticAsync(""" @@ -748,7 +748,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -780,7 +780,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_ConstantInterpolatedString() { await VerifyNoDiagnosticAsync(""" @@ -797,7 +797,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OptimizeStringBuilderAppendCall)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OptimizeStringBuilderAppendCall)] public async Task TestNoDiagnostic_NoAppendMethodChain() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1198AvoidBoxingOfValueTypeTests.cs b/src/Tests/Analyzers.Tests/RCS1198AvoidBoxingOfValueTypeTests.cs index 4a620950a8..50123d381f 100644 --- a/src/Tests/Analyzers.Tests/RCS1198AvoidBoxingOfValueTypeTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1198AvoidBoxingOfValueTypeTests.cs @@ -13,7 +13,7 @@ public class RCS1198AvoidBoxingOfValueTypeTests : AbstractCSharpDiagnosticVerifi public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AvoidBoxingOfValueType; // https://github.com/dotnet/roslyn/pull/35006 - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidBoxingOfValueType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidBoxingOfValueType)] public async Task TestNoDiagnostic_StringConcatenation() { await VerifyNoDiagnosticAsync(""" @@ -29,7 +29,7 @@ void M() } // https://github.com/dotnet/roslyn/pull/35006 - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidBoxingOfValueType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidBoxingOfValueType)] public async Task TestNoDiagnostic_InterpolatedString() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1198AvoidBoxingOfValueTypeTests2.cs b/src/Tests/Analyzers.Tests/RCS1198AvoidBoxingOfValueTypeTests2.cs index 3837829476..2e9ea315dc 100644 --- a/src/Tests/Analyzers.Tests/RCS1198AvoidBoxingOfValueTypeTests2.cs +++ b/src/Tests/Analyzers.Tests/RCS1198AvoidBoxingOfValueTypeTests2.cs @@ -12,7 +12,7 @@ public class RCS1198AvoidBoxingOfValueTypeTests2 : AbstractCSharpDiagnosticVerif { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AvoidBoxingOfValueType; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidBoxingOfValueType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidBoxingOfValueType)] public async Task Test_StringBuilder_Append() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidBoxingOfValueType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidBoxingOfValueType)] public async Task Test_StringBuilder_Insert() { await VerifyDiagnosticAndFixAsync(@" @@ -81,7 +81,7 @@ void M() } // https://github.com/dotnet/roslyn/pull/35006 - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidBoxingOfValueType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidBoxingOfValueType)] public async Task TestNoDiagnostic_AppendFormat() { await VerifyNoDiagnosticAsync(""" @@ -103,7 +103,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidBoxingOfValueType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidBoxingOfValueType)] public async Task TestNoDiagnostic_NoTypeSymbol() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1199UnnecessaryNullCheckTests.cs b/src/Tests/Analyzers.Tests/RCS1199UnnecessaryNullCheckTests.cs index 27c6ca041d..1b71960cbc 100644 --- a/src/Tests/Analyzers.Tests/RCS1199UnnecessaryNullCheckTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1199UnnecessaryNullCheckTests.cs @@ -12,7 +12,7 @@ public class RCS1199UnnecessaryNullCheckTests : AbstractCSharpDiagnosticVerifier { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryNullCheck; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_HasValue_Bool() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_HasValue_Bool_EqualsTrue() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_HasValue_Bool_Parentheses() { await VerifyDiagnosticAndFixAsync(@" @@ -90,7 +90,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_HasValue_Bool_False() { await VerifyDiagnosticAndFixAsync(@" @@ -116,7 +116,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_HasValue_Bool_EqualsFalse() { await VerifyDiagnosticAndFixAsync(@" @@ -142,7 +142,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_HasValue_ValueEquals() { await VerifyDiagnosticAndFixAsync(@" @@ -174,7 +174,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_NotEqualsToNull_ValueEquals() { await VerifyDiagnosticAndFixAsync(@" @@ -206,7 +206,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_NotEqualsToNull_ValueLessThan() { await VerifyDiagnosticAndFixAsync(@" @@ -238,7 +238,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_NotEqualsToNull_ValueLessThanOrEquals() { await VerifyDiagnosticAndFixAsync(@" @@ -270,7 +270,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_NotEqualsToNull_ValueGreaterThan() { await VerifyDiagnosticAndFixAsync(@" @@ -302,7 +302,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task Test_NotEqualsToNull_ValueGreaterThanOrEquals() { await VerifyDiagnosticAndFixAsync(@" @@ -334,7 +334,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -367,7 +367,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task TestNoDiagnostic2() { await VerifyNoDiagnosticAsync(@" @@ -394,7 +394,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task TestNoDiagnostic_RightSideIsNullable() { await VerifyNoDiagnosticAsync(@" @@ -421,7 +421,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryNullCheck)] public async Task TestNoDiagnostic_RightSideIsNullOrDefault() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1201UseMethodChainingTests.cs b/src/Tests/Analyzers.Tests/RCS1201UseMethodChainingTests.cs index 0beb9851b4..ff4454e4e0 100644 --- a/src/Tests/Analyzers.Tests/RCS1201UseMethodChainingTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1201UseMethodChainingTests.cs @@ -12,7 +12,7 @@ public class RCS1201UseMethodChainingTests : AbstractCSharpDiagnosticVerifier "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidNullReferenceException)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidNullReferenceException)] public async Task TestNoDiagnostic_ExtensionMethod() { await VerifyNoDiagnosticAsync(@" @@ -130,7 +130,7 @@ static class E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidNullReferenceException)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidNullReferenceException)] public async Task TestNoDiagnostic_ThisCastedToItsInterface() { await VerifyNoDiagnosticAsync(@" @@ -149,7 +149,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidNullReferenceException)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidNullReferenceException)] public async Task TestNoDiagnostic_ExpressionIsDefinitelyNotNull() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1203UseAttributeUsageAttributeTests.cs b/src/Tests/Analyzers.Tests/RCS1203UseAttributeUsageAttributeTests.cs index 5d5f180768..9c41dafb76 100644 --- a/src/Tests/Analyzers.Tests/RCS1203UseAttributeUsageAttributeTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1203UseAttributeUsageAttributeTests.cs @@ -12,7 +12,7 @@ public class RCS1203UseAttributeUsageAttributeTests : AbstractCSharpDiagnosticVe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseAttributeUsageAttribute; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAttributeUsageAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAttributeUsageAttribute)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -31,7 +31,7 @@ class FooAttribute : Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAttributeUsageAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAttributeUsageAttribute)] public async Task TestNoDiagnostic_AttributeUsageAttributeAlreadyExistsOrIsInherited() { await VerifyNoDiagnosticAsync(@" @@ -48,7 +48,7 @@ class BarAttribute : FooAttribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAttributeUsageAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAttributeUsageAttribute)] public async Task TestNoDiagnostic_DoesNotInheritFromAttribute() { await VerifyNoDiagnosticAsync(@" @@ -58,7 +58,7 @@ class FooAttribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAttributeUsageAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAttributeUsageAttribute)] public async Task TestNoDiagnostic_NameDoesNotEndWithAttribute() { await VerifyNoDiagnosticAsync(@" @@ -70,7 +70,7 @@ class Foo : Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAttributeUsageAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAttributeUsageAttribute)] public async Task TestNoDiagnostic_AbstractAttribute() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1204UseEventArgsEmptyTests.cs b/src/Tests/Analyzers.Tests/RCS1204UseEventArgsEmptyTests.cs index 6d30ee9a4a..74790338f6 100644 --- a/src/Tests/Analyzers.Tests/RCS1204UseEventArgsEmptyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1204UseEventArgsEmptyTests.cs @@ -12,7 +12,7 @@ public class RCS1204UseEventArgsEmptyTests : AbstractCSharpDiagnosticVerifier> p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseConditionalAccessInsteadOfConditionalExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseConditionalAccessInsteadOfConditionalExpression)] public async Task TestNoDiagnostic_ReadOnlyRefStruct() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1207ConvertAnonymousFunctionToMethodGroupTests.cs b/src/Tests/Analyzers.Tests/RCS1207ConvertAnonymousFunctionToMethodGroupTests.cs index 071582d9cd..e74ddf6414 100644 --- a/src/Tests/Analyzers.Tests/RCS1207ConvertAnonymousFunctionToMethodGroupTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1207ConvertAnonymousFunctionToMethodGroupTests.cs @@ -17,7 +17,7 @@ public override CSharpTestOptions Options get { return base.Options.AddConfigOption(ConfigOptionKeys.UseAnonymousFunctionOrMethodGroup, ConfigOptionValues.UseAnonymousFunctionOrMethodGroup_MethodGroup); } } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] [InlineData("f => M(f)", "M")] [InlineData("f => { M(f); }", "M")] [InlineData("(f) => M(f)", "M")] @@ -48,7 +48,7 @@ static void M(this string value) { } ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] [InlineData("f => M(f)", "M")] [InlineData("f => { return M(f); }", "M")] [InlineData("delegate (string f) { return M(f); }", "M")] @@ -76,7 +76,7 @@ static void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] [InlineData("(f, i) => M(f, i)", "M")] [InlineData("(f, i) => { return M(f, i); }", "M")] [InlineData("delegate (string f, int i) { return M(f, i); }", "M")] @@ -104,7 +104,7 @@ static void M() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] [InlineData("f => M(f)", "M")] [InlineData("f => { return M(f); }", "M")] [InlineData("delegate (string f) { return M(f); }", "M")] @@ -128,7 +128,7 @@ static void M2() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] [InlineData("(f, i) => M(f, i)", "M")] [InlineData("(f, i) => { return M(f, i); }", "M")] [InlineData("delegate (string f, int i) { return M(f, i); }", "M")] @@ -152,7 +152,7 @@ static void M2() ", source, expected); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] [InlineData("() => Foo.M()", "Foo.M")] [InlineData("delegate () { return Foo.M(); }", "Foo.M")] public async Task Test_StaticMethod_Assignment(string source, string expected) @@ -176,7 +176,7 @@ static void M2() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_SwitchExpressionArm() { await VerifyDiagnosticAndFixAsync(""" @@ -220,7 +220,7 @@ string M2(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task TestNoDiagnostic_NullReferenceException() { await VerifyNoDiagnosticAsync(@" @@ -244,7 +244,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task TestNoDiagnostic_FuncToAction() { await VerifyNoDiagnosticAsync(@" @@ -260,7 +260,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task TestNoDiagnostic_FuncToAction2() { await VerifyNoDiagnosticAsync(@" @@ -278,7 +278,7 @@ private void M(Action action) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task TestNoDiagnostic_ReportsDiagnosticBeforeCSharp73() { await VerifyNoDiagnosticAsync(@" @@ -300,7 +300,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseAnonymousFunctionOrMethodGroup, ConfigOptionValues.UseAnonymousFunctionOrMethodGroup_MethodGroup)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task TestNoDiagnostic_ReducedExtensionFromOtherClassInvokedOnLambdaParameter() { await VerifyNoDiagnosticAsync(@" @@ -320,7 +320,7 @@ void M(Func, string> func) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task TestNoDiagnostic_ConditionalAccess() { await VerifyNoDiagnosticAsync(@" @@ -346,7 +346,7 @@ private static void M(IEnumerable items, Func func) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task TestNoDiagnostic_InParameter() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1207ConvertMethodGroupToAnonymousFunctionTests.cs b/src/Tests/Analyzers.Tests/RCS1207ConvertMethodGroupToAnonymousFunctionTests.cs index 3cca0d6b6c..c8d52a72cc 100644 --- a/src/Tests/Analyzers.Tests/RCS1207ConvertMethodGroupToAnonymousFunctionTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1207ConvertMethodGroupToAnonymousFunctionTests.cs @@ -17,7 +17,7 @@ public override CSharpTestOptions Options get { return base.Options.AddConfigOption(ConfigOptionKeys.UseAnonymousFunctionOrMethodGroup, ConfigOptionValues.UseAnonymousFunctionOrMethodGroup_AnonymousFunction); } } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_Argument() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_Argument_OneParameter() { await VerifyDiagnosticAndFixAsync(@" @@ -77,7 +77,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_Argument_TwoParameters() { await VerifyDiagnosticAndFixAsync(@" @@ -107,7 +107,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_Argument_TwoParameters2() { await VerifyDiagnosticAndFixAsync(@" @@ -143,7 +143,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_Argument_WithClassName() { await VerifyDiagnosticAndFixAsync(@" @@ -173,7 +173,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_Argument_WithNamespaceName() { await VerifyDiagnosticAndFixAsync(@" @@ -209,7 +209,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_Argument_WithGlobalName() { await VerifyDiagnosticAndFixAsync(@" @@ -245,7 +245,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_LocalDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -275,7 +275,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_Assignment() { await VerifyDiagnosticAndFixAsync(@" @@ -315,7 +315,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_ObjectInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -349,7 +349,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_PropertyInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -373,7 +373,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_FieldInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -397,7 +397,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_ReturnStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -427,7 +427,7 @@ Func M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_ArrowExpressionClause() { await VerifyDiagnosticAndFixAsync(@" @@ -451,7 +451,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_ArrayInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -481,7 +481,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_CollectionInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -513,7 +513,7 @@ void M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_YieldReturnStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -545,7 +545,7 @@ IEnumerable> M2(Func p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task Test_SwitchExpressionArm() { await VerifyDiagnosticAndFixAsync(""" @@ -581,7 +581,7 @@ Func M(Func p) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAnonymousFunctionOrMethodGroup)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAnonymousFunctionOrMethodGroup)] public async Task TestNoDiagnostic_AnalyzerOptionDisabled() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1208ReduceIfNestingTests.cs b/src/Tests/Analyzers.Tests/RCS1208ReduceIfNestingTests.cs index ef0f749ead..8cfd66ebb2 100644 --- a/src/Tests/Analyzers.Tests/RCS1208ReduceIfNestingTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1208ReduceIfNestingTests.cs @@ -12,7 +12,7 @@ public class RCS1208ReduceIfNestingTests : AbstractCSharpDiagnosticVerifier GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ReturnCompletedTaskInsteadOfNull)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ReturnCompletedTaskInsteadOfNull)] public async Task Test_Task_Body() { await VerifyDiagnosticAndFixAsync(@" @@ -65,7 +65,7 @@ Task GetAsync() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ReturnCompletedTaskInsteadOfNull)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ReturnCompletedTaskInsteadOfNull)] public async Task Test_TaskOfT_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1210ReturnCompletedTaskInsteadOfNullTests2.cs b/src/Tests/Analyzers.Tests/RCS1210ReturnCompletedTaskInsteadOfNullTests2.cs index 4259349f7c..b68522826b 100644 --- a/src/Tests/Analyzers.Tests/RCS1210ReturnCompletedTaskInsteadOfNullTests2.cs +++ b/src/Tests/Analyzers.Tests/RCS1210ReturnCompletedTaskInsteadOfNullTests2.cs @@ -13,7 +13,7 @@ public class RCS1210ReturnCompletedTaskInsteadOfNullTests2 : AbstractCSharpDiagn { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.ReturnCompletedTaskInsteadOfNull; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ReturnCompletedTaskInsteadOfNull)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ReturnCompletedTaskInsteadOfNull)] public async Task Test_TaskOfT_ConditionalAccess() { await VerifyDiagnosticAndFixAsync(@" @@ -51,7 +51,7 @@ Task GetAsync(C c) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ReturnCompletedTaskInsteadOfNull)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ReturnCompletedTaskInsteadOfNull)] public async Task Test_Task_ConditionalAccess() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1211RemoveUnnecessaryElseTests.cs b/src/Tests/Analyzers.Tests/RCS1211RemoveUnnecessaryElseTests.cs index 4f27173d03..d1451ff94c 100644 --- a/src/Tests/Analyzers.Tests/RCS1211RemoveUnnecessaryElseTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1211RemoveUnnecessaryElseTests.cs @@ -12,7 +12,7 @@ public class RCS1211RemoveUnnecessaryElseTests : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveUnnecessaryElse; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryElse)] public async Task Test_UnnecessaryElse_Removed() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ int M(bool flag) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryElse)] public async Task TestNoDiagnostic_PreprocessorDirectives() { await VerifyNoDiagnosticAsync(@" @@ -70,7 +70,7 @@ int M(bool flag) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryElse)] public async Task TestNoDiagnostic_OverlappingLocalVariables() { await VerifyNoDiagnosticAsync(@" @@ -93,7 +93,7 @@ int M(bool flag) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryElse)] public async Task TestNoDiagnostic_OverlappingLocalVariablesWithSwitch() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1212RemoveRedundantAssignmentTests.cs b/src/Tests/Analyzers.Tests/RCS1212RemoveRedundantAssignmentTests.cs index 4fd92f8038..d98de8aecb 100644 --- a/src/Tests/Analyzers.Tests/RCS1212RemoveRedundantAssignmentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1212RemoveRedundantAssignmentTests.cs @@ -12,7 +12,7 @@ public class RCS1212RemoveRedundantAssignmentTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantAssignment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task Test_Local() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ bool M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task Test_Parameter() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ bool M(bool f) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task Test_Local_WithComment() { await VerifyDiagnosticAndFixAsync(""" @@ -100,7 +100,7 @@ void M2() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task Test_Local_ReferencedInRightSideOfAssignment() { await VerifyDiagnosticAndFixAsync(""" @@ -125,7 +125,7 @@ string M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task Test_LocalDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -148,7 +148,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task Test_LocalInsideLambda() { await VerifyDiagnosticAndFixAsync(@" @@ -191,7 +191,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task Test_ParameterInsideLambda() { await VerifyDiagnosticAndFixAsync(@" @@ -228,7 +228,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task TestNoDiagnostic_OutParameter() { await VerifyNoDiagnosticAsync(@" @@ -243,7 +243,7 @@ bool M(out bool f) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task TestNoDiagnostic_SequenceOfAssignments() { await VerifyNoDiagnosticAsync(@" @@ -260,7 +260,7 @@ int M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task TestNoDiagnostic_LocalReferencedInLambda() { await VerifyNoDiagnosticAsync(@" @@ -293,7 +293,7 @@ void M(int p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task TestNoDiagnostic_LocalAssignedInsideLambda() { await VerifyNoDiagnosticAsync(@" @@ -317,7 +317,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task TestNoDiagnostic_ParameterAssignedInsideLambda() { await VerifyNoDiagnosticAsync(@" @@ -339,7 +339,7 @@ void M(int x) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task TestNoDiagnostic_FinallyClause() { await VerifyNoDiagnosticAsync(@" @@ -370,7 +370,7 @@ Process M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantAssignment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantAssignment)] public async Task TestNoDiagnostic_CatchClause() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1213RemoveUnusedMemberDeclarationTests.cs b/src/Tests/Analyzers.Tests/RCS1213RemoveUnusedMemberDeclarationTests.cs index e5d94a74a7..497a792d50 100644 --- a/src/Tests/Analyzers.Tests/RCS1213RemoveUnusedMemberDeclarationTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1213RemoveUnusedMemberDeclarationTests.cs @@ -13,7 +13,7 @@ public class RCS1213RemoveUnusedMemberDeclarationTests : AbstractCSharpDiagnosti { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveUnusedMemberDeclaration; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task Test_Method() { await VerifyDiagnosticAndFixAsync(@" @@ -28,7 +28,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -43,7 +43,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task Test_Method_Recursive() { await VerifyDiagnosticAndFixAsync(@" @@ -61,7 +61,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task Test_Method_IfElsePreprocessorDirectives() { await VerifyDiagnosticAndFixAsync(@" @@ -81,7 +81,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task Test_Method_PragmaPreprocessorDirectives() { await VerifyDiagnosticAndFixAsync(@" @@ -102,7 +102,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task Test_Method_RegionPreprocessorDirectives() { await VerifyDiagnosticAndFixAsync(@" @@ -124,7 +124,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_Property_AttributeArgument_NameOf() { await VerifyNoDiagnosticAsync(@" @@ -147,7 +147,7 @@ public FooAttribute(string s) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_Method_AttributeArgument_NameOf() { await VerifyNoDiagnosticAsync(@" @@ -170,7 +170,7 @@ public FooAttribute(string s) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_Method_Argument_NameOf() { await VerifyNoDiagnosticAsync(@" @@ -183,7 +183,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_Indexer_Argument_NameOf() { await VerifyNoDiagnosticAsync(@" @@ -196,7 +196,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_ExtensionMethod() { await VerifyNoDiagnosticAsync(@" @@ -215,7 +215,7 @@ private static bool M2(this string s) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_DelegateAsReturnType() { await VerifyNoDiagnosticAsync(@" @@ -233,7 +233,7 @@ private D M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_UnbalancedPreprocessorDirectives() { await VerifyNoDiagnosticAsync(@" @@ -251,7 +251,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_LateBound() { await VerifyNoDiagnosticAsync(@" @@ -273,7 +273,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_StructLayoutAttribute() { await VerifyNoDiagnosticAsync(@" @@ -287,7 +287,7 @@ struct S "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_DelegateAsTypeArgument() { await VerifyNoDiagnosticAsync(@" @@ -305,7 +305,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_OverloadResolutionFailure() { await VerifyNoDiagnosticAsync(@" @@ -327,7 +327,7 @@ void CustomTimer_Tick(object _, EventArgs __) ", options: Options.AddAllowedCompilerDiagnosticId("CS0246")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_Stackalloc() { await VerifyNoDiagnosticAsync(@" @@ -345,7 +345,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_UnityScriptMethods() { await VerifyNoDiagnosticAsync(@" @@ -367,7 +367,7 @@ class MonoBehaviour ", options: Options.AddConfigOption(ConfigOptionKeys.SuppressUnityScriptMethods, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_UnityScriptMethods2() { await VerifyNoDiagnosticAsync(@" @@ -389,7 +389,7 @@ class MonoBehaviour ", options: Options.AddConfigOption(ConfigOptionKeys.UnityCodeAnalysisEnabled, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_UnityScriptMethods_Start() { await VerifyNoDiagnosticAsync(@" @@ -413,7 +413,7 @@ class MonoBehaviour ", options: Options.AddConfigOption(ConfigOptionKeys.UnityCodeAnalysisEnabled, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_PrimaryConstructor() { await VerifyNoDiagnosticAsync(""" @@ -433,7 +433,7 @@ public MyAttribute(string s) """, options: Options.AddAllowedCompilerDiagnosticId("CS9113")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnusedMemberDeclaration)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnusedMemberDeclaration)] public async Task TestNoDiagnostic_BaseList() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1214UnnecessaryInterpolatedStringTests.cs b/src/Tests/Analyzers.Tests/RCS1214UnnecessaryInterpolatedStringTests.cs index 64f6cc9d90..28c088bca2 100644 --- a/src/Tests/Analyzers.Tests/RCS1214UnnecessaryInterpolatedStringTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1214UnnecessaryInterpolatedStringTests.cs @@ -12,7 +12,7 @@ public class RCS1214UnnecessaryInterpolatedStringTests : AbstractCSharpDiagnosti { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryInterpolatedString; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task Test_StringLiteral() { await VerifyDiagnosticAndFixAsync(""" @@ -34,7 +34,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task Test_InterpolatedString() { await VerifyDiagnosticAndFixAsync(""" @@ -58,7 +58,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task Test_NonNullStringConstant() { await VerifyDiagnosticAndFixAsync(""" @@ -82,7 +82,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task Test_NoInterpolation() { await VerifyDiagnosticAndFixAsync(""" @@ -104,7 +104,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task Test_NoInterpolation2() { await VerifyDiagnosticAndFixAsync(""" @@ -126,7 +126,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task Test_NoInterpolation3() { await VerifyDiagnosticAndFixAsync(""" @@ -148,7 +148,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(""" @@ -163,7 +163,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task TestNoDiagnostic_FormattableString() { await VerifyNoDiagnosticAsync(""" @@ -176,7 +176,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task TestNoDiagnostic_FormattableString2() { await VerifyNoDiagnosticAsync(""" @@ -189,7 +189,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task TestNoDiagnostic_FormattableString3() { await VerifyNoDiagnosticAsync(""" @@ -207,7 +207,7 @@ string Call(FormattableString s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryInterpolatedString)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryInterpolatedString)] public async Task TestNoDiagnostic_TryWriteInterpolatedStringHandler() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1215ExpressionIsAlwaysEqualToTrueOrFalseTests.cs b/src/Tests/Analyzers.Tests/RCS1215ExpressionIsAlwaysEqualToTrueOrFalseTests.cs index 47dfd4a029..1fa826057f 100644 --- a/src/Tests/Analyzers.Tests/RCS1215ExpressionIsAlwaysEqualToTrueOrFalseTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1215ExpressionIsAlwaysEqualToTrueOrFalseTests.cs @@ -12,7 +12,7 @@ public class RCS1215ExpressionIsAlwaysEqualToTrueOrFalseTests : AbstractCSharpDi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.ExpressionIsAlwaysEqualToTrueOrFalse; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse)] public async Task Test_True() { await VerifyDiagnosticAndFixAsync(@" @@ -90,7 +90,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse)] public async Task Test_False() { await VerifyDiagnosticAndFixAsync(@" @@ -168,7 +168,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse)] public async Task Test_NullCheck() { await VerifyDiagnosticAndFixAsync(""" @@ -198,7 +198,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse)] public async Task Test_EqualsToDoubleNaN() { await VerifyDiagnosticAndFixAsync(@" @@ -222,7 +222,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse)] public async Task Test_EqualsToDoubleNaN_Right() { await VerifyDiagnosticAndFixAsync(@" @@ -246,7 +246,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse)] public async Task Test_NotEqualsToDoubleNaN() { await VerifyDiagnosticAndFixAsync(@" @@ -270,7 +270,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ExpressionIsAlwaysEqualToTrueOrFalse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ExpressionIsAlwaysEqualToTrueOrFalse)] public async Task TestNoDiagnostic_ReversedForStatement() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1216UnnecessaryUnsafeContextTests.cs b/src/Tests/Analyzers.Tests/RCS1216UnnecessaryUnsafeContextTests.cs index 1103f5ddc8..0b3a0e8df5 100644 --- a/src/Tests/Analyzers.Tests/RCS1216UnnecessaryUnsafeContextTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1216UnnecessaryUnsafeContextTests.cs @@ -12,8 +12,8 @@ public class RCS1216UnnecessaryUnsafeContextTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryUnsafeContext; - [Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Class() { await VerifyDiagnosticAndFixAsync(@" @@ -40,7 +40,7 @@ void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Interface() { await VerifyDiagnosticAndFixAsync(@" @@ -67,7 +67,7 @@ void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Record() { await VerifyDiagnosticAndFixAsync(@" @@ -94,7 +94,7 @@ void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Struct() { await VerifyDiagnosticAndFixAsync(@" @@ -121,7 +121,7 @@ void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_RecordStruct() { await VerifyDiagnosticAndFixAsync(@" @@ -148,7 +148,7 @@ void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Method() { await VerifyDiagnosticAndFixAsync(@" @@ -175,7 +175,7 @@ unsafe void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Constructor() { await VerifyDiagnosticAndFixAsync(@" @@ -202,7 +202,7 @@ unsafe C() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_StaticMember() { await VerifyDiagnosticAndFixAsync(@" @@ -229,7 +229,7 @@ unsafe static void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_UnsafeLocalFunction() { await VerifyDiagnosticAndFixAsync(@" @@ -263,7 +263,7 @@ void M2() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_UnsafeBlock() { await VerifyDiagnosticAndFixAsync(@" @@ -296,7 +296,7 @@ void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(""" @@ -331,7 +331,7 @@ unsafe string X """, options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Operator() { await VerifyDiagnosticAndFixAsync(@" @@ -360,7 +360,7 @@ class C ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Indexer() { await VerifyDiagnosticAndFixAsync(""" @@ -395,7 +395,7 @@ unsafe string this[int i] """, options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_Local() { await VerifyDiagnosticAndFixAsync(@" @@ -428,7 +428,7 @@ unsafe void Local() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryUnsafeContext)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryUnsafeContext)] public async Task Test_NoDiagnostic_UnwrappedUnsafeBlock() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1218SimplifyCodeBranchingTests.cs b/src/Tests/Analyzers.Tests/RCS1218SimplifyCodeBranchingTests.cs index 5527c7085d..9d32811bfe 100644 --- a/src/Tests/Analyzers.Tests/RCS1218SimplifyCodeBranchingTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1218SimplifyCodeBranchingTests.cs @@ -12,7 +12,7 @@ public class RCS1218SimplifyCodeBranchingTests : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyCodeBranching; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_EmptyIf_Else_WithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -43,7 +43,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_EmptyIf_Else_WithoutBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_EmptyIf_ElseIf_WithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -101,7 +101,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_EmptyIf_ElseIf_WithoutBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_SingleStatement_WithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -163,7 +163,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_SingleStatement_WithoutBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -194,7 +194,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_SingleStatement_WithMultipleStatements() { await VerifyDiagnosticAndFixAsync(@" @@ -231,7 +231,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_WithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -274,7 +274,7 @@ void M2() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_EmptyIf_WithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -311,7 +311,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_ElseContainsBreak_WithoutBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -350,7 +350,7 @@ void M2() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_ElseContainsBreak_WithMultipleStatements() { await VerifyDiagnosticAndFixAsync(@" @@ -395,7 +395,7 @@ void M2() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_IfContainsBreak_WithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -438,7 +438,7 @@ void M2() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_EmptyElse_WithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -475,7 +475,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_IfContainsBreak_WithoutBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -514,7 +514,7 @@ void M2() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_IfContainsBreak_WithMultipleStatements() { await VerifyDiagnosticAndFixAsync(@" @@ -559,7 +559,7 @@ void M2() { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_Embedded() { await VerifyDiagnosticAndFixAsync(@" @@ -592,7 +592,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_IfElse_Embedded_MultipleStatements() { await VerifyDiagnosticAndFixAsync(@" @@ -627,7 +627,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_SimpleIf_WithBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -665,7 +665,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_SimpleIf_WithoutBraces() { await VerifyDiagnosticAndFixAsync(@" @@ -697,7 +697,7 @@ void M(bool f1 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_SimpleIf_WithBraces_FirstStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -729,7 +729,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_While_SimpleIf_WithoutBraces_FirstStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -759,7 +759,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_Do_SimpleIf_WithBraces_LastStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -798,7 +798,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_Do_SimpleIf_WithoutBraces_LastStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -831,7 +831,7 @@ void M(bool f1 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_Do_SimpleIf_WithBraces_FirstStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -864,7 +864,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_Do_SimpleIf_WithoutBraces_FirstStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -895,7 +895,7 @@ void M(bool f1 = false, bool f2 = false) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_If_ContainingOnlyDo() { await VerifyDiagnosticAndFixAsync(@" @@ -931,7 +931,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_LastIfElseWithReturn_Method() { await VerifyDiagnosticAndFixAsync(@" @@ -971,7 +971,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_LastIfElseWithReturn_LocalFunction() { await VerifyDiagnosticAndFixAsync(@" @@ -1021,7 +1021,7 @@ void LF() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_LastIfElseWithContinue_ForEach() { await VerifyDiagnosticAndFixAsync(@" @@ -1075,7 +1075,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_LastIfElseWithContinue_For() { await VerifyDiagnosticAndFixAsync(@" @@ -1129,7 +1129,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task Test_LastIfElseWithContinue_While() { await VerifyDiagnosticAndFixAsync(@" @@ -1183,7 +1183,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -1254,7 +1254,7 @@ void M(bool f1 = false, bool f2 = false) ", options: Options.AddAllowedCompilerDiagnosticId("CS1525")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_While() { await VerifyNoDiagnosticAsync(@" @@ -1368,7 +1368,7 @@ void M(bool f1 = false, bool f2 = false) ", options: Options.AddAllowedCompilerDiagnosticId("CS1525")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_While_ConditionContainsLocalDefinedInLoopBody_LocalDeclaration() { await VerifyNoDiagnosticAsync(@" @@ -1390,7 +1390,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_While_ConditionContainsLocalDefinedInLoopBody_IsPatternExpression() { await VerifyNoDiagnosticAsync(@" @@ -1417,7 +1417,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_While_ConditionContainsLocalDefinedInLoopBody_OutVariable() { await VerifyNoDiagnosticAsync(@" @@ -1448,7 +1448,7 @@ private bool TryGet(out bool f) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_While_ConditionContainsLocalDefinedInLoopBody_DeconstructionVariable() { await VerifyNoDiagnosticAsync(@" @@ -1470,7 +1470,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_Do() { await VerifyNoDiagnosticAsync(@" @@ -1570,7 +1570,7 @@ void M(bool f1 = false, bool f2 = false) ", options: Options.AddAllowedCompilerDiagnosticId("CS1525")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_Do_ConditionContainsLocalDefinedInLoopBody_LocalDeclaration() { await VerifyNoDiagnosticAsync(@" @@ -1593,7 +1593,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_Do_ConditionContainsLocalDefinedInLoopBody_IsPatternExpression() { await VerifyNoDiagnosticAsync(@" @@ -1621,7 +1621,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_Do_ConditionContainsLocalDefinedInLoopBody_OutVariable() { await VerifyNoDiagnosticAsync(@" @@ -1653,7 +1653,7 @@ private bool TryGet(out bool f) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_Do_ConditionContainsLocalDefinedInLoopBody_DeconstructionVariable() { await VerifyNoDiagnosticAsync(@" @@ -1676,7 +1676,7 @@ void M() ", options: Options.AddAllowedCompilerDiagnosticId("CS1525")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyCodeBranching)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyCodeBranching)] public async Task TestNoDiagnostic_IfThatContainsOnlyDo_ConditionsAreNotEquivalent() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1220UsePatternMatchingInsteadOfIsAndCastTests.cs b/src/Tests/Analyzers.Tests/RCS1220UsePatternMatchingInsteadOfIsAndCastTests.cs index a5321c369d..63e39db02e 100644 --- a/src/Tests/Analyzers.Tests/RCS1220UsePatternMatchingInsteadOfIsAndCastTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1220UsePatternMatchingInsteadOfIsAndCastTests.cs @@ -13,7 +13,7 @@ public class RCS1220UsePatternMatchingInsteadOfIsAndCastTests : AbstractCSharpDi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UsePatternMatchingInsteadOfIsAndCast; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_LogicalAndExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -43,7 +43,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_LogicalAndExpression2() { await VerifyDiagnosticAndFixAsync(@" @@ -69,7 +69,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_LogicalAndExpression3() { await VerifyDiagnosticAndFixAsync(@" @@ -101,7 +101,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_LogicalAndExpression4() { await VerifyDiagnosticAndFixAsync(@" @@ -133,7 +133,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_LogicalAndExpression5() { await VerifyDiagnosticAndFixAsync(@" @@ -165,7 +165,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_LogicalAndExpression6() { await VerifyDiagnosticAndFixAsync(@" @@ -197,7 +197,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_LogicalAndExpression7() { await VerifyDiagnosticAndFixAsync(@" @@ -227,7 +227,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_LogicalAndExpression_Enum() { await VerifyDiagnosticAndFixAsync(@" @@ -263,7 +263,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement1() { await VerifyDiagnosticAndFixAsync(@" @@ -297,7 +297,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement2() { await VerifyDiagnosticAndFixAsync(@" @@ -329,7 +329,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement3() { await VerifyDiagnosticAndFixAsync(@" @@ -367,7 +367,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement4() { await VerifyDiagnosticAndFixAsync(@" @@ -405,7 +405,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement5() { await VerifyDiagnosticAndFixAsync(@" @@ -443,7 +443,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement6() { await VerifyDiagnosticAndFixAsync(@" @@ -483,7 +483,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement7() { await VerifyDiagnosticAndFixAsync(@" @@ -519,7 +519,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement8() { await VerifyDiagnosticAndFixAsync(@" @@ -553,7 +553,7 @@ bool M(dynamic @object, string name) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task Test_IfStatement_Enum() { await VerifyDiagnosticAndFixAsync(@" @@ -589,7 +589,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task TestNoDiagnostic_LogicalAndExpression() { await VerifyNoDiagnosticAsync(@" @@ -611,7 +611,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task TestNoDiagnostic_IfStatement() { await VerifyNoDiagnosticAsync(@" @@ -642,7 +642,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task TestNoDiagnostic_LogicalAnd_ExpressionTree() { await VerifyNoDiagnosticAsync(@" @@ -662,7 +662,7 @@ public void M(Expression> expression) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task TestNoDiagnostic_NullableType() { await VerifyNoDiagnosticAsync(@" @@ -683,7 +683,7 @@ void M(int? p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfIsAndCast)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfIsAndCast)] public async Task TestNoDiagnostic_LanguageVersion() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1221UsePatternMatchingInsteadOfAsAndNullCheckTests.cs b/src/Tests/Analyzers.Tests/RCS1221UsePatternMatchingInsteadOfAsAndNullCheckTests.cs index d4d2cf5452..9ec9334a40 100644 --- a/src/Tests/Analyzers.Tests/RCS1221UsePatternMatchingInsteadOfAsAndNullCheckTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1221UsePatternMatchingInsteadOfAsAndNullCheckTests.cs @@ -13,7 +13,7 @@ public class RCS1221UsePatternMatchingInsteadOfAsAndNullCheckTests : AbstractCSh { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UsePatternMatchingInsteadOfAsAndNullCheck; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task Test_EqualsToNull() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task Test_EqualsToNull_ExplicitType() { await VerifyDiagnosticAndFixAsync(@" @@ -76,7 +76,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task Test_EqualsToNull_ReturnVariable() { await VerifyDiagnosticAndFixAsync(@" @@ -113,7 +113,7 @@ string M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task Test_IsNull() { await VerifyDiagnosticAndFixAsync(@" @@ -146,7 +146,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_MultipleLocalDeclarations() { await VerifyNoDiagnosticAsync(@" @@ -166,7 +166,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_NotSimpleIf() { await VerifyNoDiagnosticAsync(@" @@ -189,7 +189,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_DoesNotContainJumpStatement() { await VerifyNoDiagnosticAsync(@" @@ -209,7 +209,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_NotEqualsToNull() { await VerifyNoDiagnosticAsync(@" @@ -229,7 +229,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_OtherVariableCheckedForNull() { await VerifyNoDiagnosticAsync(@" @@ -250,7 +250,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_TypesDoNotEqual() { await VerifyNoDiagnosticAsync(@" @@ -270,7 +270,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_Directive() { await VerifyNoDiagnosticAsync(@" @@ -292,7 +292,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_NullableType() { await VerifyNoDiagnosticAsync(@" @@ -312,7 +312,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatchingInsteadOfAsAndNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UsePatternMatchingInsteadOfAsAndNullCheck)] public async Task TestNoDiagnostic_LanguageVersion() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1222MergePreprocessorDirectivesTests.cs b/src/Tests/Analyzers.Tests/RCS1222MergePreprocessorDirectivesTests.cs index e0ee08efbc..1b340bf8e1 100644 --- a/src/Tests/Analyzers.Tests/RCS1222MergePreprocessorDirectivesTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1222MergePreprocessorDirectivesTests.cs @@ -12,7 +12,7 @@ public class RCS1222MergePreprocessorDirectivesTests : AbstractCSharpDiagnosticV { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.MergePreprocessorDirectives; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergePreprocessorDirectives)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergePreprocessorDirectives)] public async Task Test_PragmaWarningDisable() { await VerifyDiagnosticAndFixAsync(@" @@ -39,7 +39,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergePreprocessorDirectives)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergePreprocessorDirectives)] public async Task Test_PragmaWarningRestore() { await VerifyDiagnosticAndFixAsync(@" @@ -66,7 +66,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergePreprocessorDirectives)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergePreprocessorDirectives)] public async Task TestNoDiagnostic_SingleDirective() { await VerifyNoDiagnosticAsync(@" @@ -80,7 +80,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergePreprocessorDirectives)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergePreprocessorDirectives)] public async Task TestNoDiagnostic_DisableAndRestore() { await VerifyNoDiagnosticAsync(@" @@ -95,7 +95,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergePreprocessorDirectives)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergePreprocessorDirectives)] public async Task TestNoDiagnostic_TrailingComment() { await VerifyNoDiagnosticAsync(@" @@ -110,7 +110,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergePreprocessorDirectives)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergePreprocessorDirectives)] public async Task TestNoDiagnostic_TrailingComma_TrailingComment() { await VerifyNoDiagnosticAsync(@" @@ -125,7 +125,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergePreprocessorDirectives)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergePreprocessorDirectives)] public async Task TestNoDiagnostic_PreviousDirectiveIsSuppressingThisAnalyzer() { await VerifyNoDiagnosticAsync(@" @@ -141,7 +141,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MergePreprocessorDirectives)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MergePreprocessorDirectives)] public async Task TestNoDiagnostic_NextDirectiveIsSuppressingThisAnalyzer() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1223MarkTypeWithDebuggerDisplayAttributeTests.cs b/src/Tests/Analyzers.Tests/RCS1223MarkTypeWithDebuggerDisplayAttributeTests.cs index 61f147947f..b7a4831fdd 100644 --- a/src/Tests/Analyzers.Tests/RCS1223MarkTypeWithDebuggerDisplayAttributeTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1223MarkTypeWithDebuggerDisplayAttributeTests.cs @@ -12,7 +12,7 @@ public class RCS1223MarkTypeWithDebuggerDisplayAttributeTests : AbstractCSharpDi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.MarkTypeWithDebuggerDisplayAttribute; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task Test_PublicClass() { await VerifyDiagnosticAndFixAsync(""" @@ -39,7 +39,7 @@ private string DebuggerDisplay """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task Test_PublicClassWithDocComment() { await VerifyDiagnosticAndFixAsync(""" @@ -68,7 +68,7 @@ private string DebuggerDisplay """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task Test_PublicClassWithAttribute() { await VerifyDiagnosticAndFixAsync(""" @@ -99,7 +99,7 @@ private string DebuggerDisplay """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task Test_PublicClassWithDocCommentAndAttribute() { await VerifyDiagnosticAndFixAsync(""" @@ -136,7 +136,7 @@ private string DebuggerDisplay """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task Test_PublicStructWithDocCommentAndAttribute() { await VerifyDiagnosticAndFixAsync(""" @@ -173,7 +173,7 @@ private string DebuggerDisplay """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task TestNoDiagnostic_ClassWithDebuggerDisplayAttribute() { await VerifyNoDiagnosticAsync(""" @@ -186,7 +186,7 @@ public class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task TestNoDiagnostic_ClassWithDebuggerDisplayAttributeOnBaseClass() { await VerifyNoDiagnosticAsync(""" @@ -203,7 +203,7 @@ public class C : B """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task TestNoDiagnostic_StaticClass() { await VerifyNoDiagnosticAsync(@" @@ -213,7 +213,7 @@ static class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task TestNoDiagnostic_Interface() { await VerifyNoDiagnosticAsync(@" @@ -223,7 +223,7 @@ public interface IC "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task TestNoDiagnostic_NonPubliclyVisibleType() { await VerifyNoDiagnosticAsync(""" @@ -257,7 +257,7 @@ protected class FooProtected { } """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task TestNoDiagnostic_NonPubliclyVisibleType_PrivateProtected() { await VerifyNoDiagnosticAsync(""" @@ -276,7 +276,7 @@ protected class DC { } """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task TestNoDiagnostic_AbstractClass() { await VerifyNoDiagnosticAsync(@" @@ -288,7 +288,7 @@ public abstract class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task Test_PublicRecord() { await VerifyDiagnosticAndFixAsync(""" @@ -315,7 +315,7 @@ private string DebuggerDisplay """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MarkTypeWithDebuggerDisplayAttribute)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MarkTypeWithDebuggerDisplayAttribute)] public async Task Test_PublicReadOnlyRefStruct() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1224MakeMethodExtensionMethodTests.cs b/src/Tests/Analyzers.Tests/RCS1224MakeMethodExtensionMethodTests.cs index cdc2a9f1ea..06b3cabbf6 100644 --- a/src/Tests/Analyzers.Tests/RCS1224MakeMethodExtensionMethodTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1224MakeMethodExtensionMethodTests.cs @@ -12,7 +12,7 @@ public class RCS1224MakeMethodExtensionMethodTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.MakeMethodExtensionMethod; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task Test_Accessibility_ImplicitlyInternal() { await VerifyDiagnosticAndFixAsync(@" @@ -28,7 +28,7 @@ static class FooExtensions "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task Test_Accessibility_Internal() { await VerifyDiagnosticAndFixAsync(@" @@ -44,7 +44,7 @@ internal static class FooExtensions "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task Test_Accessibility_Public() { await VerifyDiagnosticAndFixAsync(@" @@ -60,7 +60,7 @@ public static class FooExtensions "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task Test_Modifier_In_ValueType() { await VerifyDiagnosticAndFixAsync(@" @@ -76,7 +76,7 @@ public static void M(this in int i) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task Test_Modifier_Ref_ValueType() { await VerifyDiagnosticAndFixAsync(@" @@ -92,7 +92,7 @@ public static void M(this ref int i) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task Test_Modifier_Ref_StructConstraint() { await VerifyDiagnosticAndFixAsync(@" @@ -108,7 +108,7 @@ public static void M(this ref T i) where T: struct { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task Test_Modifier_Ref_UnmanagedConstraint() { await VerifyDiagnosticAndFixAsync(@" @@ -124,7 +124,7 @@ public static void M(this ref T i) where T: unmanaged { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_NoSuffix() { await VerifyNoDiagnosticAsync(@" @@ -135,7 +135,7 @@ public static class Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_NotStatic() { await VerifyNoDiagnosticAsync(@" @@ -146,7 +146,7 @@ public class FooExtensions "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_NestedClass() { await VerifyNoDiagnosticAsync(@" @@ -160,7 +160,7 @@ public static class FooExtensions "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_PrivateMethod() { await VerifyNoDiagnosticAsync(@" @@ -171,7 +171,7 @@ public static class FooExtensions "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_Modifier_This() { await VerifyNoDiagnosticAsync(@" @@ -182,7 +182,7 @@ public static class FooExtensions "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_Modifier_In_ReferenceType() { await VerifyNoDiagnosticAsync(@" @@ -193,7 +193,7 @@ public static void M(in object p) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_Modifier_In_StructConstraint() { await VerifyNoDiagnosticAsync(@" @@ -204,7 +204,7 @@ public static void M(in T t) where T : struct { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_Modifier_In_UnmanagedConstraint() { await VerifyNoDiagnosticAsync(@" @@ -215,7 +215,7 @@ public static void M(in T t) where T : unmanaged { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_Modifier_Ref_ReferenceType() { await VerifyNoDiagnosticAsync(@" @@ -226,7 +226,7 @@ public static void M(ref object p) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_ParameterHasDefaultValue() { await VerifyNoDiagnosticAsync(@" @@ -237,7 +237,7 @@ public static void M(object p = null) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_PointerType() { await VerifyNoDiagnosticAsync(@" @@ -248,7 +248,7 @@ public static unsafe void M(int* p) { } ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeMethodExtensionMethod)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeMethodExtensionMethod)] public async Task TestNoDiagnostic_Params() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1225MakeClassSealedTests.cs b/src/Tests/Analyzers.Tests/RCS1225MakeClassSealedTests.cs index d4b0932adb..6afe43a01f 100644 --- a/src/Tests/Analyzers.Tests/RCS1225MakeClassSealedTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1225MakeClassSealedTests.cs @@ -12,7 +12,7 @@ public class RCS1225MakeClassSealedTests : AbstractCSharpDiagnosticVerifier M2() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ValidateArgumentsCorrectly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ValidateArgumentsCorrectly)] public async Task Test_PreprocessorDirectives() { await VerifyDiagnosticAndFixAsync(@" @@ -110,7 +110,7 @@ IEnumerable M2() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ValidateArgumentsCorrectly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ValidateArgumentsCorrectly)] public async Task Test_IAsyncEnumerable() { await VerifyDiagnosticAndFixAsync(@" @@ -153,7 +153,7 @@ async IAsyncEnumerable M2() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ValidateArgumentsCorrectly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ValidateArgumentsCorrectly)] public async Task TestNoDiagnostic_NoStatement() { await VerifyNoDiagnosticAsync(@" @@ -166,7 +166,7 @@ void M(object p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ValidateArgumentsCorrectly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ValidateArgumentsCorrectly)] public async Task TestNoDiagnostic_NoNullCheck() { await VerifyNoDiagnosticAsync(@" @@ -184,7 +184,7 @@ IEnumerable M(object p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ValidateArgumentsCorrectly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ValidateArgumentsCorrectly)] public async Task TestNoDiagnostic_NullChecksOnly() { await VerifyNoDiagnosticAsync(@" @@ -204,7 +204,7 @@ void M(object p, object p2) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ValidateArgumentsCorrectly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ValidateArgumentsCorrectly)] public async Task TestNoDiagnostic_IfElse_PreprocessorDirectives() { await VerifyNoDiagnosticAsync(@" @@ -226,7 +226,7 @@ IEnumerable M(object p, object p2) ", options: Options.WithDebugPreprocessorSymbol()); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ValidateArgumentsCorrectly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ValidateArgumentsCorrectly)] public async Task TestNoDiagnostic_NoParameters() { await VerifyNoDiagnosticAsync(@" @@ -243,7 +243,7 @@ IEnumerable M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ValidateArgumentsCorrectly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ValidateArgumentsCorrectly)] public async Task TestNoDiagnostic_NoMethodBody() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1228UnusedElementInDocumentationCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1228UnusedElementInDocumentationCommentTests.cs index 265a93b0e5..5f9976e73e 100644 --- a/src/Tests/Analyzers.Tests/RCS1228UnusedElementInDocumentationCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1228UnusedElementInDocumentationCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1228UnusedElementInDocumentationCommentTests : AbstractCSharpDia { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnusedElementInDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_FirstElement() { await VerifyDiagnosticAndFixAsync(@" @@ -37,7 +37,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_FirstElement_Pragma() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_LastElement() { await VerifyDiagnosticAndFixAsync(@" @@ -89,7 +89,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_SelfClosingTag() { await VerifyDiagnosticAndFixAsync(@" @@ -114,7 +114,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_ReturnsIsOnlyElement() { await VerifyDiagnosticAndFixAsync(@" @@ -135,7 +135,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_ReturnsIsOnlyElement_LocalFunction() { await VerifyDiagnosticAndFixAsync(@" @@ -162,7 +162,7 @@ void LF() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_ExampleElement() { await VerifyDiagnosticAndFixAsync(@" @@ -181,7 +181,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_RemarksElement() { await VerifyDiagnosticAndFixAsync(@" @@ -200,7 +200,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_ValueElement() { await VerifyDiagnosticAndFixAsync(@" @@ -219,7 +219,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_ParamElement() { await VerifyDiagnosticAndFixAsync(""" @@ -239,7 +239,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_ParamElement2() { await VerifyDiagnosticAndFixAsync(""" @@ -258,7 +258,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_ParamElement_SelfClosingTag() { await VerifyDiagnosticAndFixAsync(""" @@ -277,7 +277,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_TypeParamElement() { await VerifyDiagnosticAndFixAsync(""" @@ -296,7 +296,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_TypeParamElement2() { await VerifyDiagnosticAndFixAsync(""" @@ -315,7 +315,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_TypeParamElement_SelfClosingTag() { await VerifyDiagnosticAndFixAsync(""" @@ -334,7 +334,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task Test_Class_PrimaryConstructor() { await VerifyDiagnosticAndFixAsync(""" @@ -357,7 +357,7 @@ public class Foo(string value) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task TestNoDiagnostic_Record() { await VerifyNoDiagnosticAsync(""" @@ -369,7 +369,7 @@ public record Foo(string Bar); """, options: Options.AddAllowedCompilerDiagnosticId("CS0518")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task TestNoDiagnostic_RecordStruct() { await VerifyNoDiagnosticAsync(""" @@ -381,7 +381,7 @@ public record struct Foo(string Bar); """, options: Options.AddAllowedCompilerDiagnosticId("CS0518")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task TestNoDiagnostic_ClassPrimaryConstructor() { await VerifyNoDiagnosticAsync(""" @@ -396,7 +396,7 @@ public class Foo(string value) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task TestNoDiagnostic_StructPrimaryConstructor() { await VerifyNoDiagnosticAsync(""" @@ -411,7 +411,7 @@ public struct Foo(string value) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnusedElementInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnusedElementInDocumentationComment)] public async Task TestNoDiagnostic_NonEmpty() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1229UseAsyncAwaitTests.cs b/src/Tests/Analyzers.Tests/RCS1229UseAsyncAwaitTests.cs index b8a917d74e..15f6722ae4 100644 --- a/src/Tests/Analyzers.Tests/RCS1229UseAsyncAwaitTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1229UseAsyncAwaitTests.cs @@ -12,7 +12,7 @@ public class RCS1229UseAsyncAwaitTests : AbstractCSharpDiagnosticVerifier M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_Method_Task() { await VerifyDiagnosticAndFixAsync(@" @@ -88,7 +88,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_Method_MultipleReturnStatements() { await VerifyDiagnosticAndFixAsync(@" @@ -148,7 +148,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_LocalFunction() { await VerifyDiagnosticAndFixAsync(@" @@ -192,7 +192,7 @@ async Task LF() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_SimpleLambda() { await VerifyDiagnosticAndFixAsync(@" @@ -236,7 +236,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_ParenthesizedLambda() { await VerifyDiagnosticAndFixAsync(@" @@ -280,7 +280,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_AnonymousMethod() { await VerifyDiagnosticAndFixAsync(@" @@ -324,7 +324,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_UsingLocalDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -358,7 +358,7 @@ public async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_UsingLocalDeclaration2() { await VerifyDiagnosticAndFixAsync(@" @@ -404,7 +404,7 @@ public async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_TryCatch() { await VerifyDiagnosticAndFixAsync(@" @@ -452,7 +452,7 @@ async Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task Test_DuckTyped_TaskType() { await VerifyDiagnosticAndFixAsync(@" @@ -556,7 +556,7 @@ public void OnCompleted(Action continuation) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_UsingLocalDeclaration() { await VerifyNoDiagnosticAsync(@" @@ -581,7 +581,7 @@ public Task M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_TaskCompletedTask() { await VerifyNoDiagnosticAsync(@" @@ -600,7 +600,7 @@ Task M(CancellationToken cancellationToken) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_TaskFromCanceled() { await VerifyNoDiagnosticAsync(@" @@ -619,7 +619,7 @@ Task M(CancellationToken cancellationToken) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_TaskFromException() { await VerifyNoDiagnosticAsync(@" @@ -638,7 +638,7 @@ Task M(CancellationToken cancellationToken) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_TaskOfTFromResult() { await VerifyNoDiagnosticAsync(@" @@ -657,7 +657,7 @@ Task M(CancellationToken cancellationToken) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_TaskOfTFromCanceled() { await VerifyNoDiagnosticAsync(@" @@ -676,7 +676,7 @@ Task M(CancellationToken cancellationToken) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_TaskOfTFromException() { await VerifyNoDiagnosticAsync(@" @@ -695,7 +695,7 @@ Task M(CancellationToken cancellationToken) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_IAsyncEnumerable() { await VerifyNoDiagnosticAsync(@" @@ -722,7 +722,7 @@ async IAsyncEnumerable GetAsync2(IDisposable disposable) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_DuckTyped_NotTaskType() { await VerifyNoDiagnosticAsync(@" @@ -776,7 +776,7 @@ public void OnCompleted(Action continuation) { } } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseAsyncAwait)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseAsyncAwait)] public async Task TestNoDiagnostic_NonAwaitable_TaskType() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1230UnnecessaryExplicitUseOfEnumeratorTests.cs b/src/Tests/Analyzers.Tests/RCS1230UnnecessaryExplicitUseOfEnumeratorTests.cs index 77ab2c27c3..daf71cc7b7 100644 --- a/src/Tests/Analyzers.Tests/RCS1230UnnecessaryExplicitUseOfEnumeratorTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1230UnnecessaryExplicitUseOfEnumeratorTests.cs @@ -12,7 +12,7 @@ public class RCS1230UnnecessaryExplicitUseOfEnumeratorTests : AbstractCSharpDiag { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryExplicitUseOfEnumerator; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryExplicitUseOfEnumerator)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -53,7 +53,7 @@ IEnumerable M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryExplicitUseOfEnumerator)] public async Task Test_EmbeddedStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -86,7 +86,7 @@ IEnumerable M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryExplicitUseOfEnumerator)] public async Task Test_NestedCurrent() { await VerifyDiagnosticAndFixAsync(@" @@ -125,7 +125,7 @@ IEnumerable M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryExplicitUseOfEnumerator)] public async Task TestNoDiagnostic_WhileDoesNotContainCurrent() { await VerifyNoDiagnosticAsync(@" @@ -148,7 +148,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryExplicitUseOfEnumerator)] public async Task TestNoDiagnostic_UsingContainsMultipleStatements() { await VerifyNoDiagnosticAsync(@" @@ -174,7 +174,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryExplicitUseOfEnumerator)] public async Task TestNoDiagnostic_IfInsteadOfWhile() { await VerifyNoDiagnosticAsync(@" @@ -198,7 +198,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryExplicitUseOfEnumerator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryExplicitUseOfEnumerator)] public async Task TestNoDiagnostic_WhileContainsMoveNext() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1231MakeParameterRefReadOnlyTests.cs b/src/Tests/Analyzers.Tests/RCS1231MakeParameterRefReadOnlyTests.cs index 6faad0b25b..20765b7b9e 100644 --- a/src/Tests/Analyzers.Tests/RCS1231MakeParameterRefReadOnlyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1231MakeParameterRefReadOnlyTests.cs @@ -12,7 +12,7 @@ public class RCS1231MakeParameterRefReadOnlyTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.MakeParameterRefReadOnly; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -44,7 +44,7 @@ IEnumerable LF() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_Assigned() { await VerifyNoDiagnosticAsync(@" @@ -58,7 +58,7 @@ void M(C c) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_ReferencedInLocalFunction() { await VerifyNoDiagnosticAsync(@" @@ -75,7 +75,7 @@ void LF() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_ReferencedInLambda() { await VerifyNoDiagnosticAsync(@" @@ -91,7 +91,7 @@ void M(C c) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_Iterator() { await VerifyNoDiagnosticAsync(@" @@ -107,7 +107,7 @@ IEnumerable M(C c) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_DuplicateParameterName() { await VerifyNoDiagnosticAsync(@" @@ -122,7 +122,7 @@ void M(C c, C c) ", options: Options.AddAllowedCompilerDiagnosticId("CS0100")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_MethodReferencedAsMethodGroup() { await VerifyNoDiagnosticAsync(@" @@ -143,7 +143,7 @@ readonly struct B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_LocalFunctionReferencedAsMethodGroup() { await VerifyNoDiagnosticAsync(@" @@ -167,7 +167,7 @@ bool M(List p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_BoolType() { await VerifyNoDiagnosticAsync(@" @@ -180,7 +180,7 @@ void M(bool value) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeParameterRefReadOnly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.MakeParameterRefReadOnly)] public async Task TestNoDiagnostic_ExpressionTree() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1232OrderElementsInDocumentationCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1232OrderElementsInDocumentationCommentTests.cs index 18c2f02a2f..c519977780 100644 --- a/src/Tests/Analyzers.Tests/RCS1232OrderElementsInDocumentationCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1232OrderElementsInDocumentationCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1232OrderElementsInDocumentationCommentTests : AbstractCSharpDia { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.OrderElementsInDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OrderElementsInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OrderElementsInDocumentationComment)] public async Task Test_Parameters() { await VerifyDiagnosticAndFixAsync(""" @@ -40,7 +40,7 @@ void M(object a, object b, object c) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OrderElementsInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OrderElementsInDocumentationComment)] public async Task Test_Parameters2() { await VerifyDiagnosticAndFixAsync(""" @@ -68,7 +68,7 @@ void M(object a, object b, object c) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OrderElementsInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OrderElementsInDocumentationComment)] public async Task Test_Parameters3() { await VerifyDiagnosticAndFixAsync(""" @@ -96,7 +96,7 @@ void M(object a, object b, object c) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OrderElementsInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OrderElementsInDocumentationComment)] public async Task Test_Parameters4() { await VerifyDiagnosticAndFixAsync(""" @@ -122,7 +122,7 @@ void M(object a, object b, object c) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OrderElementsInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OrderElementsInDocumentationComment)] public async Task Test_TypeParameters() { await VerifyDiagnosticAndFixAsync(""" @@ -150,7 +150,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OrderElementsInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OrderElementsInDocumentationComment)] public async Task TestNoDiagnostic_Parameters() { await VerifyNoDiagnosticAsync(""" @@ -167,7 +167,7 @@ void M(object a, object b, object c) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.OrderElementsInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.OrderElementsInDocumentationComment)] public async Task TestNoDiagnostic_TypeParameters() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1233UseShortCircuitingOperatorTests.cs b/src/Tests/Analyzers.Tests/RCS1233UseShortCircuitingOperatorTests.cs index 2b329e71c5..5561cddc12 100644 --- a/src/Tests/Analyzers.Tests/RCS1233UseShortCircuitingOperatorTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1233UseShortCircuitingOperatorTests.cs @@ -12,7 +12,7 @@ public class RCS1233UseShortCircuitingOperatorTests : AbstractCSharpDiagnosticVe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseShortCircuitingOperator; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseShortCircuitingOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseShortCircuitingOperator)] public async Task Test_Or() { await VerifyDiagnosticAndFixAsync(@" @@ -44,7 +44,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseShortCircuitingOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseShortCircuitingOperator)] public async Task Test_And() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1234DuplicateEnumValueTests.cs b/src/Tests/Analyzers.Tests/RCS1234DuplicateEnumValueTests.cs index c15143a404..815aa82236 100644 --- a/src/Tests/Analyzers.Tests/RCS1234DuplicateEnumValueTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1234DuplicateEnumValueTests.cs @@ -12,7 +12,7 @@ public class RCS1234DuplicateEnumValueTests : AbstractCSharpDiagnosticVerifier M(bool f, bool f2, bool f3) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidNestedConditionalOperators)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidNestedConditionalOperators)] public async Task Test_YieldReturnStatement2() { await VerifyDiagnosticAndFixAsync(""" @@ -441,7 +441,7 @@ IEnumerable M(bool f, bool f2, bool f3) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidNestedConditionalOperators)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AvoidNestedConditionalOperators)] public async Task Test_YieldReturnStatement3() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1239UseForStatementInsteadOfWhileStatementTests.cs b/src/Tests/Analyzers.Tests/RCS1239UseForStatementInsteadOfWhileStatementTests.cs index e8de74fab5..3b39e5b724 100644 --- a/src/Tests/Analyzers.Tests/RCS1239UseForStatementInsteadOfWhileStatementTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1239UseForStatementInsteadOfWhileStatementTests.cs @@ -12,7 +12,7 @@ public class RCS1239UseForStatementInsteadOfWhileStatementTests : AbstractCSharp { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseForStatementInsteadOfWhileStatement; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseForStatementInsteadOfWhileStatement)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseForStatementInsteadOfWhileStatement)] public async Task Test_ContinueStatementInsideNestedLoop() { await VerifyDiagnosticAndFixAsync(@" @@ -95,7 +95,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseForStatementInsteadOfWhileStatement)] public async Task TestNoDiagnostic_LocalVariableReferencedAfterWhileStatement() { await VerifyNoDiagnosticAsync(@" @@ -118,7 +118,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseForStatementInsteadOfWhileStatement)] public async Task TestNoDiagnostic_ContainsContinueStatement() { await VerifyNoDiagnosticAsync(@" @@ -147,7 +147,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseForStatementInsteadOfWhileStatement)] public async Task TestNoDiagnostic_MultipleIncrementedVariables() { await VerifyNoDiagnosticAsync(@" @@ -170,7 +170,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseForStatementInsteadOfWhileStatement)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseForStatementInsteadOfWhileStatement)] public async Task TestNoDiagnostic_ConditionIsTrue() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1240UnnecessaryOperatorTests.cs b/src/Tests/Analyzers.Tests/RCS1240UnnecessaryOperatorTests.cs index 77e0be592f..2777eb986f 100644 --- a/src/Tests/Analyzers.Tests/RCS1240UnnecessaryOperatorTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1240UnnecessaryOperatorTests.cs @@ -12,7 +12,7 @@ public class RCS1240UnnecessaryOperatorTests : AbstractCSharpDiagnosticVerifier< { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryOperator; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryOperator)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -58,7 +58,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryOperator)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryOperator)] public async Task Test_RightToLeft() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1241ImplementNonGenericCounterpartTests.cs b/src/Tests/Analyzers.Tests/RCS1241ImplementNonGenericCounterpartTests.cs index 36443e70b3..9475f73d0f 100644 --- a/src/Tests/Analyzers.Tests/RCS1241ImplementNonGenericCounterpartTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1241ImplementNonGenericCounterpartTests.cs @@ -19,7 +19,7 @@ public RCS1241ImplementNonGenericCounterpartTests() _explicitEquivalenceKey = new ImplementNonGenericCounterpartCodeFixProvider().ExplicitEquivalenceKey; } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ImplementNonGenericCounterpart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ImplementNonGenericCounterpart)] public async Task Test_IComparable() { await VerifyDiagnosticAndFixAsync(""" @@ -63,7 +63,7 @@ public int CompareTo(object obj) """, equivalenceKey: EquivalenceKey.Create(Descriptor.Id)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ImplementNonGenericCounterpart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ImplementNonGenericCounterpart)] public async Task Test_Record_IComparable() { await VerifyDiagnosticAndFixAsync(""" @@ -107,7 +107,7 @@ public int CompareTo(object obj) """, equivalenceKey: EquivalenceKey.Create(Descriptor.Id)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ImplementNonGenericCounterpart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ImplementNonGenericCounterpart)] public async Task Test_IComparable_Explicit() { await VerifyDiagnosticAndFixAsync(""" @@ -151,7 +151,7 @@ int IComparable.CompareTo(object obj) """, equivalenceKey: _explicitEquivalenceKey); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ImplementNonGenericCounterpart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ImplementNonGenericCounterpart)] public async Task Test_IComparer() { await VerifyDiagnosticAndFixAsync(""" @@ -208,7 +208,7 @@ public int Compare(object x, object y) """, equivalenceKey: EquivalenceKey.Create(Descriptor.Id)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ImplementNonGenericCounterpart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ImplementNonGenericCounterpart)] public async Task Test_IComparer_Explicit() { await VerifyDiagnosticAndFixAsync(""" @@ -265,7 +265,7 @@ int IComparer.Compare(object x, object y) """, equivalenceKey: _explicitEquivalenceKey); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ImplementNonGenericCounterpart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ImplementNonGenericCounterpart)] public async Task Test_IEqualityComparer() { await VerifyDiagnosticAndFixAsync(""" @@ -335,7 +335,7 @@ public int GetHashCode(object obj) """, equivalenceKey: EquivalenceKey.Create(Descriptor.Id)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.ImplementNonGenericCounterpart)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.ImplementNonGenericCounterpart)] public async Task Test_IEqualityComparer_Explicit() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1242DoNotPassNonReadOnlyStructByReadOnlyReferenceTests.cs b/src/Tests/Analyzers.Tests/RCS1242DoNotPassNonReadOnlyStructByReadOnlyReferenceTests.cs index 3b9b1e0ed7..d6600dcd26 100644 --- a/src/Tests/Analyzers.Tests/RCS1242DoNotPassNonReadOnlyStructByReadOnlyReferenceTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1242DoNotPassNonReadOnlyStructByReadOnlyReferenceTests.cs @@ -12,7 +12,7 @@ public class RCS1242DoNotPassNonReadOnlyStructByReadOnlyReferenceTests : Abstrac { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.DoNotPassNonReadOnlyStructByReadOnlyReference; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DoNotPassNonReadOnlyStructByReadOnlyReference)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DoNotPassNonReadOnlyStructByReadOnlyReference)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -32,7 +32,7 @@ void M(C c) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DoNotPassNonReadOnlyStructByReadOnlyReference)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DoNotPassNonReadOnlyStructByReadOnlyReference)] public async Task TestNoDiagnostic_ReadOnlyStruct() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1243DuplicateWordInCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1243DuplicateWordInCommentTests.cs index b4d55d1ba4..e850c46820 100644 --- a/src/Tests/Analyzers.Tests/RCS1243DuplicateWordInCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1243DuplicateWordInCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1243DuplicateWordInCommentTests : AbstractCSharpDiagnosticVerifi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.DuplicateWordInComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DuplicateWordInComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DuplicateWordInComment)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DuplicateWordInComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DuplicateWordInComment)] public async Task Test_MoreWhiteSpace() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DuplicateWordInComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DuplicateWordInComment)] public async Task Test_EndOfText() { await VerifyDiagnosticAndFixAsync(@" @@ -90,7 +90,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DuplicateWordInComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DuplicateWordInComment)] public async Task Test_StartOfText() { await VerifyDiagnosticAndFixAsync(@" @@ -116,7 +116,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DuplicateWordInComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DuplicateWordInComment)] public async Task Test_ThreeConsecutiveWords() { await VerifyDiagnosticAndFixAsync(@" @@ -142,7 +142,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DuplicateWordInComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DuplicateWordInComment)] public async Task Test_TwoConsecutiveDuplicateWords() { await VerifyDiagnosticAndFixAsync(@" @@ -168,7 +168,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DuplicateWordInComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DuplicateWordInComment)] public async Task Test_TwoDuplicateWords() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1244SimplifyDefaultExpressionTests.cs b/src/Tests/Analyzers.Tests/RCS1244SimplifyDefaultExpressionTests.cs index fc2146746b..9c5dacdfac 100644 --- a/src/Tests/Analyzers.Tests/RCS1244SimplifyDefaultExpressionTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1244SimplifyDefaultExpressionTests.cs @@ -12,7 +12,7 @@ public class RCS1244SimplifyDefaultExpressionTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyDefaultExpression; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task Test_ParameterDefaultValue() { await VerifyDiagnosticAndFixAsync(@" @@ -32,7 +32,7 @@ void M(string s = default) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task Test_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -48,7 +48,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task Test_ReturnStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ string M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task Test_ReturnStatement2() { await VerifyDiagnosticAndFixAsync(@" @@ -108,7 +108,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task Test_ReturnStatement3() { await VerifyDiagnosticAndFixAsync(@" @@ -158,7 +158,7 @@ public static IEnumerable Select(IEnumerable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task Test_YieldReturnStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -184,7 +184,7 @@ IEnumerable M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_NonObjectValueAssignedToObject() { await VerifyNoDiagnosticAsync(@" @@ -200,7 +200,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_NonNullableValueAssignedToNullable() { await VerifyNoDiagnosticAsync(@" @@ -216,7 +216,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_ValueAssignedToDynamic() { await VerifyNoDiagnosticAsync(@" @@ -232,7 +232,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_ConditionalExpression() { await VerifyNoDiagnosticAsync(@" @@ -250,7 +250,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_ConditionalExpression_Nullable() { await VerifyNoDiagnosticAsync(@" @@ -268,7 +268,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_ReturnStatement() { await VerifyNoDiagnosticAsync(@" @@ -282,7 +282,7 @@ object M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_CoalesceExpression() { await VerifyNoDiagnosticAsync(@" @@ -298,7 +298,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_ExpressionBody() { await VerifyNoDiagnosticAsync(@" @@ -309,7 +309,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_ObjectInitializer() { await VerifyNoDiagnosticAsync(@" @@ -325,7 +325,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_ConstantPattern() { await VerifyNoDiagnosticAsync(@" @@ -343,7 +343,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_CaseSwitchLabel() { await VerifyNoDiagnosticAsync(@" @@ -363,7 +363,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_Argument() { await VerifyNoDiagnosticAsync(@" @@ -377,7 +377,7 @@ void M(string s) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_CSharp7() { await VerifyNoDiagnosticAsync(@" @@ -390,7 +390,7 @@ class C ", options: WellKnownCSharpTestOptions.Default_CSharp7); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_Nullable() { await VerifyNoDiagnosticAsync(@" @@ -406,7 +406,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_TypeInferredFromReturnStatement() { await VerifyNoDiagnosticAsync(@" @@ -428,7 +428,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_TypeInferredFromReturnStatement2() { await VerifyNoDiagnosticAsync(@" @@ -456,7 +456,7 @@ public static IEnumerable Select(IEnumerable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_OverloadedEqualityOperator() { await VerifyNoDiagnosticAsync(@" @@ -476,7 +476,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_LambdaExpression() { await VerifyNoDiagnosticAsync(@" @@ -493,7 +493,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyDefaultExpression)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyDefaultExpression)] public async Task TestNoDiagnostic_LambdaExpression2() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1246UseElementAccessTests.cs b/src/Tests/Analyzers.Tests/RCS1246UseElementAccessTests.cs index f401ebbe28..bde618ba2d 100644 --- a/src/Tests/Analyzers.Tests/RCS1246UseElementAccessTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1246UseElementAccessTests.cs @@ -12,7 +12,7 @@ public class RCS1246UseElementAccessTests : AbstractCSharpDiagnosticVerifier)x).[|First()|]", "((List)x)[0]")] [InlineData("((IList)x).[|First()|]", "((IList)x)[0]")] [InlineData("((IReadOnlyList)x).[|First()|]", "((IReadOnlyList)x)[0]")] @@ -40,7 +40,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task Test_UseElementAccessInsteadOfFirst_DerivedFromList() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] [InlineData("((List)x).[|ElementAt(1)|]", "((List)x)[1]")] [InlineData("((IList)x).[|ElementAt(1)|]", "((IList)x)[1]")] [InlineData("((IReadOnlyList)x).[|ElementAt(1)|]", "((IReadOnlyList)x)[1]")] @@ -98,7 +98,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task Test_UseElementAccessInsteadOfElementAt_DerivedFromList() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_UseElementAccessInsteadOfElementAt() { await VerifyNoDiagnosticAsync(@" @@ -154,7 +154,7 @@ void M() "); } - [Theory, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Theory, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] [InlineData("((List)x).[|Last()|]", "((List)x)[^1]")] [InlineData("((IList)x).[|Last()|]", "((IList)x)[^1]")] [InlineData("((IReadOnlyList)x).[|Last()|]", "((IReadOnlyList)x)[^1]")] @@ -182,7 +182,7 @@ void M() ", source, expected); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task Test_UseElementAccessInsteadOfLast_CSharp7() { await VerifyNoDiagnosticAsync(@" @@ -200,7 +200,7 @@ void M() ", options: WellKnownCSharpTestOptions.Default_CSharp7); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_UseElementAccessInsteadOfLast() { await VerifyNoDiagnosticAsync(@" @@ -226,7 +226,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_UseElementAccessInsteadOfFirst() { await VerifyNoDiagnosticAsync(@" @@ -252,7 +252,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_UseElementAccessOnElementAccess() { await VerifyNoDiagnosticAsync(@" @@ -274,7 +274,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_UseElementAccess_ExpressionStatement() { await VerifyNoDiagnosticAsync(@" @@ -294,7 +294,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_UseElementAccessInsteadOfElementAt_InfiniteRecursion() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1247FixDocumentationCommentTagTests.cs b/src/Tests/Analyzers.Tests/RCS1247FixDocumentationCommentTagTests.cs index b588f2cd90..82e65a8fb1 100644 --- a/src/Tests/Analyzers.Tests/RCS1247FixDocumentationCommentTagTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1247FixDocumentationCommentTagTests.cs @@ -12,7 +12,7 @@ public class RCS1247FixDocumentationCommentTagTests : AbstractCSharpDiagnosticVe { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FixDocumentationCommentTag; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixDocumentationCommentTag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FixDocumentationCommentTag)] public async Task Test_C_Multiline() { await VerifyDiagnosticAndFixAsync(""" @@ -72,7 +72,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixDocumentationCommentTag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FixDocumentationCommentTag)] public async Task Test_C_Multiline_List() { await VerifyDiagnosticAndFixAsync(""" @@ -148,7 +148,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixDocumentationCommentTag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FixDocumentationCommentTag)] public async Task Test_Code_Singleline() { await VerifyDiagnosticAndFixAsync(""" @@ -192,7 +192,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixDocumentationCommentTag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FixDocumentationCommentTag)] public async Task Test_Code_Singleline_List() { await VerifyDiagnosticAndFixAsync(""" @@ -252,7 +252,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixDocumentationCommentTag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FixDocumentationCommentTag)] public async Task TestNoDiagnostic_C_Singleline() { await VerifyNoDiagnosticAsync(""" @@ -276,7 +276,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixDocumentationCommentTag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FixDocumentationCommentTag)] public async Task TestNoDiagnostic_Code_Multiline() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1248NormalizeNullCheckTests.cs b/src/Tests/Analyzers.Tests/RCS1248NormalizeNullCheckTests.cs index 6ab1cd099a..d1f86c0a9f 100644 --- a/src/Tests/Analyzers.Tests/RCS1248NormalizeNullCheckTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1248NormalizeNullCheckTests.cs @@ -12,7 +12,7 @@ public class RCS1248NormalizeNullCheckTests : AbstractCSharpDiagnosticVerifier M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicit_Assignment() { await VerifyDiagnosticAndFixAsync(@" @@ -332,7 +332,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicit_CoalesceExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -358,7 +358,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicit_CollectionInitializer_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -392,7 +392,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicit_CollectionInitializer_Local() { await VerifyDiagnosticAndFixAsync(@" @@ -424,7 +424,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Implicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_ThrowStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -446,7 +446,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_ThrowExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -462,7 +462,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -478,7 +478,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -494,7 +494,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_LocalDeclaration() { await VerifyNoDiagnosticAsync(@" @@ -508,7 +508,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_DoNotPreferVar_LocalDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -531,7 +531,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_DoNotPreferVar_LocalDeclaration2() { await VerifyDiagnosticAndFixAsync(@" @@ -554,7 +554,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_UsingStatement() { await VerifyNoDiagnosticAsync(""" @@ -572,7 +572,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_DoNotPreferVar_UsingStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -603,7 +603,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_DoNotPreferVar_UsingStatement2() { await VerifyDiagnosticAndFixAsync(""" @@ -634,7 +634,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_ArrowExpressionClause() { await VerifyDiagnosticAndFixAsync(@" @@ -650,7 +650,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_Array() { await VerifyDiagnosticAndFixAsync(@" @@ -672,7 +672,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_ReturnStatement() { await VerifyNoDiagnosticAsync(@" @@ -686,7 +686,7 @@ string M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_YieldReturnStatement() { await VerifyNoDiagnosticAsync(@" @@ -702,7 +702,7 @@ IEnumerable M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_Assignment() { await VerifyNoDiagnosticAsync(@" @@ -717,7 +717,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_CoalesceExpression() { await VerifyNoDiagnosticAsync(@" @@ -733,7 +733,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_CollectionInitializer_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -767,7 +767,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_CollectionInitializer_Local() { await VerifyDiagnosticAndFixAsync(@" @@ -799,7 +799,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_ArrayInitializerInFieldInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -815,7 +815,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_ArrayInitializerInPropertyInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -831,7 +831,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_ArrayInitializerInLocalVariableInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -853,7 +853,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_PropertyLazyInitialization() { await VerifyDiagnosticAndFixAsync(@" @@ -881,7 +881,7 @@ public class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferImplicitWhenTypeIsObvious_FieldLazyInitialization() { await VerifyDiagnosticAndFixAsync(@" @@ -909,7 +909,7 @@ public class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_ThrowStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -931,7 +931,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_ThrowExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -947,7 +947,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -963,7 +963,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -979,7 +979,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_LocalDeclaration() { await VerifyNoDiagnosticAsync(@" @@ -993,7 +993,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_DoNotPreferVar_LocalDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -1016,7 +1016,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_DoNotPreferVar_LocalDeclaration2() { await VerifyDiagnosticAndFixAsync(@" @@ -1039,7 +1039,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_UsingStatement() { await VerifyNoDiagnosticAsync(""" @@ -1057,7 +1057,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_DoNotPreferVar_UsingStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -1088,7 +1088,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_DoNotPreferVar_UsingStatement2() { await VerifyDiagnosticAndFixAsync(""" @@ -1119,7 +1119,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_ArrowExpressionClause() { await VerifyDiagnosticAndFixAsync(@" @@ -1135,7 +1135,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_Array() { await VerifyDiagnosticAndFixAsync(@" @@ -1157,7 +1157,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_ReturnStatement() { await VerifyNoDiagnosticAsync(@" @@ -1171,7 +1171,7 @@ string M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_YieldReturnStatement() { await VerifyNoDiagnosticAsync(@" @@ -1187,7 +1187,7 @@ IEnumerable M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_Assignment() { await VerifyNoDiagnosticAsync(@" @@ -1202,7 +1202,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ConvertImplicitToExplicit_CoalesceExpression() { await VerifyNoDiagnosticAsync(@" @@ -1218,7 +1218,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_ThrowStatement() { await VerifyNoDiagnosticAsync(@" @@ -1232,7 +1232,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_ThrowExpression() { await VerifyNoDiagnosticAsync(@" @@ -1243,7 +1243,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_Property() { await VerifyNoDiagnosticAsync(@" @@ -1254,7 +1254,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_Field() { await VerifyNoDiagnosticAsync(@" @@ -1265,7 +1265,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_LocalDeclaration() { await VerifyNoDiagnosticAsync(@" @@ -1279,7 +1279,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_DoNotPreferVar_LocalDeclaration() { await VerifyNoDiagnosticAsync(@" @@ -1294,7 +1294,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_DoNotPreferVar_LocalDeclaration2() { await VerifyNoDiagnosticAsync(@" @@ -1309,7 +1309,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_UsingStatement() { await VerifyNoDiagnosticAsync(""" @@ -1327,7 +1327,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_DoNotPreferVar_UsingStatement() { await VerifyNoDiagnosticAsync(""" @@ -1346,7 +1346,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_DoNotPreferVar_UsingStatement2() { await VerifyNoDiagnosticAsync(""" @@ -1365,7 +1365,7 @@ void M() .AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_ArrowExpressionClause() { await VerifyNoDiagnosticAsync(@" @@ -1376,7 +1376,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_Array() { await VerifyNoDiagnosticAsync(@" @@ -1390,7 +1390,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_ReturnStatement() { await VerifyNoDiagnosticAsync(@" @@ -1404,7 +1404,7 @@ string M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_YieldReturnStatement() { await VerifyNoDiagnosticAsync(@" @@ -1420,7 +1420,7 @@ IEnumerable M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_Assignment() { await VerifyNoDiagnosticAsync(@" @@ -1435,7 +1435,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_CoalesceExpression() { await VerifyNoDiagnosticAsync(@" @@ -1451,7 +1451,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_CollectionInitializer_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -1485,7 +1485,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferExplicit_CollectionInitializer_Local() { await VerifyDiagnosticAndFixAsync(@" @@ -1517,7 +1517,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferVarInsteadOfImplicitObjectCreation_DoNotPreferVar_LocalDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -1539,7 +1539,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferVarInsteadOfImplicitObjectCreation_DoNotPreferVar_LocalDeclaration2() { await VerifyNoDiagnosticAsync(@" @@ -1553,7 +1553,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferVarInsteadOfImplicitObjectCreation_DoNotPreferVar_UsingStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -1583,7 +1583,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_PreferVarInsteadOfImplicitObjectCreation_DoNotPreferVar_UsingStatement2() { await VerifyNoDiagnosticAsync(""" @@ -1601,7 +1601,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVarInsteadOfImplicitObjectCreation, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task TestNoDiagnostic_ForEachExpression2() { await VerifyNoDiagnosticAsync(""" @@ -1615,7 +1615,7 @@ string[] M() """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ExplicitToCollectionExpression_ImplicitStyle() { await VerifyDiagnosticAndFixAsync(""" @@ -1640,7 +1640,7 @@ void M(List items) .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ExplicitToCollectionExpression_ImplicitWhenObviousStyle() { await VerifyDiagnosticAndFixAsync(""" @@ -1659,7 +1659,7 @@ class C .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ImplicitToCollectionExpression_ImplicitStyle() { await VerifyDiagnosticAndFixAsync(""" @@ -1684,7 +1684,7 @@ void M(List items) .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ImplicitToCollectionExpression_ImplicitWhenObviousStyle() { await VerifyDiagnosticAndFixAsync(""" @@ -1703,7 +1703,7 @@ class C .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_CollectionExpressionToExplicit_ImplicitStyle() { await VerifyDiagnosticAndFixAsync(""" @@ -1727,7 +1727,7 @@ void M(List items) """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_CollectionExpressionToExplicit_ImplicitWhenObviousStyle() { await VerifyDiagnosticAndFixAsync(""" @@ -1755,7 +1755,7 @@ void M(List items) """, options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_ImplicitWhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_CollectionExpressionToImplicit_ImplicitStyle() { await VerifyDiagnosticAndFixAsync(""" @@ -1781,7 +1781,7 @@ void M(List items) .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_CollectionExpressionToImplicit_ImplicitWhenObviousStyle() { await VerifyDiagnosticAndFixAsync(""" @@ -1800,7 +1800,7 @@ class C .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_ExplicitWithParameters() { await VerifyDiagnosticAndFixAsync(""" @@ -1831,7 +1831,7 @@ C M() .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task Test_CollectionExpressionToExplicit() { await VerifyDiagnosticAndFixAsync(@" @@ -1855,7 +1855,7 @@ void M(List x) ", options: Options.AddConfigOption(ConfigOptionKeys.ObjectCreationTypeStyle, ConfigOptionValues.ObjectCreationTypeStyle_Explicit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task TestNoDiagnostic_ObjectInitializerWithPropertySet() { await VerifyNoDiagnosticAsync(""" @@ -1882,7 +1882,7 @@ static C M() .AddConfigOption(ConfigOptionKeys.UseCollectionExpression, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseImplicitOrExplicitObjectCreation)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseImplicitOrExplicitObjectCreation)] public async Task TestNoDiagnostic_Array() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1251RemoveUnnecessaryBracesTests.cs b/src/Tests/Analyzers.Tests/RCS1251RemoveUnnecessaryBracesTests.cs index d5a6de11cb..9744559c31 100644 --- a/src/Tests/Analyzers.Tests/RCS1251RemoveUnnecessaryBracesTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1251RemoveUnnecessaryBracesTests.cs @@ -12,7 +12,7 @@ public class RCS1251RemoveUnnecessaryBracesTests : AbstractCSharpDiagnosticVerif { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveUnnecessaryBraces; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_Record() { await VerifyDiagnosticAndFixAsync(@" @@ -34,7 +34,7 @@ namespace System.Runtime.CompilerServices { internal static class IsExternalInit "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_RecordStruct() { await VerifyDiagnosticAndFixAsync(@" @@ -56,7 +56,7 @@ namespace System.Runtime.CompilerServices { internal static class IsExternalInit "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_Class() { await VerifyDiagnosticAndFixAsync(@" @@ -74,7 +74,7 @@ class C; "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_Class_WithBaseClass() { await VerifyDiagnosticAndFixAsync(@" @@ -92,7 +92,7 @@ class C : object; "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_Class_WhereConstraint() { await VerifyDiagnosticAndFixAsync(@" @@ -110,7 +110,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_Struct() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ struct C; "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_Interface() { await VerifyDiagnosticAndFixAsync(@" @@ -146,7 +146,7 @@ interface C; "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_Class_CSharp11() { await VerifyNoDiagnosticAsync(@" @@ -159,7 +159,7 @@ class C ", options: WellKnownCSharpTestOptions.Default_CSharp11); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task Test_NoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -172,7 +172,7 @@ record struct R "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveUnnecessaryBraces)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveUnnecessaryBraces)] public async Task TestNoDiagnostic_Class_WithParameterList() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1252NormalizeUsageOfInfiniteLoopTests.cs b/src/Tests/Analyzers.Tests/RCS1252NormalizeUsageOfInfiniteLoopTests.cs index 514aac14ef..a2d72fec93 100644 --- a/src/Tests/Analyzers.Tests/RCS1252NormalizeUsageOfInfiniteLoopTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1252NormalizeUsageOfInfiniteLoopTests.cs @@ -12,7 +12,7 @@ public class RCS1252NormalizeUsageOfInfiniteLoopTests : AbstractCSharpDiagnostic { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.NormalizeUsageOfInfiniteLoop; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task Test_ForToWhile() { await VerifyDiagnosticAndFixAsync(@" @@ -40,7 +40,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.InfiniteLoopStyle, ConfigOptionValues.InfiniteLoopStyle_While)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task Test_WhileToFor() { await VerifyDiagnosticAndFixAsync(@" @@ -68,7 +68,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.InfiniteLoopStyle, ConfigOptionValues.InfiniteLoopStyle_For)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task Test_DoToWhile() { await VerifyDiagnosticAndFixAsync(@" @@ -97,7 +97,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.InfiniteLoopStyle, ConfigOptionValues.InfiniteLoopStyle_While)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task Test_DoToFor() { await VerifyDiagnosticAndFixAsync(@" @@ -126,7 +126,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.InfiniteLoopStyle, ConfigOptionValues.InfiniteLoopStyle_For)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task TestNoDiagnostic_ForToWhile() { await VerifyNoDiagnosticAsync(@" @@ -143,7 +143,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.InfiniteLoopStyle, ConfigOptionValues.InfiniteLoopStyle_For)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task TestNoDiagnostic_ForToWhile2() { await VerifyNoDiagnosticAsync(@" @@ -160,7 +160,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task TestNoDiagnostic_WhileToFor() { await VerifyNoDiagnosticAsync(@" @@ -177,7 +177,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.InfiniteLoopStyle, ConfigOptionValues.InfiniteLoopStyle_While)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task TestNoDiagnostic_WhileToFor2() { await VerifyNoDiagnosticAsync(@" @@ -194,7 +194,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeUsageOfInfiniteLoop)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeUsageOfInfiniteLoop)] public async Task TestNoDiagnostic_DoToWhile() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1253FormatDocumentationCommentSummaryTests.cs b/src/Tests/Analyzers.Tests/RCS1253FormatDocumentationCommentSummaryTests.cs index fc31e20b1e..29cbdedcc7 100644 --- a/src/Tests/Analyzers.Tests/RCS1253FormatDocumentationCommentSummaryTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1253FormatDocumentationCommentSummaryTests.cs @@ -12,7 +12,7 @@ public class RCS1253FormatDocumentationCommentSummaryTests : AbstractCSharpDiagn { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FormatDocumentationCommentSummary; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task Test_ToMultiLine() { await VerifyDiagnosticAndFixAsync(@" @@ -30,7 +30,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.DocCommentSummaryStyle, ConfigOptionValues.DocCommentSummaryStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task Test_EmptySummary_ToMultiLine() { await VerifyDiagnosticAndFixAsync(@" @@ -48,7 +48,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.DocCommentSummaryStyle, ConfigOptionValues.DocCommentSummaryStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task Test_Tab_ToMultiLine() { await VerifyDiagnosticAndFixAsync(@" @@ -72,7 +72,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.DocCommentSummaryStyle, ConfigOptionValues.DocCommentSummaryStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task Test_ToSingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -90,7 +90,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.DocCommentSummaryStyle, ConfigOptionValues.DocCommentSummaryStyle_SingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task Test_EmptySummary_ToSingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -108,7 +108,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.DocCommentSummaryStyle, ConfigOptionValues.DocCommentSummaryStyle_SingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task Test_Tab_ToSingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -132,7 +132,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.DocCommentSummaryStyle, ConfigOptionValues.DocCommentSummaryStyle_SingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task TestNoDiagnostic_MultiLine() { await VerifyNoDiagnosticAsync(@" @@ -145,7 +145,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task TestNoDiagnostic_EmptySummary_ToMultiLine() { await VerifyNoDiagnosticAsync(@" @@ -157,7 +157,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task TestNoDiagnostic_SingleLine() { await VerifyNoDiagnosticAsync(@" @@ -168,7 +168,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatDocumentationCommentSummary)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.FormatDocumentationCommentSummary)] public async Task TestNoDiagnostic_ToSingleLine() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1254NormalizeFormatOfEnumFlagValueTests.cs b/src/Tests/Analyzers.Tests/RCS1254NormalizeFormatOfEnumFlagValueTests.cs index 6b09ffe15a..1c0e12e04e 100644 --- a/src/Tests/Analyzers.Tests/RCS1254NormalizeFormatOfEnumFlagValueTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1254NormalizeFormatOfEnumFlagValueTests.cs @@ -12,7 +12,7 @@ public class RCS1254NormalizeFormatOfEnumFlagValueTests : AbstractCSharpDiagnost { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.NormalizeFormatOfEnumFlagValue; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task Test_DecimalToShift() { await VerifyDiagnosticAndFixAsync(@" @@ -42,7 +42,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.EnumFlagValueStyle, ConfigOptionValues.EnumFlagValueStyle_ShiftOperator)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task Test_ShiftToDecimal() { await VerifyDiagnosticAndFixAsync(@" @@ -72,7 +72,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.EnumFlagValueStyle, ConfigOptionValues.EnumFlagValueStyle_DecimalNumber)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task Test_HexadecimalToShift() { await VerifyDiagnosticAndFixAsync(@" @@ -100,7 +100,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.EnumFlagValueStyle, ConfigOptionValues.EnumFlagValueStyle_ShiftOperator)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task Test_HexadecimalToDecimal() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.EnumFlagValueStyle, ConfigOptionValues.EnumFlagValueStyle_DecimalNumber)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task Test_BinaryToShift() { await VerifyDiagnosticAndFixAsync(@" @@ -156,7 +156,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.EnumFlagValueStyle, ConfigOptionValues.EnumFlagValueStyle_ShiftOperator)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task Test_BinaryToDecimal() { await VerifyDiagnosticAndFixAsync(@" @@ -184,7 +184,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.EnumFlagValueStyle, ConfigOptionValues.EnumFlagValueStyle_DecimalNumber)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task TestNoDiagnostic_WithoutFlags() { await VerifyNoDiagnosticAsync(@" @@ -198,7 +198,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.EnumFlagValueStyle, ConfigOptionValues.EnumFlagValueStyle_ShiftOperator)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task TestNoDiagnostic_BitShift() { await VerifyNoDiagnosticAsync(@" @@ -214,7 +214,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeFormatOfEnumFlagValue)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.NormalizeFormatOfEnumFlagValue)] public async Task TestNoDiagnostic_CombinedValue() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1255SimplifyArgumentNullCheckTests.cs b/src/Tests/Analyzers.Tests/RCS1255SimplifyArgumentNullCheckTests.cs index b0f33caa67..ed332544e2 100644 --- a/src/Tests/Analyzers.Tests/RCS1255SimplifyArgumentNullCheckTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1255SimplifyArgumentNullCheckTests.cs @@ -12,7 +12,7 @@ public class RCS1255SimplifyArgumentNullCheckTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyArgumentNullCheck; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyArgumentNullCheck)] public async Task Test_IfStatement_Block_Nameof() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyArgumentNullCheck)] public async Task Test_IfStatement_Block_Literal() { await VerifyDiagnosticAndFixAsync(""" @@ -70,7 +70,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyArgumentNullCheck)] public async Task Test_IfStatement_Embedded_Nameof() { await VerifyDiagnosticAndFixAsync(@" @@ -97,7 +97,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyArgumentNullCheck)] public async Task TestNoDiagnostic_TwoArguments() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1256InvalidArgumentNullCheckTests.cs b/src/Tests/Analyzers.Tests/RCS1256InvalidArgumentNullCheckTests.cs index 37a7c2d734..200c39811d 100644 --- a/src/Tests/Analyzers.Tests/RCS1256InvalidArgumentNullCheckTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1256InvalidArgumentNullCheckTests.cs @@ -12,7 +12,7 @@ public class RCS1256InvalidArgumentNullCheckTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.InvalidArgumentNullCheck; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidArgumentNullCheck)] public async Task Test_Method_OptionalParameter() { await VerifyDiagnosticAndFixAsync(@" @@ -44,7 +44,7 @@ void M(string p = null) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidArgumentNullCheck)] public async Task Test_Method_NullableReferenceTypeParameter() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ void M(string? p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidArgumentNullCheck)] public async Task Test_Method_OptionalParameter_ThrowIfNull() { await VerifyDiagnosticAndFixAsync(@" @@ -109,7 +109,7 @@ void M(string p = null) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidArgumentNullCheck)] public async Task Test_Method_NullableReferenceTypeParameter_ThrowIfNull() { await VerifyDiagnosticAndFixAsync(@" @@ -142,7 +142,7 @@ void M(string? p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidArgumentNullCheck)] public async Task Test_Constructor_OptionalParameter() { await VerifyDiagnosticAndFixAsync(@" @@ -174,7 +174,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidArgumentNullCheck)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidArgumentNullCheck)] public async Task Test_Constructor_NullableReferenceTypeParameter() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1257UseEnumFieldExplicitlyTests.cs b/src/Tests/Analyzers.Tests/RCS1257UseEnumFieldExplicitlyTests.cs index 1402fc5138..ee0a901257 100644 --- a/src/Tests/Analyzers.Tests/RCS1257UseEnumFieldExplicitlyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1257UseEnumFieldExplicitlyTests.cs @@ -12,7 +12,7 @@ public class RCS1257UseEnumFieldExplicitlyTests : AbstractCSharpDiagnosticVerifi { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseEnumFieldExplicitly; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEnumFieldExplicitly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEnumFieldExplicitly)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEnumFieldExplicitly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEnumFieldExplicitly)] public async Task Test_Flags() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEnumFieldExplicitly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEnumFieldExplicitly)] public async Task Test_Flags_SByte() { await VerifyDiagnosticAndFixAsync(@" @@ -96,7 +96,7 @@ enum TestEnum : sbyte "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEnumFieldExplicitly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEnumFieldExplicitly)] public async Task TestNoDiagnostic_UndefinedValue() { await VerifyNoDiagnosticAsync(@" @@ -122,7 +122,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseEnumFieldExplicitly)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseEnumFieldExplicitly)] public async Task TestNoDiagnostic_ZeroNotDefined() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1258UnnecessaryEnumFlagTests.cs b/src/Tests/Analyzers.Tests/RCS1258UnnecessaryEnumFlagTests.cs index 3c9b5c8dad..c212a37226 100644 --- a/src/Tests/Analyzers.Tests/RCS1258UnnecessaryEnumFlagTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1258UnnecessaryEnumFlagTests.cs @@ -12,7 +12,7 @@ public class RCS1258UnnecessaryEnumFlagTests : AbstractCSharpDiagnosticVerifier< { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryEnumFlag; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryEnumFlag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryEnumFlag)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryEnumFlag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryEnumFlag)] public async Task Test2() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryEnumFlag)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryEnumFlag)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1259RemoveEmptySyntaxTests.cs b/src/Tests/Analyzers.Tests/RCS1259RemoveEmptySyntaxTests.cs index 01a135dd05..b1a8b934a6 100644 --- a/src/Tests/Analyzers.Tests/RCS1259RemoveEmptySyntaxTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1259RemoveEmptySyntaxTests.cs @@ -12,7 +12,7 @@ public class RCS1259RemoveEmptySyntaxTests : AbstractCSharpDiagnosticVerifier(Expression> e) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptySyntax)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptySyntax)] public async Task Test_Namespace() { await VerifyDiagnosticAndFixAsync(@" @@ -423,7 +423,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptySyntax)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptySyntax)] public async Task Test_FileScopedNamespace() { await VerifyDiagnosticAndFixAsync(@" @@ -431,7 +431,7 @@ await VerifyDiagnosticAndFixAsync(@" ", ""); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptySyntax)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptySyntax)] public async Task Test_RegionDirective() { await VerifyDiagnosticAndFixAsync(@" @@ -453,7 +453,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptySyntax)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptySyntax)] public async Task Test_EmptyStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -483,7 +483,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptySyntax)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptySyntax)] public async Task TestNoDiagnostic_EmptyStatement() { await VerifyNoDiagnosticAsync(@" @@ -501,7 +501,7 @@ void M(bool p) ", options: Options.AddAllowedCompilerDiagnosticId("CS0642")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveEmptySyntax)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveEmptySyntax)] public async Task TestNoDiagnostic_FileScopedNamespaceDeclaration() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1260AddOrRemoveTrailingCommaTests.cs b/src/Tests/Analyzers.Tests/RCS1260AddOrRemoveTrailingCommaTests.cs index fc527cb0c6..b29c33eb98 100644 --- a/src/Tests/Analyzers.Tests/RCS1260AddOrRemoveTrailingCommaTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1260AddOrRemoveTrailingCommaTests.cs @@ -12,7 +12,7 @@ public class RCS1260AddOrRemoveTrailingCommaTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddOrRemoveTrailingComma; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_EnumDeclaration_Include() { await VerifyDiagnosticAndFixAsync(@" @@ -30,7 +30,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_EnumDeclaration_Omit() { await VerifyDiagnosticAndFixAsync(@" @@ -48,7 +48,7 @@ enum Foo ", options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineEnumDeclaration_Include() { await VerifyDiagnosticAndFixAsync(@" @@ -58,7 +58,7 @@ enum Foo { A, B, } ", options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineEnumDeclaration_Omit() { await VerifyDiagnosticAndFixAsync(@" @@ -68,7 +68,7 @@ enum Foo { A, B } ", options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineEnumDeclaration_OmitWhenSingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -78,7 +78,7 @@ enum Foo { A, B } ", options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_OmitWhenSingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_ArrayInitializer_Include() { await VerifyDiagnosticAndFixAsync(""" @@ -108,7 +108,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_ArrayInitializer_Omit() { await VerifyDiagnosticAndFixAsync(""" @@ -138,7 +138,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineArrayInitializer_Include() { await VerifyDiagnosticAndFixAsync(""" @@ -160,7 +160,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineArrayInitializer_Omit() { await VerifyDiagnosticAndFixAsync(""" @@ -182,7 +182,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineArrayInitializer_OmitWhenSingleLine() { await VerifyDiagnosticAndFixAsync(""" @@ -204,7 +204,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_OmitWhenSingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_AnonymousObjectCreationExpression_Include() { await VerifyDiagnosticAndFixAsync(""" @@ -234,7 +234,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_AnonymousObjectCreationExpression_Omit() { await VerifyDiagnosticAndFixAsync(""" @@ -264,7 +264,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineAnonymousObjectCreationExpression_Include() { await VerifyDiagnosticAndFixAsync(""" @@ -286,7 +286,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineAnonymousObjectCreationExpression_Omit() { await VerifyDiagnosticAndFixAsync(""" @@ -308,7 +308,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.TrailingCommaStyle, ConfigOptionValues.TrailingCommaStyle_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveTrailingComma)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.AddOrRemoveTrailingComma)] public async Task Test_SingleLineAnonymousObjectCreationExpression_OmitWhenSingleLine() { await VerifyDiagnosticAndFixAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1261DisposeResourceAsynchronouslyTests.cs b/src/Tests/Analyzers.Tests/RCS1261DisposeResourceAsynchronouslyTests.cs index 36ba8ff8f5..31dca953ed 100644 --- a/src/Tests/Analyzers.Tests/RCS1261DisposeResourceAsynchronouslyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1261DisposeResourceAsynchronouslyTests.cs @@ -12,7 +12,7 @@ public class RCS1261DisposeResourceAsynchronouslyTests : AbstractCSharpDiagnosti { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.DisposeResourceAsynchronously; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_Method_LocalStatement_WithAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -60,7 +60,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_Method_LocalStatement_WithoutAsync_Task() { await VerifyDiagnosticAndFixAsync(@" @@ -108,7 +108,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_Method_LocalStatement_WithoutAsync_TaskOfT() { await VerifyDiagnosticAndFixAsync(""" @@ -156,7 +156,7 @@ internal class Disposable : IDisposable, IAsyncDisposable """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_LocalFunction_LocalStatement_WithAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -206,7 +206,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_LocalFunction_LocalStatement_WithoutAsync_Task() { await VerifyDiagnosticAndFixAsync(@" @@ -260,7 +260,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_LocalFunction_LocalStatement_WithoutAsync_TaskOfT() { await VerifyDiagnosticAndFixAsync(""" @@ -314,7 +314,7 @@ internal class Disposable : IDisposable, IAsyncDisposable """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_Method_UsingStatement_WithAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -362,7 +362,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_Method_UsingStatement_WithoutAsync_Task() { await VerifyDiagnosticAndFixAsync(@" @@ -410,7 +410,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_Method_UsingStatement_WithoutAsync_TaskOfT() { await VerifyDiagnosticAndFixAsync(""" @@ -458,7 +458,7 @@ internal class Disposable : IDisposable, IAsyncDisposable """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_LocalFunction_UsingStatement_WithAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -508,7 +508,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_LocalFunction_UsingStatement_WithoutAsync_Task() { await VerifyDiagnosticAndFixAsync(@" @@ -562,7 +562,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_LocalFunction_UsingStatement_WithoutAsync_TaskOfT() { await VerifyDiagnosticAndFixAsync(""" @@ -616,7 +616,7 @@ internal class Disposable : IDisposable, IAsyncDisposable """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_SimpleLambda_LocalStatement_WithAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -666,7 +666,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_SimpleLambda_LocalStatement_WithoutAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -718,7 +718,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_ParenthesizedLambda_LocalStatement_WithAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -768,7 +768,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_ParenthesizedLambda_LocalStatement_WithoutAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -820,7 +820,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_AnonymousMethod_LocalStatement_WithAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -870,7 +870,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_AnonymousMethod_LocalStatement_WithoutAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -922,7 +922,7 @@ internal class Disposable : IDisposable, IAsyncDisposable "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_DuckTyped_TaskType_WithAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -1020,7 +1020,7 @@ public void OnCompleted(Action continuation) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task Test_DuckTyped_TaskType_WithoutAsync() { await VerifyDiagnosticAndFixAsync(@" @@ -1118,7 +1118,7 @@ public void OnCompleted(Action continuation) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task TestNoDiagnostic_LockStatement() { await VerifyNoDiagnosticAsync(""" @@ -1142,7 +1142,7 @@ async Task Foo() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task TestNoDiagnostic_DuckTyped_NotTaskType() { await VerifyNoDiagnosticAsync(@" @@ -1194,7 +1194,7 @@ public void OnCompleted(Action continuation) { } "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.DisposeResourceAsynchronously)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.DisposeResourceAsynchronously)] public async Task TestNoDiagnostic_NonAwaitable_TaskType() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1262UnnecessaryRawStringLiteralTests.cs b/src/Tests/Analyzers.Tests/RCS1262UnnecessaryRawStringLiteralTests.cs index 346cccf8b0..0d01bde065 100644 --- a/src/Tests/Analyzers.Tests/RCS1262UnnecessaryRawStringLiteralTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1262UnnecessaryRawStringLiteralTests.cs @@ -13,7 +13,7 @@ public class RCS1262UnnecessaryRawStringLiteralTests : AbstractCSharpDiagnosticV { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryRawStringLiteral; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryRawStringLiteral)] public async Task Test_SingleLineRawStringLiteral() { await VerifyDiagnosticAndFixAsync("""" @@ -35,7 +35,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryRawStringLiteral)] public async Task Test_InterpolatedSingleLineRawString() { await VerifyDiagnosticAndFixAsync("""" @@ -59,7 +59,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryRawStringLiteral)] public async Task Test_InterpolatedString_MultipleDollarSigns() { await VerifyDiagnosticAndFixAsync("""" @@ -85,7 +85,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryRawStringLiteral)] public async Task TestNoDiagnostic_ContainsQuote() { await VerifyNoDiagnosticAsync("""" @@ -99,7 +99,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryRawStringLiteral)] public async Task TestNoDiagnostic_ContainsEscape() { await VerifyNoDiagnosticAsync("""" @@ -113,7 +113,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryRawStringLiteral)] public async Task TestNoDiagnostic_InterpolatedString_ContainsQuote() { await VerifyNoDiagnosticAsync("""" @@ -127,7 +127,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryRawStringLiteral)] public async Task TestNoDiagnostic_InterpolatedString_ContainsEscape() { await VerifyNoDiagnosticAsync("""" @@ -141,7 +141,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UnnecessaryRawStringLiteral)] public async Task TestNoDiagnostic_MultipleDollarSigns() { await VerifyNoDiagnosticAsync("""" diff --git a/src/Tests/Analyzers.Tests/RCS1263InvalidReferenceInDocumentationCommentTests.cs b/src/Tests/Analyzers.Tests/RCS1263InvalidReferenceInDocumentationCommentTests.cs index 8d980db15c..52451e2a7f 100644 --- a/src/Tests/Analyzers.Tests/RCS1263InvalidReferenceInDocumentationCommentTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1263InvalidReferenceInDocumentationCommentTests.cs @@ -12,7 +12,7 @@ public class RCS1263InvalidReferenceInDocumentationCommentTests : AbstractCSharp { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.InvalidReferenceInDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task Test_ParamElement() { await VerifyDiagnosticAndFixAsync(""" @@ -31,7 +31,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task Test_ParamElement2() { await VerifyDiagnosticAndFixAsync(""" @@ -50,7 +50,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task Test_ParamElement_Empty() { await VerifyDiagnosticAndFixAsync(""" @@ -69,7 +69,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task Test_TypeParamElement() { await VerifyDiagnosticAndFixAsync(""" @@ -88,7 +88,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task Test_TypeParamElement2() { await VerifyDiagnosticAndFixAsync(""" @@ -107,7 +107,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task Test_TypeParamElement_Empty() { await VerifyDiagnosticAndFixAsync(""" @@ -126,7 +126,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task TestNoDiagnostic_ParamElement() { await VerifyNoDiagnosticAsync(""" @@ -140,7 +140,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task TestNoDiagnostic_TypeParamElement() { await VerifyNoDiagnosticAsync(""" @@ -154,7 +154,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task TestNoDiagnostic_Record() { await VerifyNoDiagnosticAsync(""" @@ -166,7 +166,7 @@ public record Foo(string Bar); """, options: Options.AddAllowedCompilerDiagnosticId("CS0518")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task TestNoDiagnostic_RecordStruct() { await VerifyNoDiagnosticAsync(""" @@ -178,7 +178,7 @@ public record struct Foo(string Bar); """, options: Options.AddAllowedCompilerDiagnosticId("CS0518")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task TestNoDiagnostic_ClassPrimaryConstructor() { await VerifyNoDiagnosticAsync(""" @@ -193,7 +193,7 @@ public class Foo(string value) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.InvalidReferenceInDocumentationComment)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.InvalidReferenceInDocumentationComment)] public async Task TestNoDiagnostic_StructPrimaryConstructor() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests.cs b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests.cs index 9750a6d1ad..214aad0ce9 100644 --- a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests.cs @@ -12,7 +12,7 @@ public class RCS1264UseVarOrExplicitTypeTests : AbstractCSharpDiagnosticVerifier { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseVarOrExplicitType; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ object M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression_Var() { await VerifyDiagnosticAndFixAsync(@" @@ -90,7 +90,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_DiscardDesignation() { await VerifyDiagnosticAndFixAsync(""" @@ -116,7 +116,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TryParse_GenericType() { await VerifyDiagnosticAndFixAsync(""" @@ -156,7 +156,7 @@ bool TryParse(string? s, out T t) """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ForEach_DeclarationExpression() { await VerifyNoDiagnosticAsync(@" @@ -176,7 +176,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ParseMethod() { await VerifyNoDiagnosticAsync(@" @@ -192,7 +192,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_SpanStackAlloc() { await VerifyNoDiagnosticAsync(@" @@ -209,7 +209,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_DefaultLiteralWithSuppressNullableWarning() { await VerifyNoDiagnosticAsync(@" @@ -225,7 +225,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ImplicitObjectCreationExpression() { await VerifyNoDiagnosticAsync(@" @@ -241,7 +241,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_NullableReferenceType() { await VerifyNoDiagnosticAsync(@" @@ -260,7 +260,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_InferredType_Invocation_IdentifierName() { await VerifyNoDiagnosticAsync(""" @@ -283,7 +283,7 @@ bool TryParse(string? s, out T t) """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_InferredType_Invocation_MemberAccessExpression() { await VerifyNoDiagnosticAsync(""" @@ -307,7 +307,7 @@ static bool TryParse(string? s, out T t) """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_FixedStatement() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests2.cs b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests2.cs index fbd34abda8..9ae23b1aae 100644 --- a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests2.cs +++ b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests2.cs @@ -12,7 +12,7 @@ public class RCS1264UseVarOrExplicitTypeTests2 : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseVarOrExplicitType; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_Tuple_DeclarationExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -60,7 +60,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -82,7 +82,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression_AllVar() { await VerifyDiagnosticAndFixAsync(@" @@ -104,7 +104,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_ParseMethod() { await VerifyDiagnosticAndFixAsync(@" @@ -130,7 +130,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_NestedTuple() { await VerifyDiagnosticAndFixAsync(@" @@ -162,7 +162,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ForEach_DeclarationExpression() { await VerifyNoDiagnosticAsync(@" @@ -182,7 +182,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ForEach_TupleExpression() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests3.cs b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests3.cs index d2accffb91..6889c5a8e4 100644 --- a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests3.cs +++ b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests3.cs @@ -12,7 +12,7 @@ public class RCS1264UseVarOrExplicitTypeTests3 : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseVarOrExplicitType; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_ObjectCreation() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_DefaultExpression_TupleExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -60,7 +60,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_DefaultExpression_TupleExpression_Var() { await VerifyDiagnosticAndFixAsync(@" @@ -82,7 +82,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_ImplicitArrayCreation() { await VerifyDiagnosticAndFixAsync(""" @@ -104,7 +104,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_ParseMethod() { await VerifyDiagnosticAndFixAsync(@" @@ -130,7 +130,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_NullableAnnotation() { await VerifyDiagnosticAndFixAsync(@" @@ -166,7 +166,7 @@ void M(object p) ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression_NullableAnnotation() { await VerifyDiagnosticAndFixAsync(@" @@ -200,7 +200,7 @@ void M(object p) ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_DeclarationExpression_OutParameter() { await VerifyDiagnosticAndFixAsync(@" @@ -244,7 +244,7 @@ public void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(""" @@ -268,7 +268,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ForEach_DeclarationExpression() { await VerifyNoDiagnosticAsync(@" @@ -288,7 +288,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ForEach_TupleExpression() { await VerifyNoDiagnosticAsync(@" @@ -308,7 +308,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_DiscardDesignation() { await VerifyNoDiagnosticAsync(""" @@ -324,7 +324,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ParseMethod() { await VerifyNoDiagnosticAsync(""" @@ -340,7 +340,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ParseMethod2() { await VerifyNoDiagnosticAsync(""" @@ -356,7 +356,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_SpanWithStringLiteral() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests4.cs b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests4.cs index c3df9b3e08..43eea56b50 100644 --- a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests4.cs +++ b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests4.cs @@ -12,7 +12,7 @@ public class RCS1264UseVarOrExplicitTypeTests4 : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseVarOrExplicitType; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_LocalVariable() { await VerifyDiagnosticAndFixAsync(""" @@ -36,7 +36,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_DeclarationExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_Tuple() { await VerifyDiagnosticAndFixAsync(@" @@ -96,7 +96,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_Parameter_NullableReferenceType() { await VerifyDiagnosticAndFixAsync(@" @@ -120,7 +120,7 @@ void M(string? p) ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_Parameter_NullableReferenceType_Disable() { await VerifyDiagnosticAndFixAsync(@" @@ -149,7 +149,7 @@ void M(string? p) .AddAllowedCompilerDiagnosticId("CS8632")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_Tuple_DeclarationExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -175,7 +175,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -201,7 +201,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression_AllVar() { await VerifyDiagnosticAndFixAsync(@" @@ -227,7 +227,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_DiscardDesignation() { await VerifyDiagnosticAndFixAsync(""" @@ -253,7 +253,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_Func_Lambda() { await VerifyDiagnosticAndFixAsync(@" @@ -282,7 +282,7 @@ void M() .AddAllowedCompilerDiagnosticId("CS8603")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_Func_Lambda_Nullable() { await VerifyDiagnosticAndFixAsync(@" @@ -315,7 +315,7 @@ void M() .AddAllowedCompilerDiagnosticId("CS8603")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -336,7 +336,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ObjectCreation() { await VerifyNoDiagnosticAsync(@" @@ -352,7 +352,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ForEach() { await VerifyNoDiagnosticAsync(@" @@ -372,7 +372,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_ParseMethod() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests5.cs b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests5.cs index 186c5a1dd4..916b5ef3a5 100644 --- a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests5.cs +++ b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests5.cs @@ -12,7 +12,7 @@ public class RCS1264UseVarOrExplicitTypeTests5 : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseVarOrExplicitType; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarInForEach)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitTypeInsteadOfVarInForEach)] public async Task TestDiagnostic() { await VerifyDiagnosticAndFixAsync(@" @@ -48,7 +48,7 @@ public void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarInForEach)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitTypeInsteadOfVarInForEach)] public async Task TestDiagnostic_Tuple_DeclarationExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -82,7 +82,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarInForEach)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitTypeInsteadOfVarInForEach)] public async Task TestDiagnostic_TupleExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -116,7 +116,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarInForEach)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitTypeInsteadOfVarInForEach)] public async Task TestDiagnostic_TupleExpression_AllVar() { await VerifyDiagnosticAndFixAsync(@" @@ -150,7 +150,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarInForEach)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitTypeInsteadOfVarInForEach)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -170,7 +170,7 @@ public void M() }", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarWhenTypeIsObvious)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitTypeInsteadOfVarWhenTypeIsObvious)] public async Task Test_TupleExpression_WithDiscardPredefinedType() { await VerifyDiagnosticAndFixAsync(@" @@ -206,7 +206,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_WhenTypeIsObvious)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseExplicitTypeInsteadOfVarWhenTypeIsObvious)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseExplicitTypeInsteadOfVarWhenTypeIsObvious)] public async Task Test_TupleExpression_WithDiscardNonPredefinedType() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests6.cs b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests6.cs index 88d916c230..abec71b36f 100644 --- a/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests6.cs +++ b/src/Tests/Analyzers.Tests/RCS1264UseVarOrExplicitTypeTests6.cs @@ -12,7 +12,7 @@ public class RCS1264UseVarOrExplicitTypeTests6 : AbstractCSharpDiagnosticVerifie { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseVarOrExplicitType; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression_Var() { await VerifyDiagnosticAndFixAsync(@" @@ -114,7 +114,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task Test_TupleExpression2() { await VerifyDiagnosticAndFixAsync(@" @@ -148,7 +148,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.UseVar, ConfigOptionValues.UseVar_Always)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseVarOrExplicitType)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseVarOrExplicitType)] public async Task TestNoDiagnostic_TupleExpression() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1265RemoveRedundantCatchBlockTests.cs b/src/Tests/Analyzers.Tests/RCS1265RemoveRedundantCatchBlockTests.cs index 7d5a34b4b3..03471f203f 100644 --- a/src/Tests/Analyzers.Tests/RCS1265RemoveRedundantCatchBlockTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1265RemoveRedundantCatchBlockTests.cs @@ -13,7 +13,7 @@ public class RCS1265RemoveRedundantCatchBlockTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveRedundantCatchBlock; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCatchBlock)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCatchBlock)] public async Task Test_TryCatchFinally() { await VerifyDiagnosticAndFixAsync(@" @@ -61,7 +61,7 @@ void DoSomething() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCatchBlock)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCatchBlock)] public async Task Test_TryMultipleCatches() { await VerifyDiagnosticAndFixAsync(@" @@ -113,7 +113,7 @@ void DoSomething() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCatchBlock)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCatchBlock)] public async Task Test_TryCatch() { await VerifyDiagnosticAndFixAsync(@" @@ -150,7 +150,7 @@ void DoSomething() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveRedundantCatchBlock)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveRedundantCatchBlock)] public async Task Test_NoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Analyzers.Tests/RCS1266UseRawStringLiteralTests.cs b/src/Tests/Analyzers.Tests/RCS1266UseRawStringLiteralTests.cs index 6469a878ba..b85e605d8a 100644 --- a/src/Tests/Analyzers.Tests/RCS1266UseRawStringLiteralTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1266UseRawStringLiteralTests.cs @@ -13,7 +13,7 @@ public class RCS1266UseRawStringLiteralTests : AbstractCSharpDiagnosticVerifier< { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseRawStringLiteral; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task Test_StringLiteral() { await VerifyDiagnosticAndFixAsync(""" @@ -41,7 +41,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task Test_InterpolatedString_DollarFirst() { await VerifyDiagnosticAndFixAsync(""" @@ -69,7 +69,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task Test_InterpolatedString_AtFirst() { await VerifyDiagnosticAndFixAsync(""" @@ -97,7 +97,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task Test_InterpolatedString_MoreQuotes() { await VerifyDiagnosticAndFixAsync(""""""""" @@ -125,7 +125,7 @@ void M() """"""); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task Test_InterpolatedString_ContainsBrace() { await VerifyDiagnosticAndFixAsync(""" @@ -153,7 +153,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task Test_InterpolatedString_ContainsBraces() { await VerifyDiagnosticAndFixAsync(""" @@ -181,7 +181,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task Test_LiteralExpression2() { await VerifyDiagnosticAndFixAsync("""" @@ -207,7 +207,7 @@ void M() """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task Test_StringLiteral_MoreQuotes() { await VerifyDiagnosticAndFixAsync(""""""" @@ -235,7 +235,7 @@ void M() """"""); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task TestNoDiagnostic_StringLiteral_NoQuotes() { await VerifyNoDiagnosticAsync(""" @@ -251,7 +251,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseRawStringLiteral)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseRawStringLiteral)] public async Task TestNoDiagnostic_InterpolatedString_NoQuotes() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1267UseStringInterpolationInsteadOfStringConcatTests.cs b/src/Tests/Analyzers.Tests/RCS1267UseStringInterpolationInsteadOfStringConcatTests.cs index 213d4245cb..20e1c9adcd 100644 --- a/src/Tests/Analyzers.Tests/RCS1267UseStringInterpolationInsteadOfStringConcatTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1267UseStringInterpolationInsteadOfStringConcatTests.cs @@ -12,7 +12,7 @@ public class RCS1267UseStringInterpolationInsteadOfStringConcatTests : AbstractC { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseStringInterpolationInsteadOfStringConcat; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task Test() { await VerifyDiagnosticAndFixAsync(""" @@ -39,7 +39,7 @@ void M() ); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task Test_Verbatim() { await VerifyDiagnosticAndFixAsync(""" @@ -66,7 +66,7 @@ void M() ); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task TestNoDiagnostic_SingleArgument() { await VerifyNoDiagnosticAsync(""" @@ -83,7 +83,7 @@ void M() ); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task TestNoDiagnostic_NoStringLiteral() { await VerifyNoDiagnosticAsync(""" @@ -100,7 +100,7 @@ void M() ); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task TestNoDiagnostic_ContainsInterpolatedString() { await VerifyNoDiagnosticAsync(""" @@ -117,7 +117,7 @@ void M() ); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task TestNoDiagnostic_ContainsVerbatimAndNonVerbatimLiterals() { await VerifyNoDiagnosticAsync(""" @@ -134,7 +134,7 @@ void M() ); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task TestNoDiagnostic_ContainsVerbatimAndNonVerbatimLiterals2() { await VerifyNoDiagnosticAsync(""" @@ -151,7 +151,7 @@ void M() ); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task TestNoDiagnostic_SpansOverMultipleLines() { await VerifyNoDiagnosticAsync(""" @@ -172,7 +172,7 @@ void M() ); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task TestNoDiagnostic_ContainsBraces() { await VerifyNoDiagnosticAsync(""" @@ -189,7 +189,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseStringInterpolationInsteadOfStringConcat)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.UseStringInterpolationInsteadOfStringConcat)] public async Task TestNoDiagnostic_LiteralExpressionsOnly() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Analyzers.Tests/RCS1268SimplifyNumericComparisonTests.cs b/src/Tests/Analyzers.Tests/RCS1268SimplifyNumericComparisonTests.cs index a3e316a244..eb575de614 100644 --- a/src/Tests/Analyzers.Tests/RCS1268SimplifyNumericComparisonTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1268SimplifyNumericComparisonTests.cs @@ -13,7 +13,7 @@ public class RCS1268SimplifyNumericComparisonTests : AbstractCSharpDiagnosticVer { public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SimplifyNumericComparison; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNumericComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNumericComparison)] public async Task Test_LeftSideSubtraction_EqualsZero() { await VerifyDiagnosticAndFixAsync(@" @@ -39,7 +39,7 @@ void M(int a, int b) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNumericComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNumericComparison)] public async Task Test_RightSideSubtraction_EqualsZero() { await VerifyDiagnosticAndFixAsync(@" @@ -65,7 +65,7 @@ void M(int a, int b) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNumericComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNumericComparison)] public async Task Test_LeftSideSubtraction_WithoutParenthesis_EqualsZero() { await VerifyDiagnosticAndFixAsync(@" @@ -91,7 +91,7 @@ void M(int a, int b) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNumericComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNumericComparison)] public async Task Test_LeftSideSubtraction_SubtractionGreaterThanZero() { await VerifyDiagnosticAndFixAsync(@" @@ -117,7 +117,7 @@ void M(int a, int b) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNumericComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNumericComparison)] public async Task Test_RightSideSubtraction_SubtractionSmallerThanZero() { await VerifyDiagnosticAndFixAsync(@" @@ -143,7 +143,7 @@ void M(int a, int b) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNumericComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNumericComparison)] public async Task TestSubtractionLessThanZero() { await VerifyDiagnosticAndFixAsync(@" @@ -169,7 +169,7 @@ void M(int a, int b) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNumericComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNumericComparison)] public async Task TestSubtractionGreaterThanOrEqualToZero() { await VerifyDiagnosticAndFixAsync(@" @@ -195,7 +195,7 @@ void M(int a, int b) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SimplifyNumericComparison)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.SimplifyNumericComparison)] public async Task TestSubtractionLessThanOrEqualToZero() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Analyzers.Tests/ROS002AnalyzerOptionIsObsoleteTests.cs b/src/Tests/Analyzers.Tests/ROS002AnalyzerOptionIsObsoleteTests.cs index 722dbfe99c..de96687c01 100644 --- a/src/Tests/Analyzers.Tests/ROS002AnalyzerOptionIsObsoleteTests.cs +++ b/src/Tests/Analyzers.Tests/ROS002AnalyzerOptionIsObsoleteTests.cs @@ -12,7 +12,7 @@ public class ROS0002AnalyzerOptionIsObsoleteTests : AbstractCSharpDiagnosticVeri { public override DiagnosticDescriptor Descriptor { get; } = CommonDiagnosticRules.AnalyzerOptionIsObsolete; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBracesFromIfElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveBracesFromIfElse)] public async Task Test() { await VerifyDiagnosticAsync(@" @@ -26,7 +26,7 @@ void M() .AddConfigOption(LegacyConfigOptions.ConvertMethodGroupToAnonymousFunction.Key, "true")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBracesFromIfElse)] + [Fact, Trait(Traits.Analyzer, DiagnosticIds.RemoveBracesFromIfElse)] public async Task Test2() { await VerifyDiagnosticAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9001UsePatternMatchingTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9001UsePatternMatchingTests.cs index 10a8246d13..0b3991e1e8 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9001UsePatternMatchingTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9001UsePatternMatchingTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9001UsePatternMatchingTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UsePatternMatching; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.UsePatternMatching; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_SwitchStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -75,7 +75,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_SwitchStatement_LocalDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -140,7 +140,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_IsKind() { await VerifyDiagnosticAndFixAsync(@" @@ -179,7 +179,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_IsKind_Conditional() { await VerifyDiagnosticAndFixAsync(@" @@ -218,7 +218,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_Kind() { await VerifyDiagnosticAndFixAsync(@" @@ -257,7 +257,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_Kind_Conditional() { await VerifyDiagnosticAndFixAsync(@" @@ -296,7 +296,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_NotIsKind() { await VerifyDiagnosticAndFixAsync(@" @@ -338,7 +338,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_NotIsKind_Embedded() { await VerifyDiagnosticAndFixAsync(@" @@ -376,7 +376,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_NotIsKind_Conditional() { await VerifyDiagnosticAndFixAsync(@" @@ -418,7 +418,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_NotKind() { await VerifyDiagnosticAndFixAsync(@" @@ -460,7 +460,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task Test_IfStatement_NotKind_Conditional() { await VerifyDiagnosticAndFixAsync(@" @@ -502,7 +502,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task TestNoDiagnostic_SwitchStatement_VariableIsReferenced() { await VerifyNoDiagnosticAsync(@" @@ -533,7 +533,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePatternMatching)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePatternMatching)] public async Task TestNoDiagnostic_IfStatement_SimpleMemberAccessExpression() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9002UsePropertySyntaxNodeSpanStartTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9002UsePropertySyntaxNodeSpanStartTests.cs index adaec134c6..f704283952 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9002UsePropertySyntaxNodeSpanStartTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9002UsePropertySyntaxNodeSpanStartTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9002UsePropertySyntaxNodeSpanStartTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UsePropertySyntaxNodeSpanStart; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.UsePropertySyntaxNodeSpanStart; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePropertySyntaxNodeSpanStart)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UsePropertySyntaxNodeSpanStart)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9003UnnecessaryConditionalAccessTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9003UnnecessaryConditionalAccessTests.cs index ec81a502c6..c8e3cc638a 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9003UnnecessaryConditionalAccessTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9003UnnecessaryConditionalAccessTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9003UnnecessaryConditionalAccessTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryConditionalAccess; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.UnnecessaryConditionalAccess; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryConditionalAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UnnecessaryConditionalAccess)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9004CallAnyInsteadOfAccessingCountTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9004CallAnyInsteadOfAccessingCountTests.cs index 1df987c698..301952982c 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9004CallAnyInsteadOfAccessingCountTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9004CallAnyInsteadOfAccessingCountTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9004CallAnyInsteadOfAccessingCountTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.CallAnyInsteadOfAccessingCount; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.CallAnyInsteadOfAccessingCount; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_SyntaxList_Equals() { await VerifyDiagnosticAndFixAsync(@" @@ -42,7 +42,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_SyntaxList_Equals2() { await VerifyDiagnosticAndFixAsync(@" @@ -72,7 +72,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_SyntaxList_NotEquals() { await VerifyDiagnosticAndFixAsync(@" @@ -102,7 +102,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_SyntaxList_GreaterThan() { await VerifyDiagnosticAndFixAsync(@" @@ -132,7 +132,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_SeparatedSyntaxList_GreaterThan() { await VerifyDiagnosticAndFixAsync(@" @@ -162,7 +162,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_SyntaxTokenList_GreaterThan() { await VerifyDiagnosticAndFixAsync(@" @@ -192,7 +192,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_SyntaxTriviaList_GreaterThan() { await VerifyDiagnosticAndFixAsync(@" @@ -222,7 +222,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_ChildSyntaxList_GreaterThan() { await VerifyDiagnosticAndFixAsync(@" @@ -252,7 +252,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task Test_SyntaxNodeOrTokenList_GreaterThan() { await VerifyDiagnosticAndFixAsync(@" @@ -282,7 +282,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task TestNoDiagnostic_LessThanExpression() { await VerifyNoDiagnosticAsync(@" @@ -300,7 +300,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task TestNoDiagnostic_NotNumericLiteralExpression() { await VerifyNoDiagnosticAsync(@" @@ -319,7 +319,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task TestNoDiagnostic_NotZeroNumericLiteralExpression() { await VerifyNoDiagnosticAsync(@" @@ -337,7 +337,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallAnyInsteadOfAccessingCount)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallAnyInsteadOfAccessingCount)] public async Task TestNoDiagnostic_NotSyntaxList() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9005UnnecessaryNullCheckTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9005UnnecessaryNullCheckTests.cs index e36595048f..44a0801404 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9005UnnecessaryNullCheckTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9005UnnecessaryNullCheckTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9005UnnecessaryNullCheckTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnnecessaryNullCheck; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.UnnecessaryNullCheck; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UnnecessaryNullCheck)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -44,7 +44,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnnecessaryNullCheck)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UnnecessaryNullCheck)] public async Task TestNoDiagnostic_ExpressionsAreNotEquivalent() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9006UseElementAccessTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9006UseElementAccessTests.cs index a6a9cfdb46..c0c9d6f3d5 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9006UseElementAccessTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9006UseElementAccessTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9006UseElementAccessTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseElementAccess; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.UseElementAccess; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UseElementAccess)] public async Task Test_SyntaxList_First() { await VerifyDiagnosticAndFixAsync(@" @@ -42,7 +42,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UseElementAccess)] public async Task Test_SyntaxList_First_Multiline() { await VerifyDiagnosticAndFixAsync(@" @@ -73,7 +73,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UseElementAccess)] public async Task Test_SyntaxTriviaList_ElementAt() { await VerifyDiagnosticAndFixAsync(@" @@ -103,7 +103,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_FirstWithPredicate() { await VerifyNoDiagnosticAsync(@" @@ -122,7 +122,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_NotSyntaxList() { await VerifyNoDiagnosticAsync(@" @@ -142,7 +142,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UseElementAccess)] public async Task TestNoDiagnostic_TrailingTrivia() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9007UseReturnValueTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9007UseReturnValueTests.cs index f8801f9ea9..cd7018e5e5 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9007UseReturnValueTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9007UseReturnValueTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9007UseReturnValueTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseReturnValue; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.UseReturnValue; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseReturnValue)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UseReturnValue)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9008CallLastInsteadOfUsingElementAccessTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9008CallLastInsteadOfUsingElementAccessTests.cs index 24e1a3fbb9..a4c7b7dcac 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9008CallLastInsteadOfUsingElementAccessTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9008CallLastInsteadOfUsingElementAccessTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9008CallLastInsteadOfUsingElementAccessTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.CallLastInsteadOfUsingElementAccess; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.CallLastInsteadOfUsingElementAccess; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess)] public async Task Test_SyntaxList() { await VerifyDiagnosticAndFixAsync(@" @@ -42,7 +42,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess)] public async Task Test_SeparatedSyntaxList() { await VerifyDiagnosticAndFixAsync(@" @@ -72,7 +72,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess)] public async Task Test_SyntaxTokenList() { await VerifyDiagnosticAndFixAsync(@" @@ -102,7 +102,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess)] public async Task Test_SyntaxTriviaList() { await VerifyDiagnosticAndFixAsync(@" @@ -132,7 +132,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess)] public async Task Test_ChildSyntaxList() { await VerifyDiagnosticAndFixAsync(@" @@ -162,7 +162,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess)] public async Task Test_SyntaxNodeOrTokenList() { await VerifyDiagnosticAndFixAsync(@" @@ -192,7 +192,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess)] public async Task TestNoDiagnostic_NotLastElement() { await VerifyNoDiagnosticAsync(@" @@ -210,7 +210,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.CallLastInsteadOfUsingElementAccess)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.CallLastInsteadOfUsingElementAccess)] public async Task TestNoDiagnostic_ExpressionsAreNotEquivalent() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9009UnknownLanguageNameTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9009UnknownLanguageNameTests.cs index 6c599b5606..2717581dfc 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9009UnknownLanguageNameTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9009UnknownLanguageNameTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9009UnknownLanguageNameTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UnknownLanguageName; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.UnknownLanguageName; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnknownLanguageName)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UnknownLanguageName)] public async Task Test_DiagnosticAnalyzer() { await VerifyDiagnosticAndFixAsync(""" @@ -31,10 +31,10 @@ abstract class C : DiagnosticAnalyzer abstract class C : DiagnosticAnalyzer { } -""", equivalenceKey: EquivalenceKey.Create(DiagnosticIdentifiers.UnknownLanguageName, "C#")); +""", equivalenceKey: EquivalenceKey.Create(CodeAnalysisDiagnosticIds.UnknownLanguageName, "C#")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnknownLanguageName)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UnknownLanguageName)] public async Task Test_DiagnosticAnalyzer_ParamArray() { await VerifyDiagnosticAndFixAsync(""" @@ -53,10 +53,10 @@ abstract class C : DiagnosticAnalyzer abstract class C : DiagnosticAnalyzer { } -""", equivalenceKey: EquivalenceKey.Create(DiagnosticIdentifiers.UnknownLanguageName, "C#")); +""", equivalenceKey: EquivalenceKey.Create(CodeAnalysisDiagnosticIds.UnknownLanguageName, "C#")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnknownLanguageName)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UnknownLanguageName)] public async Task Test_CodeFixProvider() { await VerifyDiagnosticAndFixAsync(""" @@ -75,10 +75,10 @@ abstract class C : CodeFixProvider abstract class C : CodeFixProvider { } -""", equivalenceKey: EquivalenceKey.Create(DiagnosticIdentifiers.UnknownLanguageName, "C#")); +""", equivalenceKey: EquivalenceKey.Create(CodeAnalysisDiagnosticIds.UnknownLanguageName, "C#")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnknownLanguageName)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UnknownLanguageName)] public async Task Test_CodeRefactoringProvider() { await VerifyDiagnosticAndFixAsync(""" @@ -97,10 +97,10 @@ abstract class C : CodeRefactoringProvider abstract class C : CodeRefactoringProvider { } -""", equivalenceKey: EquivalenceKey.Create(DiagnosticIdentifiers.UnknownLanguageName, "C#")); +""", equivalenceKey: EquivalenceKey.Create(CodeAnalysisDiagnosticIds.UnknownLanguageName, "C#")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UnknownLanguageName)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.UnknownLanguageName)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9010SpecifyExportCodeRefactoringProviderAttributeNameTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9010SpecifyExportCodeRefactoringProviderAttributeNameTests.cs index 5073aa7573..792ebb5caf 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9010SpecifyExportCodeRefactoringProviderAttributeNameTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9010SpecifyExportCodeRefactoringProviderAttributeNameTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9010SpecifyExportCodeRefactoringProviderAttributeNameTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SpecifyExportCodeRefactoringProviderAttributeName; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.SpecifyExportCodeRefactoringProviderAttributeName; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SpecifyExportCodeRefactoringProviderAttributeName)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.SpecifyExportCodeRefactoringProviderAttributeName)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9011SpecifyExportCodeFixProviderAttributeNameTests.cs b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9011SpecifyExportCodeFixProviderAttributeNameTests.cs index feaffd7fb9..9435cfa48e 100644 --- a/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9011SpecifyExportCodeFixProviderAttributeNameTests.cs +++ b/src/Tests/CodeAnalysis.Analyzers.Tests/RCS9011SpecifyExportCodeFixProviderAttributeNameTests.cs @@ -6,13 +6,13 @@ using Roslynator.Testing.CSharp; using Xunit; -namespace Roslynator.CSharp.Analysis.Tests; +namespace Roslynator.CodeAnalysis.CSharp.Tests; public class RCS9011SpecifyExportCodeFixProviderAttributeNameTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.SpecifyExportCodeFixProviderAttributeName; + public override DiagnosticDescriptor Descriptor { get; } = CodeAnalysisDiagnosticRules.SpecifyExportCodeFixProviderAttributeName; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.SpecifyExportCodeFixProviderAttributeName)] + [Fact, Trait(Traits.Analyzer, CodeAnalysisDiagnosticIds.SpecifyExportCodeFixProviderAttributeName)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0001AddBlankLineAfterEmbeddedStatementTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0001AddBlankLineAfterEmbeddedStatementTests.cs index 65fd0a5fb5..fee797c0c1 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0001AddBlankLineAfterEmbeddedStatementTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0001AddBlankLineAfterEmbeddedStatementTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0001AddBlankLineAfterEmbeddedStatementTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineAfterEmbeddedStatement; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineAfterEmbeddedStatement; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_If() { await VerifyDiagnosticAndFixAsync(@" @@ -43,7 +43,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_ElseIf() { await VerifyDiagnosticAndFixAsync(@" @@ -78,7 +78,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_Else() { await VerifyDiagnosticAndFixAsync(@" @@ -113,7 +113,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_ForEach() { await VerifyDiagnosticAndFixAsync(@" @@ -150,7 +150,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_ForEachVariable() { await VerifyDiagnosticAndFixAsync(@" @@ -187,7 +187,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_For() { await VerifyDiagnosticAndFixAsync(@" @@ -224,7 +224,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_Using() { await VerifyDiagnosticAndFixAsync(@" @@ -259,7 +259,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_While() { await VerifyDiagnosticAndFixAsync(@" @@ -290,7 +290,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_Lock() { await VerifyDiagnosticAndFixAsync(@" @@ -321,7 +321,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_Fixed() { await VerifyDiagnosticAndFixAsync(""" @@ -358,7 +358,7 @@ void M() """, options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task Test_Switch() { await VerifyDiagnosticAndFixAsync(@" @@ -399,7 +399,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task TestNoDiagnostic_EmbeddedStatement() { await VerifyNoDiagnosticAsync(""" @@ -435,7 +435,7 @@ void M() """, options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterEmbeddedStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterEmbeddedStatement)] public async Task TestNoDiagnostic_NoEmbeddedStatement() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0002AddBlankLineAfterRegionDirectiveTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0002AddBlankLineAfterRegionDirectiveTests.cs index e547088578..fee8fbe54c 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0002AddBlankLineAfterRegionDirectiveTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0002AddBlankLineAfterRegionDirectiveTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0002AddBlankLineAfterRegionDirectiveTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineAfterRegionDirective; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineAfterRegionDirective; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterRegionDirective)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -39,7 +39,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterRegionDirective)] public async Task Test_NoIndentation() { await VerifyDiagnosticAndFixAsync(@" @@ -66,7 +66,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterRegionDirective)] public async Task Test_Comment() { await VerifyDiagnosticAndFixAsync(@" @@ -95,7 +95,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterRegionDirective)] public async Task Test_DocumentationComment() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterRegionDirective)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -144,7 +144,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterRegionDirective)] public async Task TestNoDiagnostic_EmptyRegion() { await VerifyNoDiagnosticAsync(@" @@ -156,7 +156,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterRegionDirective)] public async Task TestNoDiagnostic_Comment() { await VerifyNoDiagnosticAsync(@" @@ -174,7 +174,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterRegionDirective)] public async Task TestNoDiagnostic_DocumentationComment() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0003AddBlankLineAfterUsingDirectiveListTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0003AddBlankLineAfterUsingDirectiveListTests.cs index 8e2678ba2b..4bb302705d 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0003AddBlankLineAfterUsingDirectiveListTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0003AddBlankLineAfterUsingDirectiveListTests.cs @@ -10,14 +10,14 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0003AddBlankLineAfterUsingDirectiveListTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineAfterUsingDirectiveList; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineAfterUsingDirectiveList; public override CSharpTestOptions Options { get { return base.Options.AddAllowedCompilerDiagnosticId("CS0430"); } } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task Test_CompilationUnit_Comment_After() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task Test_CompilationUnit_DocumentationComment_After() { await VerifyDiagnosticAndFixAsync(@" @@ -59,7 +59,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task Test_CompilationUnit_AssemblyAttribute_After() { await VerifyDiagnosticAndFixAsync(@" @@ -82,7 +82,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task Test_CompilationUnit_CommentAndAssemblyAttribute_After() { await VerifyDiagnosticAndFixAsync(@" @@ -105,7 +105,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task Test_CompilationUnit_NamespaceDeclaration_After() { await VerifyDiagnosticAndFixAsync(@" @@ -124,7 +124,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task Test_NamespaceDeclaration_Comment_After() { await VerifyDiagnosticAndFixAsync(@" @@ -151,7 +151,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task Test_NamespaceDeclaration_DocumentationComment_After() { await VerifyDiagnosticAndFixAsync(@" @@ -178,7 +178,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task Test_NamespaceDeclaration_ClassDeclaration_After() { await VerifyDiagnosticAndFixAsync(@" @@ -203,7 +203,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task TestNoDiagnostic_CompilationUnit_CommentAndEndRegionDirective_After() { await VerifyNoDiagnosticAsync(@" @@ -217,7 +217,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task TestNoDiagnostic_CompilationUnit_CommentAndPragmaDirective_After() { await VerifyNoDiagnosticAsync(@" @@ -231,7 +231,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task TestNoDiagnostic_NamespaceDeclaration_CommentAndEndRegionDirective_After() { await VerifyNoDiagnosticAsync(@" @@ -248,7 +248,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterUsingDirectiveList)] public async Task TestNoDiagnostic_NamespaceDeclaration_CommentAndPragmaDirective_After() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0005AddBlankLineBeforeEndRegionDirectiveTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0005AddBlankLineBeforeEndRegionDirectiveTests.cs index 4beba83d0b..a54869f192 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0005AddBlankLineBeforeEndRegionDirectiveTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0005AddBlankLineBeforeEndRegionDirectiveTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0005AddBlankLineBeforeEndRegionDirectiveTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBeforeEndRegionDirective; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBeforeEndRegionDirective; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -39,7 +39,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task Test_NoIndentation() { await VerifyDiagnosticAndFixAsync(@" @@ -66,7 +66,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task Test_Comment() { await VerifyDiagnosticAndFixAsync(@" @@ -97,7 +97,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task Test_DocumentationComment() { await VerifyDiagnosticAndFixAsync(@" @@ -130,7 +130,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -146,7 +146,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task TestNoDiagnostic_EmptyRegion() { await VerifyNoDiagnosticAsync(@" @@ -158,7 +158,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task TestNoDiagnostic_Comment() { await VerifyNoDiagnosticAsync(@" @@ -176,7 +176,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task TestNoDiagnostic_DocumentationComment() { await VerifyNoDiagnosticAsync(@" @@ -195,7 +195,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task TestNoDiagnostic_TwoEndRegions() { await VerifyNoDiagnosticAsync(@" @@ -214,7 +214,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task TestNoDiagnostic_EmptyRegions() { await VerifyNoDiagnosticAsync(@" @@ -228,7 +228,7 @@ await VerifyNoDiagnosticAsync(@" "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeEndRegionDirective)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeEndRegionDirective)] public async Task TestNoDiagnostic_PragmaWarningDirective() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0006AddEmptyLineBeforeUsingDirectiveListTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0006AddEmptyLineBeforeUsingDirectiveListTests.cs index c5de17c953..f73965d781 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0006AddEmptyLineBeforeUsingDirectiveListTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0006AddEmptyLineBeforeUsingDirectiveListTests.cs @@ -10,14 +10,14 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0006AddEmptyLineBeforeUsingDirectiveListTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBeforeUsingDirectiveList; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBeforeUsingDirectiveList; public override CSharpTestOptions Options { get { return base.Options.AddAllowedCompilerDiagnosticId("CS0430"); } } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task Test_Comment_Before() { await VerifyDiagnosticAndFixAsync(@"// x[| @@ -38,7 +38,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task Test_Comments_Before() { await VerifyDiagnosticAndFixAsync(@"// x @@ -55,7 +55,7 @@ class C; "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task Test_CommentAndExternAlias_Before() { await VerifyDiagnosticAndFixAsync(@" @@ -78,7 +78,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task Test_Comment_ExternAliasAndComment_Before() { await VerifyDiagnosticAndFixAsync(@" @@ -101,7 +101,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task Test_ExternAliasAndRegionDirective_Before() { await VerifyNoDiagnosticAsync(@" @@ -117,7 +117,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task TestNoDiagnostic_CommentAndRegionDirective_Before() { await VerifyNoDiagnosticAsync(@"// x @@ -132,7 +132,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task TestNoDiagnostic_CommentAndPragmaDirective_Before() { await VerifyNoDiagnosticAsync(@" @@ -146,7 +146,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task TestNoDiagnostic_FileStartsWithUsing() { await VerifyNoDiagnosticAsync(@"using System; @@ -158,7 +158,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeUsingDirectiveList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeUsingDirectiveList)] public async Task TestNoDiagnostic_FileStartsBlankLine() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0007AddBlankLineBetweenAccessorsTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0007AddBlankLineBetweenAccessorsTests.cs index aa34e7dd6a..42811d0eae 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0007AddBlankLineBetweenAccessorsTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0007AddBlankLineBetweenAccessorsTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0007AddBlankLineBetweenAccessorsTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBetweenAccessors; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBetweenAccessors; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenAccessors)] public async Task Test_FirstIsMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenAccessors)] public async Task Test_SecondIsMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -82,7 +82,7 @@ string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenAccessors)] public async Task Test_BothAreMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -123,7 +123,7 @@ string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenAccessors)] public async Task TestNoDiagnostic_SingleLine() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0008AddBlankLineBetweenClosingBraceAndNextStatementTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0008AddBlankLineBetweenClosingBraceAndNextStatementTests.cs index 33866acb67..45f130f1d0 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0008AddBlankLineBetweenClosingBraceAndNextStatementTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0008AddBlankLineBetweenClosingBraceAndNextStatementTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0008AddBlankLineBetweenClosingBraceAndNextStatementTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBetweenClosingBraceAndNextStatement; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBetweenClosingBraceAndNextStatement; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Block() { await VerifyDiagnosticAndFixAsync(@" @@ -39,7 +39,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_While() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_For() { await VerifyDiagnosticAndFixAsync(@" @@ -107,7 +107,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_ForEach() { await VerifyDiagnosticAndFixAsync(@" @@ -144,7 +144,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_ForEachVariable() { await VerifyDiagnosticAndFixAsync(@" @@ -181,7 +181,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Using() { await VerifyDiagnosticAndFixAsync(@" @@ -214,7 +214,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Fixed() { await VerifyDiagnosticAndFixAsync(""" @@ -243,7 +243,7 @@ unsafe void M() """, options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Checked() { await VerifyDiagnosticAndFixAsync(@" @@ -272,7 +272,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Unchecked() { await VerifyDiagnosticAndFixAsync(@" @@ -301,7 +301,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Unsafe() { await VerifyDiagnosticAndFixAsync(@" @@ -330,7 +330,7 @@ void M() ", options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Lock() { await VerifyDiagnosticAndFixAsync(@" @@ -359,7 +359,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_If() { await VerifyDiagnosticAndFixAsync(@" @@ -388,7 +388,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_ElseIf() { await VerifyDiagnosticAndFixAsync(@" @@ -427,7 +427,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Else() { await VerifyDiagnosticAndFixAsync(@" @@ -462,7 +462,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_Switch() { await VerifyDiagnosticAndFixAsync(""" @@ -495,7 +495,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_TryCatch() { await VerifyDiagnosticAndFixAsync(@" @@ -530,7 +530,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task Test_TryFinally() { await VerifyDiagnosticAndFixAsync(@" @@ -565,7 +565,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenClosingBraceAndNextStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenClosingBraceAndNextStatement)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0009AddEmptyLineBetweenDeclarationAndDocumentationCommentTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0009AddEmptyLineBetweenDeclarationAndDocumentationCommentTests.cs index 3a96783ad7..134f0734b6 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0009AddEmptyLineBetweenDeclarationAndDocumentationCommentTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0009AddEmptyLineBetweenDeclarationAndDocumentationCommentTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0009AddEmptyLineBetweenDeclarationAndDocumentationCommentTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBetweenDeclarationAndDocumentationComment; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBetweenDeclarationAndDocumentationComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment)] public async Task Test_MemberDeclaration_SingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -37,7 +37,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment)] public async Task Test_MemberDeclaration_Multiline() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ void M2() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment)] public async Task Test_EnumMemberDeclaration_SingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -95,7 +95,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment)] public async Task Test_EnumMemberDeclaration_Multiline() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment)] public async Task TestNoDiagnostic_MemberDeclaration() { await VerifyNoDiagnosticAsync(@" @@ -144,7 +144,7 @@ void M2() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarationAndDocumentationComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarationAndDocumentationComment)] public async Task TestNoDiagnostic_EnumMemberDeclaration() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0010AddBlankLineBetweenDeclarationsTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0010AddBlankLineBetweenDeclarationsTests.cs index d404fabd9a..b007175a11 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0010AddBlankLineBetweenDeclarationsTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0010AddBlankLineBetweenDeclarationsTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0010AddBlankLineBetweenDeclarationsTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBetweenDeclarations; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBetweenDeclarations; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task Test_MemberDeclaration_FirstIsMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -35,7 +35,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task Test_MemberDeclaration_SecondIsMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -58,7 +58,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task Test_MemberDeclaration_BothAreMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -85,7 +85,7 @@ void M2() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task Test_EnumMemberDeclaration_FirstIsMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -110,7 +110,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task Test_EnumMemberDeclaration_SecondIsMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -135,7 +135,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task Test_EnumMemberDeclaration_BothAreMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -162,7 +162,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task TestNoDiagnostic_MemberDeclaration_SingleLine() { await VerifyNoDiagnosticAsync(@" @@ -174,7 +174,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task TestNoDiagnostic_EnumMemberDeclaration_SingleLine() { await VerifyNoDiagnosticAsync(@" @@ -186,7 +186,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task TestNoDiagnostic_MemberDeclaration_DocumentationComment() { await VerifyNoDiagnosticAsync(@" @@ -205,7 +205,7 @@ void M2() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task TestNoDiagnostic_EnumMemberDeclaration_DocumentationComment() { await VerifyNoDiagnosticAsync(@" @@ -220,7 +220,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenDeclarations)] public async Task TestNoDiagnostic_GlobalStatement() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0011BlankLineBetweenSingleLineAccessorsTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0011BlankLineBetweenSingleLineAccessorsTests.cs index 6135aa898e..d9759d3e46 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0011BlankLineBetweenSingleLineAccessorsTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0011BlankLineBetweenSingleLineAccessorsTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0011BlankLineBetweenSingleLineAccessorsTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.BlankLineBetweenSingleLineAccessors; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.BlankLineBetweenSingleLineAccessors; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSingleLineAccessors, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors)] public async Task Test_RemoveEmptyLine_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSingleLineAccessors, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors)] public async Task Test_RemoveEmptyLines_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -100,7 +100,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSingleLineAccessors, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors)] public async Task Test_RemoveEmptyLine_Event() { await VerifyDiagnosticAndFixAsync(@" @@ -129,7 +129,7 @@ event EventHandler E ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSingleLineAccessors, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors)] public async Task TestNoDiagnostic_Property_FirstIsMultiline() { await VerifyNoDiagnosticAsync(@" @@ -149,7 +149,7 @@ string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSingleLineAccessors)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSingleLineAccessors)] public async Task TestNoDiagnostic_Property_SecondIsMultiline() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0012AddBlankLineBetweenSingleLineDeclarationsTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0012AddBlankLineBetweenSingleLineDeclarationsTests.cs index 9fe756cca5..29b9475022 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0012AddBlankLineBetweenSingleLineDeclarationsTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0012AddBlankLineBetweenSingleLineDeclarationsTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0012AddBlankLineBetweenSingleLineDeclarationsTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBetweenSingleLineDeclarations; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBetweenSingleLineDeclarations; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task Test_MemberDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -31,7 +31,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task Test_EnumMemberDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -50,7 +50,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task TestNoDiagnostic_MemberDeclaration_FirstIsMultiline() { await VerifyNoDiagnosticAsync(@" @@ -64,7 +64,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task TestNoDiagnostic_MemberDeclaration_SecondIsMultiline() { await VerifyNoDiagnosticAsync(@" @@ -78,7 +78,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task TestNoDiagnostic_EnumMemberDeclaration_FirstIsMultiline() { await VerifyNoDiagnosticAsync(@" @@ -93,7 +93,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task TestNoDiagnostic_EnumMemberDeclaration_SecondIsMultiline() { await VerifyNoDiagnosticAsync(@" @@ -108,7 +108,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task TestNoDiagnostic_MemberDeclaration_DocumentationComment() { await VerifyNoDiagnosticAsync(@" @@ -123,7 +123,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task TestNoDiagnostic_EnumMemberDeclaration_DocumentationComment() { await VerifyNoDiagnosticAsync(@" @@ -138,7 +138,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarations)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarations)] public async Task TestNoDiagnostic_EnumMemberDeclarations_DocumentationComment() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0013AddBlankLineBetweenSingleLineDeclarationsOfDifferentKindTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0013AddBlankLineBetweenSingleLineDeclarationsOfDifferentKindTests.cs index 3519052e38..f1bc95166a 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0013AddBlankLineBetweenSingleLineDeclarationsOfDifferentKindTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0013AddBlankLineBetweenSingleLineDeclarationsOfDifferentKindTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0013AddBlankLineBetweenSingleLineDeclarationsOfDifferentKindTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] public async Task Test_MemberDeclaration_PropertyAndIndexer() { await VerifyDiagnosticAndFixAsync(@" @@ -31,7 +31,7 @@ abstract class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] public async Task Test_ConstAndField() { await VerifyDiagnosticAndFixAsync(@" @@ -50,7 +50,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] public async Task TestNoDiagnostic_MultilineMethod() { await VerifyNoDiagnosticAsync(@" @@ -64,7 +64,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] public async Task TestNoDiagnostic_Properties() { await VerifyNoDiagnosticAsync(@" @@ -76,7 +76,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSingleLineDeclarationsOfDifferentKind)] public async Task TestNoDiagnostic_Event2() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0014AddBlankLineBetweenSwitchSectionsTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0014AddBlankLineBetweenSwitchSectionsTests.cs index 655d1c3f3c..133c7a2089 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0014AddBlankLineBetweenSwitchSectionsTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0014AddBlankLineBetweenSwitchSectionsTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0014AddBlankLineBetweenSwitchSectionsTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBetweenSwitchSections; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBetweenSwitchSections; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task Test() { await VerifyDiagnosticAndFixAsync(""" @@ -62,7 +62,7 @@ string M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task Test_ClosingBraceAndSection() { await VerifyDiagnosticAndFixAsync(""" @@ -116,7 +116,7 @@ string M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task Test_ClosingBraceAndSection2() { await VerifyDiagnosticAndFixAsync(""" @@ -163,7 +163,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenClosingBraceAndSwitchSection, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task Test_ClosingBraceAndSection3() { await VerifyDiagnosticAndFixAsync(""" @@ -206,7 +206,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenClosingBraceAndSwitchSection, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task TestNoDiagnostic_NoEmptyLineBetweenClosingBraceAndSwitchSection() { await VerifyNoDiagnosticAsync(""" @@ -232,7 +232,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenClosingBraceAndSwitchSection, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task TestNoDiagnostic_NoEmptyLineBetweenClosingBraceAndSwitchSection2() { await VerifyNoDiagnosticAsync(""" @@ -259,7 +259,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenClosingBraceAndSwitchSection, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task TestNoDiagnostic_NoEmptyLineBetweenClosingBraceAndSwitchSection3() { await VerifyNoDiagnosticAsync(""" @@ -284,7 +284,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenClosingBraceAndSwitchSection, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task Test_Comment() { await VerifyDiagnosticAndFixAsync(""" @@ -327,7 +327,7 @@ string M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBetweenSwitchSections)] public async Task TestNoDiagnostic_SingleSection() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0015BlankLineBetweenUsingDirectivesTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0015BlankLineBetweenUsingDirectivesTests.cs index 68115bec45..9bb1944fdd 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0015BlankLineBetweenUsingDirectivesTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0015BlankLineBetweenUsingDirectivesTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0015BlankLineBetweenUsingDirectivesTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.BlankLineBetweenUsingDirectives; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.BlankLineBetweenUsingDirectives; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task Test_AddEmptyLine_EmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -36,7 +36,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenUsingDirectives, ConfigOptionValues.BlankLineBetweenUsingDirectives_SeparateGroups)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task Test_AddEmptyLine_GlobalAlias() { await VerifyDiagnosticAndFixAsync(@" @@ -60,7 +60,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenUsingDirectives, ConfigOptionValues.BlankLineBetweenUsingDirectives_SeparateGroups)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task Test_RemoveEmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -84,7 +84,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenUsingDirectives, ConfigOptionValues.BlankLineBetweenUsingDirectives_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task Test_RemoveEmptyLines_Between_DifferentGroups() { await VerifyDiagnosticAndFixAsync(@" @@ -106,7 +106,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenUsingDirectives, ConfigOptionValues.BlankLineBetweenUsingDirectives_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task Test_RemoveEmptyLines_Between_SameGroups() { await VerifyDiagnosticAndFixAsync(@" @@ -127,7 +127,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenUsingDirectives, ConfigOptionValues.BlankLineBetweenUsingDirectives_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task TestNoDiagnostic_AddEmptyLine_SameRootNamespace() { await VerifyNoDiagnosticAsync(@" @@ -140,7 +140,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task TestNoDiagnostic_AddEmptyLine_UsingStatic() { await VerifyNoDiagnosticAsync(@" @@ -153,7 +153,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task TestNoDiagnostic_AddEmptyLine_Alias() { await VerifyNoDiagnosticAsync(@" @@ -166,7 +166,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task TestNoDiagnostic_Keep_Empty_Lines() { await VerifyNoDiagnosticAsync(@" @@ -182,7 +182,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task TestNoDiagnostic_SeparateGroups() { await VerifyNoDiagnosticAsync(@" @@ -197,7 +197,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenUsingDirectives, ConfigOptionValues.BlankLineBetweenUsingDirectives_SeparateGroups)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task TestNoDiagnostic_NoEmptyLine() { await VerifyNoDiagnosticAsync(@" @@ -211,7 +211,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenUsingDirectives, ConfigOptionValues.BlankLineBetweenUsingDirectives_Never)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task TestNoDiagnostic_RemoveEmptyLine_UsingStatic() { await VerifyNoDiagnosticAsync(@" @@ -225,7 +225,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenUsingDirectives, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenUsingDirectives)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenUsingDirectives)] public async Task TestNoDiagnostic_RemoveEmptyLine_Alias() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0016PutEachAttributeListOnItsOwnLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0016PutEachAttributeListOnItsOwnLineTests.cs index 72fc3520d5..bdddf4aeaf 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0016PutEachAttributeListOnItsOwnLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0016PutEachAttributeListOnItsOwnLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0016PutEachAttributeListOnItsOwnLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutAttributeListOnItsOwnLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutAttributeListOnItsOwnLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Class() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ static class SC "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_ClassWithMultipleAttributeLists() { await VerifyDiagnosticAndFixAsync(@" @@ -72,7 +72,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Constructor() { await VerifyDiagnosticAndFixAsync(@" @@ -106,7 +106,7 @@ public C(object p) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_ConversionOperator() { await VerifyDiagnosticAndFixAsync(@" @@ -127,7 +127,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Delegate() { await VerifyDiagnosticAndFixAsync(@" @@ -148,7 +148,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Destructor() { await VerifyDiagnosticAndFixAsync(@" @@ -173,7 +173,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Enum() { await VerifyDiagnosticAndFixAsync(@" @@ -207,7 +207,7 @@ public enum E2 "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_EnumMember() { await VerifyDiagnosticAndFixAsync(@" @@ -228,7 +228,7 @@ enum E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Event() { await VerifyDiagnosticAndFixAsync(@" @@ -270,7 +270,7 @@ public event EventHandler E2 "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_EventField() { await VerifyDiagnosticAndFixAsync(@" @@ -296,7 +296,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -322,7 +322,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Indexer() { await VerifyDiagnosticAndFixAsync(@" @@ -364,7 +364,7 @@ string this[int index] "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Interface() { await VerifyDiagnosticAndFixAsync(@" @@ -398,7 +398,7 @@ public interface I2 "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Method() { await VerifyDiagnosticAndFixAsync(@" @@ -432,7 +432,7 @@ static void SM() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Operator() { await VerifyDiagnosticAndFixAsync(@" @@ -453,7 +453,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -495,7 +495,7 @@ public string P2 "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_Struct() { await VerifyDiagnosticAndFixAsync(@" @@ -529,7 +529,7 @@ public struct S2 "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_GetSetAccessor() { await VerifyDiagnosticAndFixAsync(@" @@ -597,7 +597,7 @@ public sealed class FooAttribute : Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_InitSetter() { await VerifyDiagnosticAndFixAsync(@" @@ -640,7 +640,7 @@ public sealed class FooAttribute : Attribute ", options: Options.AddAllowedCompilerDiagnosticId("CS0518")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task Test_AddRemoveAccessor() { await VerifyDiagnosticAndFixAsync(@" @@ -680,7 +680,7 @@ public sealed class FooAttribute : Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task TestNoDiagnostic_SingleLineIndexer() { await VerifyNoDiagnosticAsync(@" @@ -693,7 +693,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task TestNoDiagnostic_SingleLineProperty() { await VerifyNoDiagnosticAsync(@" @@ -706,7 +706,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task TestNoDiagnostic_SingleLineEvent() { await VerifyNoDiagnosticAsync(@" @@ -724,7 +724,7 @@ public sealed class FooAttribute : Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAttributeListOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAttributeListOnItsOwnLine)] public async Task TestNoDiagnostic_SingleLineEnumDeclaration() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0020FormatAccessorBracesTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0020FormatAccessorBracesTests.cs index f71a0aea18..847cc97ef1 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0020FormatAccessorBracesTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0020FormatAccessorBracesTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0020FormatAccessorBracesTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FormatAccessorBraces; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.FormatAccessorBraces; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task Test_Getter() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.AccessorBracesStyle, ConfigOptionValues.AccessorBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task Test_Getter_ToSingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.AccessorBracesStyle, ConfigOptionValues.AccessorBracesStyle_SingleLineWhenExpressionIsOnSingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task Test_Setter() { await VerifyDiagnosticAndFixAsync(@" @@ -99,7 +99,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.AccessorBracesStyle, ConfigOptionValues.AccessorBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task Test_InitSetter() { await VerifyDiagnosticAndFixAsync(@" @@ -139,7 +139,7 @@ string P .AddConfigOption(ConfigOptionKeys.AccessorBracesStyle, ConfigOptionValues.AccessorBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task Test_Event() { await VerifyDiagnosticAndFixAsync(@" @@ -171,7 +171,7 @@ event EventHandler E ", options: Options.AddConfigOption(ConfigOptionKeys.AccessorBracesStyle, ConfigOptionValues.AccessorBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task Test_Event_ToSingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -203,7 +203,7 @@ event EventHandler E ", options: Options.AddConfigOption(ConfigOptionKeys.AccessorBracesStyle, ConfigOptionValues.AccessorBracesStyle_SingleLineWhenExpressionIsOnSingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task Test_AllowSingeLineGetter() { await VerifyNoDiagnosticAsync(@" @@ -219,7 +219,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.AccessorBracesStyle, ConfigOptionValues.AccessorBracesStyle_SingleLineWhenExpressionIsOnSingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task Test_MultiLineStatement() { await VerifyNoDiagnosticAsync(@" @@ -239,7 +239,7 @@ string P ", options: Options.AddConfigOption(ConfigOptionKeys.AccessorBracesStyle, ConfigOptionValues.AccessorBracesStyle_SingleLineWhenExpressionIsOnSingleLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBraces)] public async Task TestNoDiagnostic_AutoProperty() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0021FormatBlockBracesTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0021FormatBlockBracesTests.cs index 168642f300..43360a7160 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0021FormatBlockBracesTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0021FormatBlockBracesTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0021FormatBlockBracesTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FormatBlockBraces; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.FormatBlockBraces; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatBlockBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatBlockBraces)] public async Task Test_Constructor() { await VerifyDiagnosticAndFixAsync(@" @@ -39,7 +39,7 @@ public void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BlockBracesStyle, ConfigOptionValues.BlockBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatBlockBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatBlockBraces)] public async Task Test_Destructor() { await VerifyDiagnosticAndFixAsync(@" @@ -66,7 +66,7 @@ public void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BlockBracesStyle, ConfigOptionValues.BlockBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatBlockBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatBlockBraces)] public async Task Test_Method() { await VerifyDiagnosticAndFixAsync(@" @@ -92,7 +92,7 @@ public void M(object p = null) ", options: Options.AddConfigOption(ConfigOptionKeys.BlockBracesStyle, ConfigOptionValues.BlockBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatBlockBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatBlockBraces)] public async Task Test_Method_ToSingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -115,7 +115,7 @@ public void M(object p = null) ", options: Options.AddConfigOption(ConfigOptionKeys.BlockBracesStyle, ConfigOptionValues.BlockBracesStyle_SingleLineWhenEmpty)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatBlockBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatBlockBraces)] public async Task Test_ExplicitOperator() { await VerifyDiagnosticAndFixAsync(@" @@ -134,7 +134,7 @@ public static explicit operator C(string value) ", options: Options.AddConfigOption(ConfigOptionKeys.BlockBracesStyle, ConfigOptionValues.BlockBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatBlockBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatBlockBraces)] public async Task Test_Operator() { await VerifyDiagnosticAndFixAsync(@" @@ -153,7 +153,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlockBracesStyle, ConfigOptionValues.BlockBracesStyle_MultiLine)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatBlockBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatBlockBraces)] public async Task TestNoDiagnostic_SingleLineAccessorList() { await VerifyNoDiagnosticAsync(@" @@ -178,7 +178,7 @@ public void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatBlockBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatBlockBraces)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0022AddNewLineAfterOpeningBraceOfEmptyBlockTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0022AddNewLineAfterOpeningBraceOfEmptyBlockTests.cs index 0e27d38733..15576194fb 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0022AddNewLineAfterOpeningBraceOfEmptyBlockTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0022AddNewLineAfterOpeningBraceOfEmptyBlockTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0022AddNewLineAfterOpeningBraceOfEmptyBlockTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddNewLineAfterOpeningBraceOfEmptyBlock; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddNewLineAfterOpeningBraceOfEmptyBlock; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddNewLineAfterOpeningBraceOfEmptyBlock)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddNewLineAfterOpeningBraceOfEmptyBlock)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -31,7 +31,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddNewLineAfterOpeningBraceOfEmptyBlock)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddNewLineAfterOpeningBraceOfEmptyBlock)] public async Task Test_WithWhitespace() { await VerifyDiagnosticAndFixAsync(@" @@ -50,7 +50,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddNewLineAfterOpeningBraceOfEmptyBlock)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddNewLineAfterOpeningBraceOfEmptyBlock)] public async Task TestNoDiagnostic_EmptyLine() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0023FormatTypeDeclarationBracesTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0023FormatTypeDeclarationBracesTests.cs index c443874ec1..58975dce0f 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0023FormatTypeDeclarationBracesTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0023FormatTypeDeclarationBracesTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0023FormatTypeDeclarationBracesTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FormatTypeDeclarationBraces; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.FormatTypeDeclarationBraces; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatTypeDeclarationBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatTypeDeclarationBraces)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -25,7 +25,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatTypeDeclarationBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatTypeDeclarationBraces)] public async Task Test_WithWhitespace() { await VerifyDiagnosticAndFixAsync(@" @@ -38,7 +38,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatTypeDeclarationBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatTypeDeclarationBraces)] public async Task TestNoDiagnostic_EmptyLine() { await VerifyNoDiagnosticAsync(@" @@ -49,7 +49,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatTypeDeclarationBraces)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatTypeDeclarationBraces)] public async Task TestNoDiagnostic_NoBraces() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0024AddNewLineAfterSwitchLabelTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0024AddNewLineAfterSwitchLabelTests.cs index 2138ef861f..3df6637f38 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0024AddNewLineAfterSwitchLabelTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0024AddNewLineAfterSwitchLabelTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0024AddNewLineAfterSwitchLabelTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddNewLineAfterSwitchLabel; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddNewLineAfterSwitchLabel; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddNewLineAfterSwitchLabel)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddNewLineAfterSwitchLabel)] public async Task Test() { await VerifyDiagnosticAndFixAsync(""" @@ -45,7 +45,7 @@ void Foo() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddNewLineAfterSwitchLabel)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddNewLineAfterSwitchLabel)] public async Task Test_MultipleLabels() { await VerifyDiagnosticAndFixAsync(""" @@ -80,7 +80,7 @@ void Foo() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddNewLineAfterSwitchLabel)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddNewLineAfterSwitchLabel)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0025PutFullAccessorOnItsOwnLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0025PutFullAccessorOnItsOwnLineTests.cs index d1fca0b214..54aec975a8 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0025PutFullAccessorOnItsOwnLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0025PutFullAccessorOnItsOwnLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0025PutFullAccessorOnItsOwnLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutFullAccessorOnItsOwnLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutFullAccessorOnItsOwnLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -36,7 +36,7 @@ public string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine)] public async Task Test_Property_Setter() { await VerifyDiagnosticAndFixAsync(@" @@ -63,7 +63,7 @@ public string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine)] public async Task Test_Property_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -87,7 +87,7 @@ public string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine)] public async Task Test_Property_ExpressionBody_Setter() { await VerifyDiagnosticAndFixAsync(@" @@ -114,7 +114,7 @@ public string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine)] public async Task Test_ReadOnlyProperty() { await VerifyDiagnosticAndFixAsync(@" @@ -137,7 +137,7 @@ public string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine)] public async Task Test_ReadOnlyProperty_ExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -160,7 +160,7 @@ public string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutFullAccessorOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutFullAccessorOnItsOwnLine)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0027PlaceNewLineAfterOrBeforeBinaryOperatorTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0027PlaceNewLineAfterOrBeforeBinaryOperatorTests.cs index f8992fa1b9..ae4c5537ed 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0027PlaceNewLineAfterOrBeforeBinaryOperatorTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0027PlaceNewLineAfterOrBeforeBinaryOperatorTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0027PlaceNewLineAfterOrBeforeBinaryOperatorTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeBinaryOperator; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator)] public async Task Test_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -50,7 +50,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BinaryOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator)] public async Task Test_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -88,7 +88,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BinaryOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator)] public async Task TestNoDiagnostic_BeforeInsteadOfAfter() { await VerifyNoDiagnosticAsync(@" @@ -110,7 +110,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BinaryOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator)] public async Task TestNoDiagnostic_BeforeInsteadOfAfter_SingleLine() { await VerifyNoDiagnosticAsync(@" @@ -130,7 +130,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BinaryOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator)] public async Task TestNoDiagnostic_AfterInsteadOfBefore() { await VerifyNoDiagnosticAsync(@" @@ -152,7 +152,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.BinaryOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeBinaryOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeBinaryOperator)] public async Task TestNoDiagnostic_AfterInsteadOfBefore_SingleLine() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0028PlaceNewLineAfterOrBeforeConditionalExpressionOperatorTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0028PlaceNewLineAfterOrBeforeConditionalExpressionOperatorTests.cs index 88552e1b30..ca6f19300f 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0028PlaceNewLineAfterOrBeforeConditionalExpressionOperatorTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0028PlaceNewLineAfterOrBeforeConditionalExpressionOperatorTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0028PlaceNewLineAfterOrBeforeConditionalExpressionOperatorTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeConditionalOperator; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator)] public async Task Test_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -42,7 +42,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator)] public async Task Test_BeforeInsteadOfAfter_QuestionToken() { await VerifyDiagnosticAndFixAsync(@" @@ -72,7 +72,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator)] public async Task Test_BeforeInsteadOfAfter_ColonToken() { await VerifyDiagnosticAndFixAsync(@" @@ -102,7 +102,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator)] public async Task Test_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -132,7 +132,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator)] public async Task Test_AfterInsteadOfBefore_QuestionToken() { await VerifyDiagnosticAndFixAsync(@" @@ -162,7 +162,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator)] public async Task Test_AfterInsteadOfBefore_ColonToken() { await VerifyDiagnosticAndFixAsync(@" @@ -192,7 +192,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator)] public async Task TestNoDiagnostic_BeforeInsteadOfAfter() { await VerifyNoDiagnosticAsync(@" @@ -210,7 +210,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.ConditionalOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeConditionalOperator)] public async Task TestNoDiagnostic_AfterInsteadOfBefore() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0029PutConstructorInitializerOnItsOwnLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0029PutConstructorInitializerOnItsOwnLineTests.cs index 8a56718f41..d3d19cf3ac 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0029PutConstructorInitializerOnItsOwnLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0029PutConstructorInitializerOnItsOwnLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0029PutConstructorInitializerOnItsOwnLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutConstructorInitializerOnItsOwnLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutConstructorInitializerOnItsOwnLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutConstructorInitializerOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutConstructorInitializerOnItsOwnLine)] public async Task Test_ThisInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutConstructorInitializerOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutConstructorInitializerOnItsOwnLine)] public async Task Test_ThisInitializer_Multiline() { await VerifyDiagnosticAndFixAsync(@" @@ -74,7 +74,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutConstructorInitializerOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutConstructorInitializerOnItsOwnLine)] public async Task Test_BaseInitializer() { await VerifyDiagnosticAndFixAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0030PutEmbeddedStatementOnItsOwnLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0030PutEmbeddedStatementOnItsOwnLineTests.cs index 2973c33ca2..32df44eebb 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0030PutEmbeddedStatementOnItsOwnLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0030PutEmbeddedStatementOnItsOwnLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0030PutEmbeddedStatementOnItsOwnLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutEmbeddedStatementOnItsOwnLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutEmbeddedStatementOnItsOwnLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_If() { await VerifyDiagnosticAndFixAsync(@" @@ -39,7 +39,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_Else() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_ForEach() { await VerifyDiagnosticAndFixAsync(@" @@ -103,7 +103,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_ForEachVariable() { await VerifyDiagnosticAndFixAsync(@" @@ -136,7 +136,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_For() { await VerifyDiagnosticAndFixAsync(@" @@ -169,7 +169,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_Using() { await VerifyDiagnosticAndFixAsync(@" @@ -200,7 +200,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_While() { await VerifyDiagnosticAndFixAsync(@" @@ -227,7 +227,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_Do() { await VerifyDiagnosticAndFixAsync(@" @@ -256,7 +256,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_Lock() { await VerifyDiagnosticAndFixAsync(@" @@ -283,7 +283,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task Test_Fixed() { await VerifyDiagnosticAndFixAsync(""" @@ -316,7 +316,7 @@ void M() """, options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task TestNoDiagnostic_EmbeddedStatement() { await VerifyNoDiagnosticAsync(""" @@ -367,7 +367,7 @@ private static void M() """, options: Options.WithAllowUnsafe(true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEmbeddedStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEmbeddedStatementOnItsOwnLine)] public async Task TestNoDiagnostic_Block() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0031PutEnumMemberOnItsOwnLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0031PutEnumMemberOnItsOwnLineTests.cs index 090f686a19..f221d4ead2 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0031PutEnumMemberOnItsOwnLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0031PutEnumMemberOnItsOwnLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0031PutEnumMemberOnItsOwnLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutEnumMemberOnItsOwnLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutEnumMemberOnItsOwnLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEnumMemberOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEnumMemberOnItsOwnLine)] public async Task Test_WithoutExplicitValues() { await VerifyDiagnosticAndFixAsync(@" @@ -31,7 +31,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEnumMemberOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEnumMemberOnItsOwnLine)] public async Task Test_WithExplicitValues() { await VerifyDiagnosticAndFixAsync(@" @@ -50,7 +50,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEnumMemberOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEnumMemberOnItsOwnLine)] public async Task Test_WithoutTrailingComma() { await VerifyDiagnosticAndFixAsync(@" @@ -69,7 +69,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEnumMemberOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEnumMemberOnItsOwnLine)] public async Task TestNoDiagnostic_SingleMember() { await VerifyNoDiagnosticAsync(@" @@ -80,7 +80,7 @@ enum Foo "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutEnumMemberOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutEnumMemberOnItsOwnLine)] public async Task TestNoDiagnostic_MultipleMembers() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0032PlaceNewLineAfterOrBeforeArrowTokenTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0032PlaceNewLineAfterOrBeforeArrowTokenTests.cs index aafa3fefdd..a4c3995f1f 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0032PlaceNewLineAfterOrBeforeArrowTokenTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0032PlaceNewLineAfterOrBeforeArrowTokenTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0032PlaceNewLineAfterOrBeforeArrowTokenTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeArrowToken; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeArrowToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeArrowToken)] public async Task Test_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -30,7 +30,7 @@ string M() ", options: Options.AddConfigOption(ConfigOptionKeys.ArrowTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeArrowToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeArrowToken)] public async Task Test_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -48,7 +48,7 @@ string M() => ", options: Options.AddConfigOption(ConfigOptionKeys.ArrowTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeArrowToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeArrowToken)] public async Task TestNoDiagnostic_BeforeInsteadOfAfter_Comment() { await VerifyDiagnosticAndFixAsync(@" @@ -67,7 +67,7 @@ string M() ", options: Options.AddConfigOption(ConfigOptionKeys.ArrowTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeArrowToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeArrowToken)] public async Task TestNoDiagnostic_AfterInsteadOfBefore_Comment() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0033PutStatementOnItsOwnLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0033PutStatementOnItsOwnLineTests.cs index 05da939916..8996ee1b4e 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0033PutStatementOnItsOwnLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0033PutStatementOnItsOwnLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0033PutStatementOnItsOwnLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutStatementOnItsOwnLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutStatementOnItsOwnLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutStatementOnItsOwnLine)] public async Task Test_Block() { await VerifyDiagnosticAndFixAsync(@" @@ -35,7 +35,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutStatementOnItsOwnLine)] public async Task Test_Block_SingleLine() { await VerifyDiagnosticAndFixAsync(@" @@ -53,7 +53,7 @@ void M() { "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutStatementOnItsOwnLine)] public async Task Test_SwitchSection() { await VerifyDiagnosticAndFixAsync(""" @@ -88,7 +88,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutStatementOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutStatementOnItsOwnLine)] public async Task TestNoDiagnostic_EmptyStatement() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0034PutTypeParameterConstraintOnItsOwnLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0034PutTypeParameterConstraintOnItsOwnLineTests.cs index bc7503f1ab..878e96d3ea 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0034PutTypeParameterConstraintOnItsOwnLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0034PutTypeParameterConstraintOnItsOwnLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0034PutTypeParameterConstraintOnItsOwnLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutTypeParameterConstraintOnItsOwnLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutTypeParameterConstraintOnItsOwnLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine)] public async Task Test_Class() { await VerifyDiagnosticAndFixAsync(@" @@ -34,7 +34,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine)] public async Task Test_Struct() { await VerifyDiagnosticAndFixAsync(@" @@ -56,7 +56,7 @@ struct S "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine)] public async Task Test_Interface() { await VerifyDiagnosticAndFixAsync(@" @@ -78,7 +78,7 @@ interface I "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine)] public async Task Test_Delegate() { await VerifyDiagnosticAndFixAsync(@" @@ -96,7 +96,7 @@ delegate void DelegateName() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine)] public async Task Test_Method() { await VerifyDiagnosticAndFixAsync(@" @@ -124,7 +124,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine)] public async Task Test_LocalFunction() { await VerifyDiagnosticAndFixAsync(@" @@ -158,7 +158,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine)] public async Task TestNoDiagnostic_SingleConstraint() { await VerifyNoDiagnosticAsync(@" @@ -168,7 +168,7 @@ class C where T : struct "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutTypeParameterConstraintOnItsOwnLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutTypeParameterConstraintOnItsOwnLine)] public async Task TestNoDiagnostic_BaseType() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0036RemoveBlankLineBetweenSingleLineDeclarationsOfSameKindTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0036RemoveBlankLineBetweenSingleLineDeclarationsOfSameKindTests.cs index 548586b5ca..8d00d8144d 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0036RemoveBlankLineBetweenSingleLineDeclarationsOfSameKindTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0036RemoveBlankLineBetweenSingleLineDeclarationsOfSameKindTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0036RemoveBlankLineBetweenSingleLineDeclarationsOfSameKindTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] public async Task Test_Properties() { await VerifyDiagnosticAndFixAsync(@" @@ -31,7 +31,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] public async Task Test_Events() { await VerifyDiagnosticAndFixAsync(@" @@ -55,7 +55,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] public async Task TestNoDiagnostic_MultilineEvent() { await VerifyNoDiagnosticAsync(@" @@ -74,7 +74,7 @@ public event EventHandler E2 "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] public async Task TestNoDiagnostic_PropertyAndIndexer() { await VerifyNoDiagnosticAsync(@" @@ -87,7 +87,7 @@ abstract class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] public async Task TestNoDiagnostic_ConstAndField() { await VerifyNoDiagnosticAsync(@" @@ -100,7 +100,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] public async Task TestNoDiagnostic_DocCommentBetweenMembers() { await VerifyNoDiagnosticAsync(@" @@ -115,7 +115,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenSingleLineDeclarationsOfSameKind)] public async Task TestNoDiagnostic_DocCommentBetweenEnumMembers() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0038RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespaceTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0038RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespaceTests.cs index c95617279a..5499543395 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0038RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespaceTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0038RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespaceTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0038RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespaceTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] public async Task Test_EmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -36,7 +36,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] public async Task Test_EmptyLines() { await VerifyDiagnosticAndFixAsync(@" @@ -58,7 +58,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] public async Task TestNoDiagnostic_DifferentRootNamespace() { await VerifyNoDiagnosticAsync(@" @@ -72,7 +72,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] public async Task TestNoDiagnostic_UsingStatic() { await VerifyNoDiagnosticAsync(@" @@ -86,7 +86,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveBlankLineBetweenUsingDirectivesWithSameRootNamespace)] public async Task TestNoDiagnostic_Alias() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0039RemoveNewLineBeforeBaseListTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0039RemoveNewLineBeforeBaseListTests.cs index 99585b9f26..8f26583e58 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0039RemoveNewLineBeforeBaseListTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0039RemoveNewLineBeforeBaseListTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0039RemoveNewLineBeforeBaseListTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveNewLineBeforeBaseList; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.RemoveNewLineBeforeBaseList; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task Test_Class() { await VerifyDiagnosticAndFixAsync(@" @@ -35,7 +35,7 @@ class B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task Test_Class_EmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -59,7 +59,7 @@ class B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task Test_ClassWithTypeParameters() { await VerifyDiagnosticAndFixAsync(@" @@ -82,7 +82,7 @@ class B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task Test_Interface() { await VerifyDiagnosticAndFixAsync(@" @@ -105,7 +105,7 @@ interface B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task Test_Interface_WithTypeParameters() { await VerifyDiagnosticAndFixAsync(@" @@ -128,7 +128,7 @@ interface B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task Test_Struct() { await VerifyDiagnosticAndFixAsync(@" @@ -151,7 +151,7 @@ interface B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task Test_Struct_WithTypeParameters() { await VerifyDiagnosticAndFixAsync(@" @@ -174,7 +174,7 @@ interface B "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task Test_Enum() { await VerifyDiagnosticAndFixAsync(@" @@ -189,7 +189,7 @@ enum E : int "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBeforeBaseList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBeforeBaseList)] public async Task TestNoDiagnostic_Comment() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0041RemoveNewLineBetweenIfKeywordAndElseKeywordTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0041RemoveNewLineBetweenIfKeywordAndElseKeywordTests.cs index 31ee693baf..be1cda64e3 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0041RemoveNewLineBetweenIfKeywordAndElseKeywordTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0041RemoveNewLineBetweenIfKeywordAndElseKeywordTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0041RemoveNewLineBetweenIfKeywordAndElseKeywordTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.RemoveNewLineBetweenIfKeywordAndElseKeyword; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.RemoveNewLineBetweenIfKeywordAndElseKeyword; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBetweenIfKeywordAndElseKeyword)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBetweenIfKeywordAndElseKeyword)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@" @@ -49,7 +49,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBetweenIfKeywordAndElseKeyword)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBetweenIfKeywordAndElseKeyword)] public async Task Test_EmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -87,7 +87,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBetweenIfKeywordAndElseKeyword)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBetweenIfKeywordAndElseKeyword)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -108,7 +108,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveNewLineBetweenIfKeywordAndElseKeyword)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.RemoveNewLineBetweenIfKeywordAndElseKeyword)] public async Task TestNoDiagnostic_Comment() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0042RemoveNewLinesFromAccessorListOfAutoPropertyTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0042RemoveNewLinesFromAccessorListOfAutoPropertyTests.cs index af4f247222..d1f4199e09 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0042RemoveNewLinesFromAccessorListOfAutoPropertyTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0042RemoveNewLinesFromAccessorListOfAutoPropertyTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0042RemoveNewLinesFromAccessorListOfAutoPropertyTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutAutoAccessorsOnSingleLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutAutoAccessorsOnSingleLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine)] public async Task Test_ReadOnlyProperty() { await VerifyDiagnosticAndFixAsync(@" @@ -31,7 +31,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine)] public async Task Test_Property() { await VerifyDiagnosticAndFixAsync(@" @@ -51,7 +51,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine)] public async Task Test_ReadOnlyIndexer() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ interface I "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine)] public async Task Test_Indexer() { await VerifyDiagnosticAndFixAsync(@" @@ -90,7 +90,7 @@ interface I "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutAutoAccessorsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutAutoAccessorsOnSingleLine)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0043FormatAccessorBracesOnSingleLineWhenStatementIsOnSingleLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0043FormatAccessorBracesOnSingleLineWhenStatementIsOnSingleLineTests.cs index 9d4daad698..369589cbdc 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0043FormatAccessorBracesOnSingleLineWhenStatementIsOnSingleLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0043FormatAccessorBracesOnSingleLineWhenStatementIsOnSingleLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0043FormatAccessorBracesOnSingleLineWhenStatementIsOnSingleLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] public async Task Test_Getter_Setter() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] public async Task Test_Getter() { await VerifyDiagnosticAndFixAsync(@" @@ -77,7 +77,7 @@ string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] public async Task Test_Setter() { await VerifyDiagnosticAndFixAsync(@" @@ -108,7 +108,7 @@ string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] public async Task TestNoDiagnostic_FullProperty() { await VerifyNoDiagnosticAsync(@" @@ -125,7 +125,7 @@ string P "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FormatAccessorBracesOnSingleLineWhenExpressionIsOnSingleLine)] public async Task TestNoDiagnostic_AutoProperty() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0044UseCarriageReturnAndLinefeedAsNewLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0044UseCarriageReturnAndLinefeedAsNewLineTests.cs index d177d89d65..d05d971a60 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0044UseCarriageReturnAndLinefeedAsNewLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0044UseCarriageReturnAndLinefeedAsNewLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0044UseCarriageReturnAndLinefeedAsNewLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseCarriageReturnAndLinefeedAsNewLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.UseCarriageReturnAndLinefeedAsNewLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCarriageReturnAndLinefeedAsNewLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.UseCarriageReturnAndLinefeedAsNewLine)] public async Task Test() { await VerifyDiagnosticAndFixAsync("\r\n" @@ -37,7 +37,7 @@ await VerifyDiagnosticAndFixAsync("\r\n" + "}\r\n"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCarriageReturnAndLinefeedAsNewLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.UseCarriageReturnAndLinefeedAsNewLine)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync("\r\n" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0045UseLinefeedAsNewLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0045UseLinefeedAsNewLineTests.cs index 887cb2b05f..e6ea40457a 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0045UseLinefeedAsNewLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0045UseLinefeedAsNewLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0045UseLinefeedAsNewLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseLinefeedAsNewLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.UseLinefeedAsNewLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseLinefeedAsNewLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.UseLinefeedAsNewLine)] public async Task Test() { await VerifyDiagnosticAndFixAsync("\n" @@ -37,7 +37,7 @@ await VerifyDiagnosticAndFixAsync("\n" + "}\n"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseLinefeedAsNewLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.UseLinefeedAsNewLine)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync("\n" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0046UseSpacesInsteadOfTabTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0046UseSpacesInsteadOfTabTests.cs index dcaec5f5cb..db43cbc1fe 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0046UseSpacesInsteadOfTabTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0046UseSpacesInsteadOfTabTests.cs @@ -10,7 +10,7 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0046UseSpacesInsteadOfTabTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.UseSpacesInsteadOfTab; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.UseSpacesInsteadOfTab; private readonly string _fourSpacesEquivalenceKey; @@ -19,7 +19,7 @@ public RCS0046UseSpacesInsteadOfTabTests() _fourSpacesEquivalenceKey = new ReplaceTabWithSpacesCodeFixProvider().FourSpacesEquivalenceKey; } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseSpacesInsteadOfTab)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.UseSpacesInsteadOfTab)] public async Task Test_FourSpaces() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ void M() ", equivalenceKey: _fourSpacesEquivalenceKey); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseSpacesInsteadOfTab)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.UseSpacesInsteadOfTab)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0048PutInitializerOnSingleLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0048PutInitializerOnSingleLineTests.cs index a93a56bcdf..3a4afa0e23 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0048PutInitializerOnSingleLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0048PutInitializerOnSingleLineTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0048PutInitializerOnSingleLineTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PutInitializerOnSingleLine; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PutInitializerOnSingleLine; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ObjectInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ObjectInitializer_TrailingComma() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ObjectInitializer_TrailingComma2() { await VerifyDiagnosticAndFixAsync(@" @@ -119,7 +119,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ObjectInitializer_AssignmentExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -160,7 +160,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ObjectInitializer_TrailingComma_AssignmentExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -201,7 +201,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_DictionaryInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -230,7 +230,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_DictionaryInitializer_CSharp6() { await VerifyDiagnosticAndFixAsync(@" @@ -259,7 +259,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_CollectionInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -288,7 +288,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ArrayInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -313,7 +313,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ArrayInitializer_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -332,7 +332,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ArrayInitializer_TrailingComma_Field() { await VerifyDiagnosticAndFixAsync(@" @@ -351,7 +351,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ArrayInitializer_Local() { await VerifyDiagnosticAndFixAsync(@" @@ -376,7 +376,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ArrayInitializer_TrailingComma_Local() { await VerifyDiagnosticAndFixAsync(@" @@ -401,7 +401,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task Test_ImplicitObjectCreationInitializer() { await VerifyDiagnosticAndFixAsync(@" @@ -430,7 +430,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_MultipleExpressions() { await VerifyNoDiagnosticAsync(@" @@ -451,7 +451,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_MultilineExpression() { await VerifyNoDiagnosticAsync(@" @@ -472,7 +472,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_CommentAfterCloseParenthesis() { await VerifyNoDiagnosticAsync(@" @@ -491,7 +491,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_CommentBeforeOpenBrace() { await VerifyNoDiagnosticAsync(@" @@ -510,7 +510,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_CommentAfterOpenBrace() { await VerifyNoDiagnosticAsync(@" @@ -529,7 +529,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_CommentBeforeExpression() { await VerifyNoDiagnosticAsync(@" @@ -548,7 +548,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_CommentAfterExpression() { await VerifyNoDiagnosticAsync(@" @@ -567,7 +567,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_CommentAfterComma() { await VerifyNoDiagnosticAsync(@" @@ -586,7 +586,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PutInitializerOnSingleLine)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PutInitializerOnSingleLine)] public async Task TestNoDiagnostic_CommentBeforeCloseBrace() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0049AddBlankLineAfterTopCommentTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0049AddBlankLineAfterTopCommentTests.cs index cc6d3d59b5..ac652d85d6 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0049AddBlankLineAfterTopCommentTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0049AddBlankLineAfterTopCommentTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0049AddBlankLineAfterTopCommentTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineAfterTopComment; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineAfterTopComment; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterTopComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterTopComment)] public async Task Test_Class() { await VerifyDiagnosticAndFixAsync(@"// x[| @@ -27,7 +27,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterTopComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterTopComment)] public async Task Test_ExternAlias() { await VerifyDiagnosticAndFixAsync(@"// x[| @@ -46,7 +46,7 @@ class C ", options: Options.AddAllowedCompilerDiagnosticIds(new[] { "CS0430", "CS8020" })); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterTopComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterTopComment)] public async Task Test_Using() { await VerifyDiagnosticAndFixAsync(@"// x[| @@ -65,7 +65,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterTopComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterTopComment)] public async Task Test_AttributeList() { await VerifyDiagnosticAndFixAsync(@"// x[| @@ -92,7 +92,7 @@ class AssemblyAttribute : System.Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterTopComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterTopComment)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@"// x @@ -103,7 +103,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineAfterTopComment)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineAfterTopComment)] public async Task TestNoDiagnostic_NoComment() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0050AddBlankLineBeforeTopDeclarationTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0050AddBlankLineBeforeTopDeclarationTests.cs index e184618b36..14fdc7cb13 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0050AddBlankLineBeforeTopDeclarationTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0050AddBlankLineBeforeTopDeclarationTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0050AddBlankLineBeforeTopDeclarationTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddBlankLineBeforeTopDeclaration; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddBlankLineBeforeTopDeclaration; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration)] public async Task Test_ExternAlias() { await VerifyDiagnosticAndFixAsync(@" @@ -29,7 +29,7 @@ class C ", options: Options.AddAllowedCompilerDiagnosticId("CS0430")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration)] public async Task Test_Using() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration)] public async Task Test_Attribute() { await VerifyDiagnosticAndFixAsync(@" @@ -71,7 +71,7 @@ class AssemblyAttribute : System.Attribute "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration)] public async Task Test_If() { await VerifyDiagnosticAndFixAsync(@" @@ -88,7 +88,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration)] public async Task Test_Namespace() { await VerifyDiagnosticAndFixAsync(@" @@ -105,7 +105,7 @@ namespace N "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration)] public async Task Test_Struct() { await VerifyDiagnosticAndFixAsync(@" @@ -122,7 +122,7 @@ struct C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration)] public async Task Test_Interface() { await VerifyDiagnosticAndFixAsync(@" @@ -139,7 +139,7 @@ interface IC "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBlankLineBeforeTopDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddBlankLineBeforeTopDeclaration)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0051AddOrRemoveNewLineBeforeWhileInDoStatementTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0051AddOrRemoveNewLineBeforeWhileInDoStatementTests.cs index 726d6a143f..0e41df5081 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0051AddOrRemoveNewLineBeforeWhileInDoStatementTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0051AddOrRemoveNewLineBeforeWhileInDoStatementTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0051AddOrRemoveNewLineBeforeWhileInDoStatementTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.AddOrRemoveNewLineBeforeWhileInDoStatement; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement)] public async Task Test_AddNewLine() { await VerifyDiagnosticAndFixAsync(@" @@ -45,7 +45,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineBeforeWhileInDoStatement, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement)] public async Task Test_AddNewLine_WithoutTrivia() { await VerifyDiagnosticAndFixAsync(@" @@ -78,7 +78,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineBeforeWhileInDoStatement, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement)] public async Task Test_RemoveNewLine() { await VerifyDiagnosticAndFixAsync(@" @@ -111,7 +111,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineBeforeWhileInDoStatement, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement)] public async Task Test_RemoveNewLine_EmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -145,7 +145,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineBeforeWhileInDoStatement, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement)] public async Task TestNoDiagnostic_AddNewLine() { await VerifyNoDiagnosticAsync(@" @@ -165,7 +165,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineBeforeWhileInDoStatement, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement)] public async Task TestNoDiagnostic_AddNewLine_EmbeddedStatement() { await VerifyNoDiagnosticAsync(@" @@ -183,7 +183,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement)] public async Task TestNoDiagnostic_RemoveNewLine() { await VerifyNoDiagnosticAsync(@" @@ -202,7 +202,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineBeforeWhileInDoStatement, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddOrRemoveNewLineBeforeWhileInDoStatement)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.AddOrRemoveNewLineBeforeWhileInDoStatement)] public async Task TestNoDiagnostic_RemoveNewLine_EmbeddedStatement() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0052PlaceNewLineAfterOrBeforeEqualsSignTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0052PlaceNewLineAfterOrBeforeEqualsSignTests.cs index 5f2f2a33ef..7df849666a 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0052PlaceNewLineAfterOrBeforeEqualsSignTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0052PlaceNewLineAfterOrBeforeEqualsSignTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0052PlaceNewLineAfterOrBeforeEqualsSignTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeEqualsToken; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_LocalDeclaration_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -36,7 +36,7 @@ string s ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_LocalDeclaration_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -60,7 +60,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_Assignment_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -88,7 +88,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_Assignment_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -116,7 +116,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_PropertyInitializer_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -134,7 +134,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_PropertyInitializer_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -152,7 +152,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_FieldValue_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -170,7 +170,7 @@ string F ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_FieldValue_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -188,7 +188,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_Parameter_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -210,7 +210,7 @@ void M(string p ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_Parameter_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -232,7 +232,7 @@ void M(string p = ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_AnonymousType_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(""" @@ -264,7 +264,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_AnonymousType_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(""" @@ -296,7 +296,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_AttributeArgument_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(""" @@ -318,7 +318,7 @@ class C """, options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_AttributeArgument_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(""" @@ -340,7 +340,7 @@ class C """, options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_AttributeArgument_UsingAlias_Before() { await VerifyDiagnosticAndFixAsync(@" @@ -360,7 +360,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task Test_AttributeArgument_UsingAlias_After() { await VerifyDiagnosticAndFixAsync(@" @@ -380,7 +380,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task TestNoDiagnostic_BeforeInsteadOfAfter_Comment() { await VerifyNoDiagnosticAsync(@" @@ -395,7 +395,7 @@ string s // x ", options: Options.AddConfigOption(ConfigOptionKeys.EqualsTokenNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeEqualsToken)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeEqualsToken)] public async Task TestNoDiagnostic_AfterInsteadOfBefore_Comment() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0053FixFormattingOfListTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0053FixFormattingOfListTests.cs index 0242e92b76..efef04d6a5 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0053FixFormattingOfListTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0053FixFormattingOfListTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0053FixFormattingOfListTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FixFormattingOfList; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.FixFormattingOfList; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Singleline_AlignedToParenthesis() { await VerifyDiagnosticAndFixAsync(@" @@ -34,7 +34,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Singleline_NoIndentation() { await VerifyDiagnosticAndFixAsync(@" @@ -56,7 +56,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Singleline_EmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -80,7 +80,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Singleline_Comment() { await VerifyDiagnosticAndFixAsync(@" @@ -102,7 +102,7 @@ void M( // x "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Singleline_EmptyLine_Comment() { await VerifyDiagnosticAndFixAsync(@" @@ -126,7 +126,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Singleline_BaseList() { await VerifyDiagnosticAndFixAsync(@" @@ -156,7 +156,7 @@ interface IC : "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_AlignedToParenthesis() { await VerifyDiagnosticAndFixAsync(@" @@ -194,7 +194,7 @@ void M2( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_AlignedToParenthesis_WhitespaceAfterParenthesis() { await VerifyDiagnosticAndFixAsync(@" @@ -217,7 +217,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_FirstParameterNotWrapped() { await VerifyDiagnosticAndFixAsync(@" @@ -246,7 +246,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_TwoParametersOnSameLine() { await VerifyDiagnosticAndFixAsync(@" @@ -271,7 +271,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_TwoParametersOnSameLine2() { await VerifyDiagnosticAndFixAsync(@" @@ -298,7 +298,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_Comment() { await VerifyDiagnosticAndFixAsync(@" @@ -324,7 +324,7 @@ void M( // x "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_FirstParameterIsMultilineLambda() { await VerifyDiagnosticAndFixAsync(@" @@ -359,7 +359,7 @@ void M(Func x, object y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_FirstParameterIsMultilineLambda2() { await VerifyDiagnosticAndFixAsync(@" @@ -394,7 +394,7 @@ void M(Func x, object y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_SecondParameterIsMultilineLambdaWithExpressionBody() { await VerifyDiagnosticAndFixAsync(@" @@ -426,7 +426,7 @@ void M(object x, Func y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_SecondParameterIsMultilineLambdaWithBlockBody() { await VerifyDiagnosticAndFixAsync(@" @@ -464,7 +464,7 @@ void M(object x, Func y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_SecondParameterIsMultilineLambdaWithBlockBody2() { await VerifyDiagnosticAndFixAsync(@" @@ -500,7 +500,7 @@ void M(object x, Func y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_MultilineLambda() { await VerifyDiagnosticAndFixAsync(@" @@ -540,7 +540,7 @@ void M(Func x, string y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_MultilineLambda2() { await VerifyDiagnosticAndFixAsync(@" @@ -572,7 +572,7 @@ void M(Func x) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_IndentationsDiffer() { await VerifyDiagnosticAndFixAsync(@" @@ -598,7 +598,7 @@ void M(object x, string y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_IndentationsDiffer_Tab() { await VerifyDiagnosticAndFixAsync(@" @@ -624,7 +624,7 @@ void M(object x, string y) ", options: Options.SetConfigOption("indent_style", "tab")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_SecondParameterIsAlreadyIndented() { await VerifyDiagnosticAndFixAsync(@" @@ -661,7 +661,7 @@ void M(string x, IEnumerable y) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_ConditionalExpression() { await VerifyDiagnosticAndFixAsync(""" @@ -689,7 +689,7 @@ void M(string x, string y) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_SingleMultilineParameter_WrongIndentation() { await VerifyDiagnosticAndFixAsync(""" @@ -715,7 +715,7 @@ void M(string x) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_SingleMultilineParameter_WrongIndentation2() { await VerifyDiagnosticAndFixAsync(@" @@ -745,7 +745,7 @@ void M(string x) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_SingleMultilineParameter_NoIndentation() { await VerifyDiagnosticAndFixAsync(""" @@ -771,7 +771,7 @@ void M(string x) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_BaseConstructorArguments() { await VerifyDiagnosticAndFixAsync(""" @@ -811,7 +811,7 @@ public B(string x, string y) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_BaseConstructorArguments2() { await VerifyDiagnosticAndFixAsync(""" @@ -853,7 +853,7 @@ public B(string x, string y) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_StringLiteral() { await VerifyDiagnosticAndFixAsync(""" @@ -885,7 +885,7 @@ void M(string x, string y) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_AttributeList() { await VerifyDiagnosticAndFixAsync(""" @@ -916,7 +916,7 @@ enum E """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_AttributeList_NotIndented() { await VerifyDiagnosticAndFixAsync(""" @@ -947,7 +947,7 @@ enum E """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_BaseList() { await VerifyDiagnosticAndFixAsync(@" @@ -978,7 +978,7 @@ interface IC : "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_OneOfParametersIsMultiline() { await VerifyDiagnosticAndFixAsync(@" @@ -1003,7 +1003,7 @@ string y "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_TupleType() { await VerifyDiagnosticAndFixAsync(@" @@ -1033,7 +1033,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_TupleExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -1057,7 +1057,7 @@ void M(( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_TupleExpression_LocalDeclaration() { await VerifyDiagnosticAndFixAsync(@" @@ -1082,7 +1082,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_ArrayInitializer() { await VerifyDiagnosticAndFixAsync(""" @@ -1111,7 +1111,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task Test_Multiline_PreprocessorDirectives() { await VerifyDiagnosticAndFixAsync(""" @@ -1153,7 +1153,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_Singleline() { await VerifyNoDiagnosticAsync(@" @@ -1171,7 +1171,7 @@ void M2( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_Multiline() { await VerifyNoDiagnosticAsync(@" @@ -1191,7 +1191,7 @@ void M2( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_Multiline2() { await VerifyNoDiagnosticAsync(@" @@ -1207,7 +1207,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_SingleParameterIsMultilineLambdaWithExpressionBody() { await VerifyNoDiagnosticAsync(@" @@ -1225,7 +1225,7 @@ void M(Func func) "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_SingleParameterIsMultilineLambdaWithExpressionBody2() { await VerifyNoDiagnosticAsync(@" @@ -1244,7 +1244,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_SingleParameterIsMultilineLambdaWithExpressionBody3() { await VerifyNoDiagnosticAsync(@" @@ -1262,7 +1262,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_SingleMultilineParameter() { await VerifyNoDiagnosticAsync(""" @@ -1278,7 +1278,7 @@ void M(string x) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_ArrayInitializerWithMultilineComment() { await VerifyNoDiagnosticAsync(""" @@ -1295,7 +1295,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_LambdaBlockBodyInGlobalStatement() { await VerifyNoDiagnosticAsync(""" @@ -1315,7 +1315,7 @@ await VerifyNoDiagnosticAsync(""" """, options: Options.WithCompilationOptions(Options.CompilationOptions.WithOutputKind(OutputKind.ConsoleApplication))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_ArrayInitializerInGlobalStatement() { await VerifyNoDiagnosticAsync(""" @@ -1339,7 +1339,7 @@ internal static void Method(Foo[] foo) ", }, options: Options.WithCompilationOptions(Options.CompilationOptions.WithOutputKind(OutputKind.ConsoleApplication))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_Multiline_ObjectInitializer() { await VerifyNoDiagnosticAsync(""" @@ -1362,7 +1362,7 @@ C M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_Multiline_CollectionExpression() { await VerifyNoDiagnosticAsync(""" @@ -1404,7 +1404,7 @@ public string M2(string value, string[] values) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfList)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfList)] public async Task TestNoDiagnostic_Multiline_SwitchExpression() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0054FixFormattingOfCallChainTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0054FixFormattingOfCallChainTests.cs index 13710453f5..75c24d310d 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0054FixFormattingOfCallChainTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0054FixFormattingOfCallChainTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0054FixFormattingOfCallChainTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FixFormattingOfCallChain; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.FixFormattingOfCallChain; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_WrongIndentation() { await VerifyDiagnosticAndFixAsync(@" @@ -40,7 +40,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_WrongIndentation_NullConditionalOperator() { await VerifyDiagnosticAndFixAsync(@" @@ -68,7 +68,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_Invocation_NoIndentation() { await VerifyDiagnosticAndFixAsync(@" @@ -96,7 +96,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_Invocation_NoIndentation_EmptyLineBetween() { await VerifyDiagnosticAndFixAsync(@" @@ -124,7 +124,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_Invocation_WrapAndIndent() { await VerifyDiagnosticAndFixAsync(@" @@ -153,7 +153,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_Invocation_WrapAndIndent_NullConditionalOperator_NewLineBefore() { await VerifyDiagnosticAndFixAsync(@" @@ -182,7 +182,7 @@ C M() ", options: Options.AddConfigOption(ConfigOptionKeys.NullConditionalOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_Invocation_WrapAndIndent_NullConditionalOperator_NewLineAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -211,7 +211,7 @@ C M() ", options: Options.AddConfigOption(ConfigOptionKeys.NullConditionalOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_Invocation_EmptyLineBetween() { await VerifyDiagnosticAndFixAsync(@" @@ -240,7 +240,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_Invocation_CommentBetween() { await VerifyDiagnosticAndFixAsync(@" @@ -270,7 +270,7 @@ C M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_Invocation_IndentationsDiffer() { await VerifyDiagnosticAndFixAsync(""" @@ -314,7 +314,7 @@ C M(string s) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_TopLevelStatement_SwitchStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -342,7 +342,7 @@ await VerifyDiagnosticAndFixAsync(""" """, options: Options.WithCompilationOptions(Options.CompilationOptions.WithOutputKind(OutputKind.ConsoleApplication))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_TopLevelStatement_ForEachStatement() { await VerifyDiagnosticAndFixAsync(""" @@ -368,7 +368,7 @@ await VerifyDiagnosticAndFixAsync(""" """, options: Options.WithCompilationOptions(Options.CompilationOptions.WithOutputKind(OutputKind.ConsoleApplication))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_TopLevelStatement() { await VerifyNoDiagnosticAsync(@" @@ -386,7 +386,7 @@ void Main(string[] args) ", options: Options.WithCompilationOptions(Options.CompilationOptions.WithOutputKind(OutputKind.ConsoleApplication))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_TopLevelStatement2() { await VerifyDiagnosticAndFixAsync(""" @@ -402,7 +402,7 @@ await VerifyDiagnosticAndFixAsync(""" """, options: Options.WithCompilationOptions(Options.CompilationOptions.WithOutputKind(OutputKind.ConsoleApplication))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task Test_TopLevelStatement3() { await VerifyDiagnosticAndFixAsync(""" @@ -419,7 +419,7 @@ await VerifyDiagnosticAndFixAsync(""" """, options: Options.WithCompilationOptions(Options.CompilationOptions.WithOutputKind(OutputKind.ConsoleApplication))); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfCallChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfCallChain)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0055FixFormattingOfBinaryExpressionChainTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0055FixFormattingOfBinaryExpressionChainTests.cs index fe15b60b98..b798c72350 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0055FixFormattingOfBinaryExpressionChainTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0055FixFormattingOfBinaryExpressionChainTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0055FixFormattingOfBinaryExpressionChainTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.FixFormattingOfBinaryExpressionChain; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.FixFormattingOfBinaryExpressionChain; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task Test_NotWrapped() { await VerifyDiagnosticAndFixAsync(@" @@ -41,7 +41,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task Test_NotWrapped2() { await VerifyDiagnosticAndFixAsync(@" @@ -70,7 +70,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task Test_NoIndentation() { await VerifyDiagnosticAndFixAsync(@" @@ -100,7 +100,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task Test_NoIndentation2() { await VerifyDiagnosticAndFixAsync(""" @@ -128,7 +128,7 @@ string M(string x) """, options: Options.AddConfigOption(ConfigOptionKeys.BinaryOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task Test_WrongIndentation() { await VerifyDiagnosticAndFixAsync(@" @@ -158,7 +158,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task Test_StartsOnSeparateLine() { await VerifyDiagnosticAndFixAsync(@" @@ -189,7 +189,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task Test_LeftIsMultiline_RightIsSingleLine() { await VerifyDiagnosticAndFixAsync(""" @@ -220,7 +220,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task Test_NestedBinaryExpressionOfDifferentKind() { await VerifyDiagnosticAndFixAsync(""" @@ -256,7 +256,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task TestDiagnostic_StringConcatInsideTopLevelAttribute() { await VerifyDiagnosticAndFixAsync(""" @@ -282,7 +282,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task TestNoDiagnostic() { await VerifyNoDiagnosticAsync(@" @@ -299,7 +299,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.FixFormattingOfBinaryExpressionChain)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.FixFormattingOfBinaryExpressionChain)] public async Task TestNoDiagnostic_StartsOnSeparateLine() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0056LineIsTooLongTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0056LineIsTooLongTests.cs index 264f236e41..f9f4a1fc67 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0056LineIsTooLongTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0056LineIsTooLongTests.cs @@ -10,11 +10,11 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0056LineIsTooLongTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.LineIsTooLong; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.LineIsTooLong; public override CSharpTestOptions Options => base.Options.AddConfigOption(ConfigOptionKeys.MaxLineLength, "125"); - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_ExpressionBody_AddNewLineBeforeArrow() { await VerifyDiagnosticAndFixAsync(@" @@ -32,7 +32,7 @@ string M(object pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_ExpressionBody_AddNewLineAfterArrow() { await VerifyDiagnosticAndFixAsync(@" @@ -50,7 +50,7 @@ string M(object pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp ", options: Options.AddConfigOption(ConfigOptionKeys.ArrowTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_ParameterList() { await VerifyDiagnosticAndFixAsync(@" @@ -75,7 +75,7 @@ void M( ", options: Options.AddConfigOption(ConfigOptionKeys.ArrowTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_ArgumentList() { await VerifyDiagnosticAndFixAsync(@" @@ -110,7 +110,7 @@ void M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_ArgumentList_PreferOuterArgumentList() { await VerifyDiagnosticAndFixAsync(@" @@ -145,7 +145,7 @@ string M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferArgumentListOverCallChain() { await VerifyDiagnosticAndFixAsync(@" @@ -177,7 +177,7 @@ C M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferArgumentListOverCallChain2() { await VerifyDiagnosticAndFixAsync(@" @@ -206,7 +206,7 @@ C M( "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferArgumentListOverCallChain_WhenLeftIsSimpleName() { await VerifyDiagnosticAndFixAsync(@" @@ -247,7 +247,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferArgumentListOverCallChain_WhenLeftIsCastExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -288,7 +288,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferArgumentListOverBinaryExpression() { await VerifyDiagnosticAndFixAsync(""" @@ -325,7 +325,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferArgumentListOverBinaryExpression2() { await VerifyDiagnosticAndFixAsync(@" @@ -369,7 +369,7 @@ static class E "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_BracketedArgumentList() { await VerifyDiagnosticAndFixAsync(""" @@ -401,7 +401,7 @@ string M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_CallChain() { await VerifyDiagnosticAndFixAsync(@" @@ -428,7 +428,7 @@ string Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_CallChain_SimpleMemberAccess() { await VerifyDiagnosticAndFixAsync(@" @@ -458,7 +458,7 @@ static string Pxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferCallChainOverArgumentList() { await VerifyDiagnosticAndFixAsync(@" @@ -486,7 +486,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferCallChainOverArgumentList2() { await VerifyDiagnosticAndFixAsync(@" @@ -516,7 +516,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferCallChainOverArgumentList3() { await VerifyDiagnosticAndFixAsync(""" @@ -550,7 +550,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_BinaryExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -583,7 +583,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_InitializerExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -611,7 +611,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PropertyInitializer() { await VerifyDiagnosticAndFixAsync(""" @@ -629,7 +629,7 @@ class C """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_FieldInitializer() { await VerifyDiagnosticAndFixAsync(""" @@ -647,7 +647,7 @@ private string _f """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_LocalDeclaration() { await VerifyDiagnosticAndFixAsync(""" @@ -671,7 +671,7 @@ var xxxxxxxxxxxxxxxx """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_Assignment() { await VerifyDiagnosticAndFixAsync(@" @@ -699,7 +699,7 @@ string x "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_Assignment2() { await VerifyDiagnosticAndFixAsync(@" @@ -727,7 +727,7 @@ string x "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_AttributeList() { await VerifyDiagnosticAndFixAsync(""" @@ -763,7 +763,7 @@ class FooAttribute : Attribute """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_AttributeArgumentList() { await VerifyDiagnosticAndFixAsync(""" @@ -800,7 +800,7 @@ class FooAttribute : Attribute """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_ConditionalExpression() { await VerifyDiagnosticAndFixAsync(""" @@ -829,7 +829,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_PreferConditionalExpressionOverCallChain() { await VerifyDiagnosticAndFixAsync(""" @@ -860,7 +860,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_ForStatement() { await VerifyDiagnosticAndFixAsync(@" @@ -898,7 +898,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_BaseList() { await VerifyDiagnosticAndFixAsync(@" @@ -936,7 +936,7 @@ interface Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task Test_BaseList_Constraint() { await VerifyDiagnosticAndFixAsync(@" @@ -975,7 +975,7 @@ interface Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoFix_ExpressionBody_TooLongAfterWrapping() { await VerifyDiagnosticAndNoFixAsync(@" @@ -986,7 +986,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoFix_ExpressionBody_TooLongAfterWrapping2() { await VerifyDiagnosticAndNoFixAsync(@" @@ -997,7 +997,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.ArrowTokenNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoFix_ExpressionBody_AlreadyWrapped() { await VerifyNoDiagnosticAsync( @@ -1010,7 +1010,7 @@ string M(object p) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoFix_ExpressionBody_AlreadyWrapped2() { await VerifyNoDiagnosticAsync(""" @@ -1022,7 +1022,7 @@ string M(object p) => """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_Banner() { await VerifyNoDiagnosticAsync(@"//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -1033,7 +1033,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_DoNotWrapNameof() { await VerifyDiagnosticAndNoFixAsync(@" @@ -1047,7 +1047,7 @@ string M(string xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_DocumentationComment() { await VerifyNoDiagnosticAsync(@" @@ -1063,7 +1063,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_SingleLineComment() { await VerifyNoDiagnosticAsync(@" @@ -1078,7 +1078,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_StringLiteral() { await VerifyNoDiagnosticAsync(""" @@ -1098,7 +1098,7 @@ void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_ThisExpression_BaseExpression() { await VerifyDiagnosticAndFixAsync(@" @@ -1146,7 +1146,7 @@ public C Pxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_EnumField() { await VerifyDiagnosticAndNoFixAsync(@" @@ -1163,7 +1163,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_Namespace() { await VerifyDiagnosticAndNoFixAsync(@" @@ -1181,7 +1181,7 @@ void M() "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_LongStringLiteral_Argument() { await VerifyNoDiagnosticAsync(""" @@ -1197,7 +1197,7 @@ static void M(string x, string y) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_LongStringLiteral_AttributeArgument() { await VerifyNoDiagnosticAsync(""" @@ -1214,7 +1214,7 @@ static void M() """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_LongStringLiteral_AttributeArgument2() { await VerifyNoDiagnosticAsync(""" @@ -1236,7 +1236,7 @@ class MyAttribute : Attribute """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_LongVerbatimStringLiteral() { await VerifyNoDiagnosticAsync(""" @@ -1254,7 +1254,7 @@ static void M(string x, int y) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_LongInterpolatedString() { await VerifyNoDiagnosticAsync(""" @@ -1270,7 +1270,7 @@ static void M(string x, string y) """); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_LongRawInterpolatedString() { await VerifyNoDiagnosticAsync("""" @@ -1289,7 +1289,7 @@ static void M(string x, int y) """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_LongRawStringLiteral() { await VerifyNoDiagnosticAsync("""" @@ -1308,7 +1308,7 @@ static void M(string x, int y) """"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.LineIsTooLong)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.LineIsTooLong)] public async Task TestNoDiagnostic_LongRawStringLiteral2() { await VerifyNoDiagnosticAsync("""" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0057NormalizeWhitespaceAtBeginningOfFileTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0057NormalizeWhitespaceAtBeginningOfFileTests.cs index fc61278339..7a8370e417 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0057NormalizeWhitespaceAtBeginningOfFileTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0057NormalizeWhitespaceAtBeginningOfFileTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0057NormalizeWhitespaceAtBeginningOfFileTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.NormalizeWhitespaceAtBeginningOfFile; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.NormalizeWhitespaceAtBeginningOfFile; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile)] public async Task Test() { await VerifyDiagnosticAndFixAsync(@"[||] @@ -23,7 +23,7 @@ class C }"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile)] public async Task Test_TrailingWhitespace() { await VerifyDiagnosticAndFixAsync(@"[||] @@ -34,7 +34,7 @@ class C }"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile)] public async Task Test_TrailingMany() { await VerifyDiagnosticAndFixAsync(@"[||] @@ -47,7 +47,7 @@ class C }"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile)] public async Task Test_SingleLineComment() { await VerifyDiagnosticAndFixAsync(@"[||] @@ -60,7 +60,7 @@ class C }"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile)] public async Task Test_MultiLineComment() { await VerifyDiagnosticAndFixAsync(@"[||] @@ -73,7 +73,7 @@ class C }"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile)] public async Task Test_Directive() { await VerifyDiagnosticAndFixAsync(@"[||] @@ -88,7 +88,7 @@ class C #endregion"); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtBeginningOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtBeginningOfFile)] public async Task Test_WhitespaceOnly() { await VerifyDiagnosticAndFixAsync(@"[||] class C diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0058NormalizeWhitespaceAtEndOfFileTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0058NormalizeWhitespaceAtEndOfFileTests.cs index 8c0a306448..e9c135da69 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0058NormalizeWhitespaceAtEndOfFileTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0058NormalizeWhitespaceAtEndOfFileTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0058NormalizeWhitespaceAtEndOfFileTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.NormalizeWhitespaceAtEndOfFile; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.NormalizeWhitespaceAtEndOfFile; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NewLineAtEndOfFile() { await VerifyDiagnosticAndFixAsync(@" @@ -25,7 +25,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NewLineAtEndOfFile_EmptyFile() { await VerifyDiagnosticAndFixAsync(@" @@ -33,7 +33,7 @@ await VerifyDiagnosticAndFixAsync(@" "", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NewLineAtEndOfFile_TrailingWhitespace() { await VerifyDiagnosticAndFixAsync(@" @@ -46,7 +46,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NewLineAtEndOfFile_TrailingMany() { await VerifyDiagnosticAndFixAsync(@" @@ -59,7 +59,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NewLineAtEndOfFile_SingleLineComment() { await VerifyDiagnosticAndFixAsync(@" @@ -74,7 +74,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NewLineAtEndOfFile_MultiLineComment() { await VerifyDiagnosticAndFixAsync(@" @@ -89,7 +89,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NewLineAtEndOfFile_Directive() { await VerifyDiagnosticAndFixAsync(@" @@ -106,7 +106,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NoNewLineAtEndOfFile() { await VerifyDiagnosticAndFixAsync(@" @@ -119,7 +119,7 @@ class C }", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NoNewLineAtEndOfFile_EmptyFile() { await VerifyDiagnosticAndFixAsync(@" @@ -127,7 +127,7 @@ await VerifyDiagnosticAndFixAsync(@" "", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NoNewLineAtEndOfFile_TrailingWhitespace() { await VerifyDiagnosticAndFixAsync(@" @@ -140,7 +140,7 @@ class C }", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NoNewLineAtEndOfFile_TrailingMany() { await VerifyDiagnosticAndFixAsync(@" @@ -155,7 +155,7 @@ class C }", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NoNewLineAtEndOfFile_SingleLineComment() { await VerifyDiagnosticAndFixAsync(@" @@ -170,7 +170,7 @@ class C //x", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NoNewLineAtEndOfFile_MultiLineComment() { await VerifyDiagnosticAndFixAsync(@" @@ -185,7 +185,7 @@ class C /** x **/", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task Test_NoNewLineAtEndOfFile_Directive() { await VerifyDiagnosticAndFixAsync(@" @@ -202,7 +202,7 @@ class C #endif", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task TestNoDiagnostic_NewLineAtEndOfFile() { await VerifyNoDiagnosticAsync(@" @@ -212,7 +212,7 @@ class C "); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task TestNoDiagnostic_NoNewLineAtEndOfFile() { await VerifyNoDiagnosticAsync(@" @@ -221,7 +221,7 @@ class C }", options: Options.AddConfigOption(ConfigOptionKeys.NewLineAtEndOfFile, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.NormalizeWhitespaceAtEndOfFile)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.NormalizeWhitespaceAtEndOfFile)] public async Task TestNoDiagnostic_IfDirective() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0059PlaceNewLineAfterOrBeforeNullConditionalOperatorTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0059PlaceNewLineAfterOrBeforeNullConditionalOperatorTests.cs index b7ed1ef912..e2550a2cb6 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0059PlaceNewLineAfterOrBeforeNullConditionalOperatorTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0059PlaceNewLineAfterOrBeforeNullConditionalOperatorTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0059PlaceNewLineAfterOrBeforeNullConditionalOperatorTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.PlaceNewLineAfterOrBeforeNullConditionalOperator; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.PlaceNewLineAfterOrBeforeNullConditionalOperator; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator)] public async Task Test_BeforeInsteadOfAfter() { await VerifyDiagnosticAndFixAsync(""" @@ -44,7 +44,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.NullConditionalOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator)] public async Task Test_AfterInsteadOfBefore() { await VerifyDiagnosticAndFixAsync(""" @@ -76,7 +76,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.NullConditionalOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator)] public async Task Test_AfterInsteadOfBefore2() { await VerifyDiagnosticAndFixAsync(@" @@ -106,7 +106,7 @@ void M() ", options: Options.AddConfigOption(ConfigOptionKeys.NullConditionalOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator)] public async Task TestNoDiagnostic_BeforeInsteadOfAfter() { await VerifyNoDiagnosticAsync(""" @@ -125,7 +125,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.NullConditionalOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator)] public async Task TestNoDiagnostic_BeforeInsteadOfAfter_SingleLine() { await VerifyNoDiagnosticAsync(""" @@ -143,7 +143,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.NullConditionalOperatorNewLine, "before")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator)] public async Task TestNoDiagnostic_AfterInsteadOfBefore() { await VerifyNoDiagnosticAsync(""" @@ -162,7 +162,7 @@ void M() """, options: Options.AddConfigOption(ConfigOptionKeys.NullConditionalOperatorNewLine, "after")); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.PlaceNewLineAfterOrBeforeNullConditionalOperator)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.PlaceNewLineAfterOrBeforeNullConditionalOperator)] public async Task TestNoDiagnostic_AfterInsteadOfBefore_SingleLine() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0060AddEmptyLineAfterFileScopedNamespaceTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0060AddEmptyLineAfterFileScopedNamespaceTests.cs index d8a355e810..5426343cff 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0060AddEmptyLineAfterFileScopedNamespaceTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0060AddEmptyLineAfterFileScopedNamespaceTests.cs @@ -11,9 +11,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0060BlankLineAfterFileScopedNamespaceDeclarationTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.BlankLineAfterFileScopedNamespaceDeclaration; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.BlankLineAfterFileScopedNamespaceDeclaration; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -30,7 +30,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine2() { await VerifyDiagnosticAndFixAsync(@" @@ -47,7 +47,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine3() { await VerifyDiagnosticAndFixAsync(@" @@ -64,7 +64,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine4() { await VerifyDiagnosticAndFixAsync(@" @@ -81,7 +81,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine5() { await VerifyDiagnosticAndFixAsync(@" @@ -97,7 +97,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine6() { await VerifyDiagnosticAndFixAsync(@" @@ -113,7 +113,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine7() { await VerifyDiagnosticAndFixAsync(@" @@ -130,7 +130,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine8() { await VerifyDiagnosticAndFixAsync(@" @@ -153,7 +153,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_AddEmptyLine9() { await VerifyDiagnosticAndFixAsync(@" @@ -172,7 +172,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_RemoveEmptyLine_UsingAfter() { await VerifyDiagnosticAndFixAsync(@" @@ -193,7 +193,7 @@ public class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, true)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_RemoveEmptyLine() { await VerifyDiagnosticAndFixAsync(@" @@ -210,7 +210,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_RemoveEmptyLine2() { await VerifyDiagnosticAndFixAsync(@" @@ -227,7 +227,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_RemoveEmptyLine3() { await VerifyDiagnosticAndFixAsync(@" @@ -244,7 +244,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_RemoveEmptyLine4() { await VerifyDiagnosticAndFixAsync(@" @@ -261,7 +261,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task Test_RemoveEmptyLine5() { await VerifyDiagnosticAndFixAsync(@" @@ -279,7 +279,7 @@ class C ", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task TestNoDiagnostic_EmptyFileWithComment() { await VerifyNoDiagnosticAsync(@" @@ -288,7 +288,7 @@ namespace A.B; // x", options: Options.AddConfigOption(ConfigOptionKeys.BlankLineAfterFileScopedNamespaceDeclaration, false)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineAfterFileScopedNamespaceDeclaration)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineAfterFileScopedNamespaceDeclaration)] public async Task TestNoDiagnostic_EmptyFileWithComment2() { await VerifyNoDiagnosticAsync(@" diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0061BlankLineBetweenSwitchSectionsTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0061BlankLineBetweenSwitchSectionsTests.cs index 1435fb9fcf..cc5ebb943c 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0061BlankLineBetweenSwitchSectionsTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0061BlankLineBetweenSwitchSectionsTests.cs @@ -10,9 +10,9 @@ namespace Roslynator.Formatting.CSharp.Tests; public class RCS0061BlankLineBetweenSwitchSectionsTests : AbstractCSharpDiagnosticVerifier { - public override DiagnosticDescriptor Descriptor { get; } = DiagnosticRules.BlankLineBetweenSwitchSections; + public override DiagnosticDescriptor Descriptor { get; } = FormattingDiagnosticRules.BlankLineBetweenSwitchSections; - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSwitchSections)] public async Task Test_Statement_Include() { await VerifyDiagnosticAndFixAsync(""" @@ -54,7 +54,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSwitchSections, ConfigOptionValues.BlankLineBetweenSwitchSections_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSwitchSections)] public async Task Test_Statement_Omit() { await VerifyDiagnosticAndFixAsync(""" @@ -97,7 +97,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSwitchSections, ConfigOptionValues.BlankLineBetweenSwitchSections_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSwitchSections)] public async Task Test_Statement_OmitAfterBlock() { await VerifyDiagnosticAndFixAsync(""" @@ -147,7 +147,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSwitchSections, ConfigOptionValues.BlankLineBetweenSwitchSections_OmitAfterBlock)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSwitchSections)] public async Task Test_Block_Include() { await VerifyDiagnosticAndFixAsync(""" @@ -197,7 +197,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSwitchSections, ConfigOptionValues.BlankLineBetweenSwitchSections_Include)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSwitchSections)] public async Task Test_Block_Omit() { await VerifyDiagnosticAndFixAsync(""" @@ -248,7 +248,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSwitchSections, ConfigOptionValues.BlankLineBetweenSwitchSections_Omit)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSwitchSections)] public async Task Test_Block_OmitAfterBlock() { await VerifyDiagnosticAndFixAsync(""" @@ -299,7 +299,7 @@ string M() """, options: Options.AddConfigOption(ConfigOptionKeys.BlankLineBetweenSwitchSections, ConfigOptionValues.BlankLineBetweenSwitchSections_OmitAfterBlock)); } - [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.BlankLineBetweenSwitchSections)] + [Fact, Trait(Traits.Analyzer, FormattingDiagnosticIds.BlankLineBetweenSwitchSections)] public async Task TestNoDiagnostic_IfDirective() { await VerifyNoDiagnosticAsync(""" diff --git a/src/Tools/CodeGenerator/Program.cs b/src/Tools/CodeGenerator/Program.cs index 08f479e8df..b339754092 100644 --- a/src/Tools/CodeGenerator/Program.cs +++ b/src/Tools/CodeGenerator/Program.cs @@ -38,66 +38,66 @@ private static void Main(string[] args) ImmutableArray options = metadata.ConfigOptions; WriteCompilationUnit( - @"Refactorings\CSharp\RefactoringDescriptors.Generated.cs", + "Refactorings/CSharp/RefactoringDescriptors.Generated.cs", RefactoringDescriptorsGenerator.Generate(refactorings.Where(f => !f.IsObsolete), comparer: comparer)); WriteCompilationUnit( - @"Refactorings\CSharp\RefactoringIdentifiers.Generated.cs", + "Refactorings/CSharp/RefactoringIdentifiers.Generated.cs", RefactoringIdentifiersGenerator.Generate(refactorings, obsolete: false, comparer: comparer)); WriteCompilationUnit( - @"VisualStudio\RefactoringsOptionsPage.Generated.cs", + "VisualStudio/RefactoringsOptionsPage.Generated.cs", RefactoringsOptionsPageGenerator.Generate(refactorings.Where(f => !f.IsObsolete), comparer)); - WriteDiagnostics(@"Analyzers\CSharp", metadata.CommonAnalyzers, @namespace: "Roslynator.CSharp", categoryName: nameof(DiagnosticCategories.Roslynator)); + WriteDiagnostics("Common/CSharp", metadata.CommonAnalyzers, @namespace: "Roslynator.CSharp", categoryName: nameof(DiagnosticCategories.Roslynator), descriptorsClassName: "DiagnosticRules", identifiersClassName: "DiagnosticIds"); - WriteDiagnostics(@"CodeAnalysis.Analyzers\CSharp", metadata.CodeAnalysisAnalyzers, @namespace: "Roslynator.CodeAnalysis.CSharp", categoryName: nameof(DiagnosticCategories.Roslynator)); + WriteDiagnostics("Common/CodeAnalysis/CSharp", metadata.CodeAnalysisAnalyzers, @namespace: "Roslynator.CodeAnalysis.CSharp", categoryName: nameof(DiagnosticCategories.Roslynator), descriptorsClassName: "CodeAnalysisDiagnosticRules", identifiersClassName: "CodeAnalysisDiagnosticIds"); - WriteDiagnostics(@"Formatting.Analyzers\CSharp", metadata.FormattingAnalyzers, @namespace: "Roslynator.Formatting.CSharp", categoryName: nameof(DiagnosticCategories.Roslynator)); + WriteDiagnostics("Common/Formatting/CSharp", metadata.FormattingAnalyzers, @namespace: "Roslynator.Formatting.CSharp", categoryName: nameof(DiagnosticCategories.Roslynator), descriptorsClassName: "FormattingDiagnosticRules", identifiersClassName: "FormattingDiagnosticIds"); WriteCompilationUnit( - @"CodeFixes\CSharp\CompilerDiagnosticRules.Generated.cs", + "CodeFixes/CSharp/CompilerDiagnosticRules.Generated.cs", CompilerDiagnosticRulesGenerator.Generate(compilerDiagnostics, comparer: comparer, @namespace: "Roslynator.CSharp"), normalizeWhitespace: false); WriteCompilationUnit( - @"CodeFixes\CSharp\CodeFixDescriptors.Generated.cs", + "CodeFixes/CSharp/CodeFixDescriptors.Generated.cs", CodeFixDescriptorsGenerator.Generate(codeFixes.Where(f => !f.IsObsolete), comparer: comparer, @namespace: "Roslynator.CSharp"), normalizeWhitespace: false); WriteCompilationUnit( - @"CodeFixes\CSharp\CodeFixIdentifiers.Generated.cs", + "CodeFixes/CSharp/CodeFixIdentifiers.Generated.cs", CodeFixIdentifiersGenerator.Generate(codeFixes, comparer)); WriteCompilationUnit( - @"VisualStudio\CodeFixesOptionsPage.Generated.cs", + "VisualStudio/CodeFixesOptionsPage.Generated.cs", CodeFixesOptionsPageGenerator.Generate()); WriteCompilationUnit( - @"CSharp\CSharp\CompilerDiagnosticIdentifiers.Generated.cs", + "CSharp/CSharp/CompilerDiagnosticIdentifiers.Generated.cs", CompilerDiagnosticIdentifiersGenerator.Generate(compilerDiagnostics, comparer)); WriteCompilationUnit( - @"Common\ConfigOptions.Generated.cs", + "Common/ConfigOptions.Generated.cs", Roslynator.CodeGeneration.CSharp.CodeGenerator.GenerateConfigOptions(options, metadata.Analyzers), normalizeWhitespace: false); WriteCompilationUnit( - @"Common\LegacyConfigOptions.Generated.cs", + "Common/LegacyConfigOptions.Generated.cs", Roslynator.CodeGeneration.CSharp.CodeGenerator.GenerateLegacyConfigOptions(metadata.Analyzers)); WriteCompilationUnit( - @"Common\ConfigOptionKeys.Generated.cs", + "Common/ConfigOptionKeys.Generated.cs", Roslynator.CodeGeneration.CSharp.CodeGenerator.GenerateConfigOptionKeys(options), normalizeWhitespace: false); WriteCompilationUnit( - @"Common\ConfigOptionValues.Generated.cs", + "Common/ConfigOptionValues.Generated.cs", Roslynator.CodeGeneration.CSharp.CodeGenerator.GenerateConfigOptionValues(options), normalizeWhitespace: false); File.WriteAllText( - Path.Combine(rootPath, @"VisualStudioCode\package\src\configurationFiles.generated.ts"), + Path.Combine(rootPath, "VisualStudioCode/package/src/configurationFiles.generated.ts"), @"export const configurationFileContent = { roslynatorconfig: `" + EditorConfigCodeAnalysisConfig.FileDefaultContent @@ -125,11 +125,13 @@ void WriteDiagnostics( WriteCompilationUnit( Path.Combine(dirPath, $"{descriptorsClassName}.Generated.cs"), DiagnosticRulesGenerators.Default.Generate(analyzers.Where(f => f.Status != AnalyzerStatus.Disabled), comparer: comparer, @namespace: @namespace, className: descriptorsClassName, identifiersClassName: identifiersClassName, categoryName: categoryName), - normalizeWhitespace: false); + normalizeWhitespace: false, + fileMustExist: false); WriteCompilationUnit( Path.Combine(dirPath, $"{identifiersClassName}.Generated.cs"), - DiagnosticIdentifiersGenerator.Generate(analyzers.Where(f => f.Status != AnalyzerStatus.Disabled), comparer: comparer, @namespace: @namespace, className: identifiersClassName)); + DiagnosticIdentifiersGenerator.Generate(analyzers.Where(f => f.Status != AnalyzerStatus.Disabled), comparer: comparer, @namespace: @namespace, className: identifiersClassName), + fileMustExist: false); } void WriteCompilationUnit( diff --git a/src/VisualStudioCode/package/src/configurationFiles.generated.ts b/src/VisualStudioCode/package/src/configurationFiles.generated.ts deleted file mode 100644 index 4af6961de1..0000000000 --- a/src/VisualStudioCode/package/src/configurationFiles.generated.ts +++ /dev/null @@ -1,1338 +0,0 @@ -export const configurationFileContent = { - roslynatorconfig: `# Roslynator Config File - -is_global = true - -# Options in this file can be used to change default configuration of analyzers, refactorings and compiler diagnostic fixes. -# Default configuration is loaded once when IDE starts. Therefore, it may be necessary to restart IDE for changes to take effect. -# Full list of available options: https://josefpihrt.github.io/docs/roslynator/configuration - -# Set severity for all analyzers that are enabled by default (https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#set-rule-severity-of-multiple-analyzer-rules-at-once-in-an-editorconfig-file) -dotnet_analyzer_diagnostic.category-roslynator.severity = default|none|silent|suggestion|warning|error - -# Enable/disable all analyzers by default. -# NOTE: This option can be used only in .roslynatorconfig file -roslynator_analyzers.enabled_by_default = true|false - -## Set severity for a specific analyzer -#dotnet_diagnostic..severity = default|none|silent|suggestion|warning|error - -## Enable/disable all refactorings -#roslynator_refactorings.enabled = true|false - -## Enable/disable specific refactoring -#roslynator_refactoring..enabled = true|false - -## Enable/disable all compiler diagnostic fixes -#roslynator_compiler_diagnostic_fixes.enabled = true|false - -## Enable/disable specific compiler diagnostic fix -#roslynator_compiler_diagnostic_fix..enabled = true|false - -# Options - -#roslynator_accessibility_modifiers = explicit|implicit -# Applicable to: rcs1018 - -#roslynator_accessor_braces_style = multi_line|single_line_when_expression_is_on_single_line -# Default: multi_line -# Applicable to: rcs0020 - -#roslynator_array_creation_type_style = explicit|implicit|implicit_when_type_is_obvious -# Applicable to: rcs1014 - -#roslynator_arrow_token_new_line = after|before -# Applicable to: rcs0032 - -#roslynator_binary_operator_new_line = after|before -# Applicable to: rcs0027 - -#roslynator_blank_line_after_file_scoped_namespace_declaration = true|false -# Applicable to: rcs0060 - -#roslynator_blank_line_between_closing_brace_and_switch_section = true|false -# Applicable to: rcs0014, rcs1036 - -#roslynator_blank_line_between_single_line_accessors = true|false -# Applicable to: rcs0011 - -#roslynator_blank_line_between_switch_sections = include|omit|omit_after_block -# Applicable to: rcs0061 - -#roslynator_blank_line_between_using_directives = never|separate_groups -# Applicable to: rcs0015 - -#roslynator_block_braces_style = multi_line|single_line_when_empty -# Default: multi_line -# Applicable to: rcs0021 - -#roslynator_body_style = block|expression -# Applicable to: rcs1016 - -#roslynator_conditional_operator_condition_parentheses_style = include|omit|omit_when_condition_is_single_token -# Applicable to: rcs1051 - -#roslynator_conditional_operator_new_line = after|before -# Applicable to: rcs0028 - -#roslynator_configure_await = true|false -# Applicable to: rcs1090 - -#roslynator_doc_comment_summary_style = multi_line|single_line -# Applicable to: rcs1253 - -#roslynator_empty_string_style = field|literal -# Applicable to: rcs1078 - -#roslynator_enum_flag_value_style = decimal_number|shift_operator -# Applicable to: rcs1254 - -#roslynator_enum_has_flag_style = method|operator -# Applicable to: rcs1096 - -#roslynator_equals_token_new_line = after|before -# Applicable to: rcs0052 - -#roslynator_infinite_loop_style = for|while -# Applicable to: rcs1252 - -#roslynator_max_line_length = -# Default: 140 -# Applicable to: rcs0056 - -#roslynator_new_line_at_end_of_file = true|false -# Applicable to: rcs0058 - -#roslynator_new_line_before_while_in_do_statement = true|false -# Applicable to: rcs0051 - -#roslynator_null_check_style = equality_operator|pattern_matching -# Applicable to: rcs1248 - -#roslynator_null_conditional_operator_new_line = after|before -# Applicable to: rcs0059 - -#roslynator_object_creation_parentheses_style = include|omit -# Applicable to: rcs1050 - -#roslynator_object_creation_type_style = explicit|implicit|implicit_when_type_is_obvious -# Applicable to: rcs1250 - -#roslynator_prefix_field_identifier_with_underscore = true|false - -#roslynator_tab_length = -# Default: 4 -# Applicable to: rcs0056 - -#roslynator_trailing_comma_style = include|omit|omit_when_single_line -# Applicable to: rcs1260 - -#roslynator_unity_code_analysis.enabled = true|false -# Applicable to: rcs1169, rcs1213 - -#roslynator_use_anonymous_function_or_method_group = anonymous_function|method_group -# Applicable to: rcs1207 - -#roslynator_use_block_body_when_declaration_spans_over_multiple_lines = true|false -# Applicable to: rcs1016 - -#roslynator_use_block_body_when_expression_spans_over_multiple_lines = true|false -# Applicable to: rcs1016 - -#roslynator_use_collection_expression = true|false -# Applicable to: rcs1014, rcs1250 - -#roslynator_use_var = always|never|when_type_is_obvious -# Applicable to: rcs1264 - -#roslynator_use_var_instead_of_implicit_object_creation = true|false -# Applicable to: rcs1250 - - -# Analyzers - -# Add blank line after embedded statement -#dotnet_diagnostic.rcs0001.severity = none - -# Add blank line after #region -#dotnet_diagnostic.rcs0002.severity = none - -# Add blank line after using directive list -#dotnet_diagnostic.rcs0003.severity = none - -# Add blank line before #endregion -#dotnet_diagnostic.rcs0005.severity = none - -# Add blank line before using directive list -#dotnet_diagnostic.rcs0006.severity = none - -# Add blank line between accessors -#dotnet_diagnostic.rcs0007.severity = none - -# Add blank line between closing brace and next statement -#dotnet_diagnostic.rcs0008.severity = none - -# Add blank line between declaration and documentation comment -#dotnet_diagnostic.rcs0009.severity = none - -# Add blank line between declarations -#dotnet_diagnostic.rcs0010.severity = none - -# Add/remove blank line between single-line accessors -#dotnet_diagnostic.rcs0011.severity = none -# Options: roslynator_blank_line_between_single_line_accessors - -# Add blank line between single-line declarations -#dotnet_diagnostic.rcs0012.severity = none - -# Add blank line between single-line declarations of different kind -#dotnet_diagnostic.rcs0013.severity = none - -# Add/remove blank line between using directives -#dotnet_diagnostic.rcs0015.severity = none -# Options: roslynator_blank_line_between_using_directives - -# Put attribute list on its own line -#dotnet_diagnostic.rcs0016.severity = none - -# Format accessor's braces on a single line or multiple lines -#dotnet_diagnostic.rcs0020.severity = none -# Options: roslynator_accessor_braces_style - -# Format block's braces on a single line or multiple lines -#dotnet_diagnostic.rcs0021.severity = none -# Options: roslynator_block_braces_style - -# Format type declaration's braces -#dotnet_diagnostic.rcs0023.severity = none - -# Add new line after switch label -#dotnet_diagnostic.rcs0024.severity = none - -# Put full accessor on its own line -#dotnet_diagnostic.rcs0025.severity = none - -# Place new line after/before binary operator -#dotnet_diagnostic.rcs0027.severity = none -# Options: roslynator_binary_operator_new_line - -# Place new line after/before '?:' operator -#dotnet_diagnostic.rcs0028.severity = none -# Options: roslynator_conditional_operator_new_line - -# Put constructor initializer on its own line -#dotnet_diagnostic.rcs0029.severity = none - -# Put embedded statement on its own line -#dotnet_diagnostic.rcs0030.severity = none - -# Put enum member on its own line -#dotnet_diagnostic.rcs0031.severity = none - -# Place new line after/before arrow token -#dotnet_diagnostic.rcs0032.severity = none -# Options: roslynator_arrow_token_new_line - -# Put statement on its own line -#dotnet_diagnostic.rcs0033.severity = none - -# Put type parameter constraint on its own line -#dotnet_diagnostic.rcs0034.severity = none - -# Remove blank line between single-line declarations of same kind -#dotnet_diagnostic.rcs0036.severity = none - -# Remove new line before base list -#dotnet_diagnostic.rcs0039.severity = none - -# Remove new line between 'if' keyword and 'else' keyword -#dotnet_diagnostic.rcs0041.severity = none - -# Put auto-accessors on a single line -#dotnet_diagnostic.rcs0042.severity = none - -# Use carriage return + linefeed as new line -#dotnet_diagnostic.rcs0044.severity = none - -# Use linefeed as new line -#dotnet_diagnostic.rcs0045.severity = none - -# Use spaces instead of tab -#dotnet_diagnostic.rcs0046.severity = none - -# Put initializer on a single line -#dotnet_diagnostic.rcs0048.severity = none - -# Add blank line after top comment -#dotnet_diagnostic.rcs0049.severity = none - -# Add blank line before top declaration -#dotnet_diagnostic.rcs0050.severity = none - -# Add/remove new line before 'while' in 'do' statement -#dotnet_diagnostic.rcs0051.severity = none -# Options: roslynator_new_line_before_while_in_do_statement - -# Place new line after/before equals token -#dotnet_diagnostic.rcs0052.severity = none -# Options: roslynator_equals_token_new_line - -# Fix formatting of a list -#dotnet_diagnostic.rcs0053.severity = none - -# Fix formatting of a call chain -#dotnet_diagnostic.rcs0054.severity = none - -# Fix formatting of a binary expression chain -#dotnet_diagnostic.rcs0055.severity = none - -# A line is too long -#dotnet_diagnostic.rcs0056.severity = none -# Options: roslynator_max_line_length, roslynator_tab_length - -# Normalize whitespace at the beginning of a file -#dotnet_diagnostic.rcs0057.severity = none - -# Normalize whitespace at the end of a file -#dotnet_diagnostic.rcs0058.severity = none -# Options: roslynator_new_line_at_end_of_file - -# Place new line after/before null-conditional operator -#dotnet_diagnostic.rcs0059.severity = none -# Options: roslynator_null_conditional_operator_new_line - -# Add/remove line after file scoped namespace declaration -#dotnet_diagnostic.rcs0060.severity = none -# Options: roslynator_blank_line_after_file_scoped_namespace_declaration - -# Add/remove blank line between switch sections -#dotnet_diagnostic.rcs0061.severity = none -# Options: roslynator_blank_line_between_switch_sections - -# Add braces (when expression spans over multiple lines) -#dotnet_diagnostic.rcs1001.severity = suggestion - -# Remove braces -#dotnet_diagnostic.rcs1002.severity = none - -# Add braces to if-else (when expression spans over multiple lines) -#dotnet_diagnostic.rcs1003.severity = suggestion - -# Remove braces from if-else -#dotnet_diagnostic.rcs1004.severity = none - -# Simplify nested using statement -#dotnet_diagnostic.rcs1005.severity = silent - -# Merge 'else' with nested 'if' -#dotnet_diagnostic.rcs1006.severity = silent - -# Add braces -#dotnet_diagnostic.rcs1007.severity = none - -# Use predefined type -#dotnet_diagnostic.rcs1013.severity = none - -# Use explicitly/implicitly typed array -#dotnet_diagnostic.rcs1014.severity = none -# Options: roslynator_array_creation_type_style, roslynator_use_collection_expression - -# Use nameof operator -#dotnet_diagnostic.rcs1015.severity = suggestion - -# Use block body or expression body -#dotnet_diagnostic.rcs1016.severity = none -# Options: roslynator_body_style, roslynator_use_block_body_when_declaration_spans_over_multiple_lines, roslynator_use_block_body_when_expression_spans_over_multiple_lines - -# Add/remove accessibility modifiers -#dotnet_diagnostic.rcs1018.severity = none -# Options: roslynator_accessibility_modifiers - -# Order modifiers -#dotnet_diagnostic.rcs1019.severity = none - -# Simplify Nullable to T? -#dotnet_diagnostic.rcs1020.severity = suggestion - -# Convert lambda expression body to expression body -#dotnet_diagnostic.rcs1021.severity = suggestion - -# Remove unnecessary braces in switch section -#dotnet_diagnostic.rcs1031.severity = silent - -# Remove redundant parentheses -#dotnet_diagnostic.rcs1032.severity = suggestion - -# Remove redundant boolean literal -#dotnet_diagnostic.rcs1033.severity = suggestion - -# Remove redundant 'sealed' modifier -#dotnet_diagnostic.rcs1034.severity = silent - -# Remove unnecessary blank line -#dotnet_diagnostic.rcs1036.severity = suggestion -# Options: roslynator_blank_line_between_closing_brace_and_switch_section - -# Remove trailing white-space -#dotnet_diagnostic.rcs1037.severity = suggestion - -# Remove argument list from attribute -#dotnet_diagnostic.rcs1039.severity = silent - -# Remove enum default underlying type -#dotnet_diagnostic.rcs1042.severity = silent - -# Remove 'partial' modifier from type with a single part -#dotnet_diagnostic.rcs1043.severity = silent - -# Remove original exception from throw statement -#dotnet_diagnostic.rcs1044.severity = warning - -# Asynchronous method name should end with 'Async' -#dotnet_diagnostic.rcs1046.severity = none - -# Non-asynchronous method name should not end with 'Async' -#dotnet_diagnostic.rcs1047.severity = suggestion - -# Use lambda expression instead of anonymous method -#dotnet_diagnostic.rcs1048.severity = suggestion - -# Simplify boolean comparison -#dotnet_diagnostic.rcs1049.severity = suggestion - -# Include/omit parentheses when creating new object -#dotnet_diagnostic.rcs1050.severity = none -# Options: roslynator_object_creation_parentheses_style - -# Add/remove parentheses from condition in conditional operator -#dotnet_diagnostic.rcs1051.severity = none -# Options: roslynator_conditional_operator_condition_parentheses_style - -# Declare each attribute separately -#dotnet_diagnostic.rcs1052.severity = none - -# Unnecessary semicolon at the end of declaration -#dotnet_diagnostic.rcs1055.severity = silent - -# Avoid usage of using alias directive -#dotnet_diagnostic.rcs1056.severity = none - -# Use compound assignment -#dotnet_diagnostic.rcs1058.severity = suggestion - -# Avoid locking on publicly accessible instance -#dotnet_diagnostic.rcs1059.severity = warning - -# Declare each type in separate file -#dotnet_diagnostic.rcs1060.severity = none - -# Merge 'if' with nested 'if' -#dotnet_diagnostic.rcs1061.severity = silent - -# Simplify logical negation -#dotnet_diagnostic.rcs1068.severity = suggestion - -# Remove unnecessary case label -#dotnet_diagnostic.rcs1069.severity = silent - -# Remove redundant default switch section -#dotnet_diagnostic.rcs1070.severity = silent - -# Remove redundant base constructor call -#dotnet_diagnostic.rcs1071.severity = silent - -# Convert 'if' to 'return' statement -#dotnet_diagnostic.rcs1073.severity = suggestion - -# Remove redundant constructor -#dotnet_diagnostic.rcs1074.severity = silent - -# Avoid empty catch clause that catches System.Exception -#dotnet_diagnostic.rcs1075.severity = warning - -# Optimize LINQ method call -#dotnet_diagnostic.rcs1077.severity = suggestion - -# Use "" or 'string.Empty' -#dotnet_diagnostic.rcs1078.severity = none -# Options: roslynator_empty_string_style - -# Throwing of new NotImplementedException -#dotnet_diagnostic.rcs1079.severity = none - -# Use 'Count/Length' property instead of 'Any' method -#dotnet_diagnostic.rcs1080.severity = none - -# Split variable declaration -#dotnet_diagnostic.rcs1081.severity = none - -# Use coalesce expression instead of conditional expression -#dotnet_diagnostic.rcs1084.severity = suggestion - -# Use auto-implemented property -#dotnet_diagnostic.rcs1085.severity = suggestion - -# Use --/++ operator instead of assignment -#dotnet_diagnostic.rcs1089.severity = suggestion - -# Add/remove 'ConfigureAwait(false)' call -#dotnet_diagnostic.rcs1090.severity = none -# Options: roslynator_configure_await - -# File contains no code -#dotnet_diagnostic.rcs1093.severity = suggestion - -# Declare using directive on top level -#dotnet_diagnostic.rcs1094.severity = none - -# Use 'HasFlag' method or bitwise operator -#dotnet_diagnostic.rcs1096.severity = none -# Options: roslynator_enum_has_flag_style - -# Remove redundant 'ToString' call -#dotnet_diagnostic.rcs1097.severity = suggestion - -# Constant values should be placed on right side of comparisons -#dotnet_diagnostic.rcs1098.severity = suggestion - -# Default label should be the last label in a switch section -#dotnet_diagnostic.rcs1099.severity = suggestion - -# Make class static -#dotnet_diagnostic.rcs1102.severity = warning - -# Convert 'if' to assignment -#dotnet_diagnostic.rcs1103.severity = suggestion - -# Simplify conditional expression -#dotnet_diagnostic.rcs1104.severity = suggestion - -# Unnecessary interpolation -#dotnet_diagnostic.rcs1105.severity = suggestion - -# Remove redundant 'ToCharArray' call -#dotnet_diagnostic.rcs1107.severity = suggestion - -# Add 'static' modifier to all partial class declarations -#dotnet_diagnostic.rcs1108.severity = suggestion - -# Declare type inside namespace -#dotnet_diagnostic.rcs1110.severity = suggestion - -# Add braces to switch section with multiple statements -#dotnet_diagnostic.rcs1111.severity = none - -# Combine 'Enumerable.Where' method chain -#dotnet_diagnostic.rcs1112.severity = suggestion - -# Use 'string.IsNullOrEmpty' method -#dotnet_diagnostic.rcs1113.severity = suggestion - -# Remove redundant delegate creation -#dotnet_diagnostic.rcs1114.severity = suggestion - -# Mark local variable as const -#dotnet_diagnostic.rcs1118.severity = suggestion - -# Add parentheses when necessary -#dotnet_diagnostic.rcs1123.severity = suggestion - -# Inline local variable -#dotnet_diagnostic.rcs1124.severity = silent - -# Add braces to if-else -#dotnet_diagnostic.rcs1126.severity = none - -# Use coalesce expression -#dotnet_diagnostic.rcs1128.severity = suggestion - -# Remove redundant field initialization -#dotnet_diagnostic.rcs1129.severity = silent - -# Bitwise operation on enum without Flags attribute -#dotnet_diagnostic.rcs1130.severity = suggestion - -# Remove redundant overriding member -#dotnet_diagnostic.rcs1132.severity = suggestion - -# Remove redundant Dispose/Close call -#dotnet_diagnostic.rcs1133.severity = silent - -# Remove redundant statement -#dotnet_diagnostic.rcs1134.severity = silent - -# Declare enum member with zero value (when enum has FlagsAttribute) -#dotnet_diagnostic.rcs1135.severity = suggestion - -# Merge switch sections with equivalent content -#dotnet_diagnostic.rcs1136.severity = silent - -# Add summary to documentation comment -#dotnet_diagnostic.rcs1138.severity = warning - -# Add summary element to documentation comment -#dotnet_diagnostic.rcs1139.severity = warning - -# Add exception to documentation comment -#dotnet_diagnostic.rcs1140.severity = silent - -# Add 'param' element to documentation comment -#dotnet_diagnostic.rcs1141.severity = silent - -# Add 'typeparam' element to documentation comment -#dotnet_diagnostic.rcs1142.severity = silent - -# Simplify coalesce expression -#dotnet_diagnostic.rcs1143.severity = silent - -# Remove redundant 'as' operator -#dotnet_diagnostic.rcs1145.severity = silent - -# Use conditional access -#dotnet_diagnostic.rcs1146.severity = suggestion - -# Remove redundant cast -#dotnet_diagnostic.rcs1151.severity = silent - -# Sort enum members -#dotnet_diagnostic.rcs1154.severity = suggestion - -# Use StringComparison when comparing strings -#dotnet_diagnostic.rcs1155.severity = warning - -# Use string.Length instead of comparison with empty string -#dotnet_diagnostic.rcs1156.severity = suggestion - -# Composite enum value contains undefined flag -#dotnet_diagnostic.rcs1157.severity = suggestion - -# Static member in generic type should use a type parameter -#dotnet_diagnostic.rcs1158.severity = suggestion - -# Use EventHandler -#dotnet_diagnostic.rcs1159.severity = suggestion - -# Abstract type should not have public constructors -#dotnet_diagnostic.rcs1160.severity = suggestion - -# Enum should declare explicit values -#dotnet_diagnostic.rcs1161.severity = silent - -# Avoid chain of assignments -#dotnet_diagnostic.rcs1162.severity = none - -# Unused parameter -#dotnet_diagnostic.rcs1163.severity = suggestion - -# Unused type parameter -#dotnet_diagnostic.rcs1164.severity = suggestion - -# Unconstrained type parameter checked for null -#dotnet_diagnostic.rcs1165.severity = silent - -# Value type object is never equal to null -#dotnet_diagnostic.rcs1166.severity = suggestion - -# Parameter name differs from base name -#dotnet_diagnostic.rcs1168.severity = silent - -# Make field read-only -#dotnet_diagnostic.rcs1169.severity = suggestion -# Options: roslynator_unity_code_analysis.enabled - -# Use read-only auto-implemented property -#dotnet_diagnostic.rcs1170.severity = suggestion - -# Simplify lazy initialization -#dotnet_diagnostic.rcs1171.severity = suggestion - -# Use 'is' operator instead of 'as' operator -#dotnet_diagnostic.rcs1172.severity = warning - -# Use coalesce expression instead of 'if' -#dotnet_diagnostic.rcs1173.severity = suggestion - -# Remove redundant async/await -#dotnet_diagnostic.rcs1174.severity = none - -# Unused 'this' parameter -#dotnet_diagnostic.rcs1175.severity = suggestion - -# Unnecessary assignment -#dotnet_diagnostic.rcs1179.severity = suggestion - -# Inline lazy initialization -#dotnet_diagnostic.rcs1180.severity = suggestion - -# Convert comment to documentation comment -#dotnet_diagnostic.rcs1181.severity = silent - -# Remove redundant base interface -#dotnet_diagnostic.rcs1182.severity = silent - -# Use Regex instance instead of static method -#dotnet_diagnostic.rcs1186.severity = silent - -# Use constant instead of field -#dotnet_diagnostic.rcs1187.severity = suggestion - -# Remove redundant auto-property initialization -#dotnet_diagnostic.rcs1188.severity = silent - -# Add or remove region name -#dotnet_diagnostic.rcs1189.severity = silent - -# Join string expressions -#dotnet_diagnostic.rcs1190.severity = suggestion - -# Declare enum value as combination of names -#dotnet_diagnostic.rcs1191.severity = suggestion - -# Unnecessary usage of verbatim string literal -#dotnet_diagnostic.rcs1192.severity = suggestion - -# Overriding member should not change 'params' modifier -#dotnet_diagnostic.rcs1193.severity = warning - -# Implement exception constructors -#dotnet_diagnostic.rcs1194.severity = warning - -# Use ^ operator -#dotnet_diagnostic.rcs1195.severity = suggestion - -# Call extension method as instance method -#dotnet_diagnostic.rcs1196.severity = suggestion - -# Optimize StringBuilder.Append/AppendLine call -#dotnet_diagnostic.rcs1197.severity = suggestion - -# Avoid unnecessary boxing of value type -#dotnet_diagnostic.rcs1198.severity = none - -# Unnecessary null check -#dotnet_diagnostic.rcs1199.severity = suggestion - -# Call 'Enumerable.ThenBy' instead of 'Enumerable.OrderBy' -#dotnet_diagnostic.rcs1200.severity = suggestion - -# Use method chaining -#dotnet_diagnostic.rcs1201.severity = silent - -# Avoid NullReferenceException -#dotnet_diagnostic.rcs1202.severity = suggestion - -# Use AttributeUsageAttribute -#dotnet_diagnostic.rcs1203.severity = warning - -# Use EventArgs.Empty -#dotnet_diagnostic.rcs1204.severity = suggestion - -# Order named arguments according to the order of parameters -#dotnet_diagnostic.rcs1205.severity = suggestion - -# Use conditional access instead of conditional expression -#dotnet_diagnostic.rcs1206.severity = suggestion - -# Use anonymous function or method group -#dotnet_diagnostic.rcs1207.severity = none -# Options: roslynator_use_anonymous_function_or_method_group - -# Reduce 'if' nesting -#dotnet_diagnostic.rcs1208.severity = none - -# Order type parameter constraints -#dotnet_diagnostic.rcs1209.severity = suggestion - -# Return completed task instead of returning null -#dotnet_diagnostic.rcs1210.severity = warning - -# Remove unnecessary 'else' -#dotnet_diagnostic.rcs1211.severity = silent - -# Remove redundant assignment -#dotnet_diagnostic.rcs1212.severity = suggestion - -# Remove unused member declaration -#dotnet_diagnostic.rcs1213.severity = suggestion -# Options: roslynator_unity_code_analysis.enabled - -# Unnecessary interpolated string -#dotnet_diagnostic.rcs1214.severity = suggestion - -# Expression is always equal to true/false -#dotnet_diagnostic.rcs1215.severity = warning - -# Unnecessary unsafe context -#dotnet_diagnostic.rcs1216.severity = suggestion - -# Convert interpolated string to concatenation -#dotnet_diagnostic.rcs1217.severity = silent - -# Simplify code branching -#dotnet_diagnostic.rcs1218.severity = suggestion - -# Use pattern matching instead of combination of 'is' operator and cast operator -#dotnet_diagnostic.rcs1220.severity = suggestion - -# Use pattern matching instead of combination of 'as' operator and null check -#dotnet_diagnostic.rcs1221.severity = suggestion - -# Merge preprocessor directives -#dotnet_diagnostic.rcs1222.severity = suggestion - -# Mark publicly visible type with DebuggerDisplay attribute -#dotnet_diagnostic.rcs1223.severity = none - -# Make method an extension method -#dotnet_diagnostic.rcs1224.severity = suggestion - -# Make class sealed -#dotnet_diagnostic.rcs1225.severity = suggestion - -# Add paragraph to documentation comment -#dotnet_diagnostic.rcs1226.severity = suggestion - -# Validate arguments correctly -#dotnet_diagnostic.rcs1227.severity = suggestion - -# Unused element in a documentation comment -#dotnet_diagnostic.rcs1228.severity = silent - -# Use async/await when necessary -#dotnet_diagnostic.rcs1229.severity = suggestion - -# Unnecessary explicit use of enumerator -#dotnet_diagnostic.rcs1230.severity = suggestion - -# Make parameter ref read-only -#dotnet_diagnostic.rcs1231.severity = none - -# Order elements in documentation comment -#dotnet_diagnostic.rcs1232.severity = suggestion - -# Use short-circuiting operator -#dotnet_diagnostic.rcs1233.severity = suggestion - -# Duplicate enum value -#dotnet_diagnostic.rcs1234.severity = suggestion - -# Optimize method call -#dotnet_diagnostic.rcs1235.severity = suggestion - -# Use exception filter -#dotnet_diagnostic.rcs1236.severity = suggestion - -# Avoid nested ?: operators -#dotnet_diagnostic.rcs1238.severity = silent - -# Use 'for' statement instead of 'while' statement -#dotnet_diagnostic.rcs1239.severity = suggestion - -# Operator is unnecessary -#dotnet_diagnostic.rcs1240.severity = suggestion - -# Implement non-generic counterpart -#dotnet_diagnostic.rcs1241.severity = silent - -# Do not pass non-read-only struct by read-only reference -#dotnet_diagnostic.rcs1242.severity = warning - -# Duplicate word in a comment -#dotnet_diagnostic.rcs1243.severity = suggestion - -# Simplify 'default' expression -#dotnet_diagnostic.rcs1244.severity = silent - -# Use element access -#dotnet_diagnostic.rcs1246.severity = suggestion - -# Fix documentation comment tag -#dotnet_diagnostic.rcs1247.severity = suggestion - -# Normalize null check -#dotnet_diagnostic.rcs1248.severity = none -# Options: roslynator_null_check_style - -# Unnecessary null-forgiving operator -#dotnet_diagnostic.rcs1249.severity = suggestion - -# Use implicit/explicit object creation -#dotnet_diagnostic.rcs1250.severity = none -# Options: roslynator_object_creation_type_style, roslynator_use_collection_expression, roslynator_use_var_instead_of_implicit_object_creation - -# Remove unnecessary braces from record declaration -#dotnet_diagnostic.rcs1251.severity = suggestion - -# Normalize usage of infinite loop -#dotnet_diagnostic.rcs1252.severity = none -# Options: roslynator_infinite_loop_style - -# Format documentation comment summary -#dotnet_diagnostic.rcs1253.severity = none -# Options: roslynator_doc_comment_summary_style - -# Normalize format of enum flag value -#dotnet_diagnostic.rcs1254.severity = suggestion -# Options: roslynator_enum_flag_value_style - -# Simplify argument null check -#dotnet_diagnostic.rcs1255.severity = none - -# Invalid argument null check -#dotnet_diagnostic.rcs1256.severity = suggestion - -# Use enum field explicitly -#dotnet_diagnostic.rcs1257.severity = suggestion - -# Unnecessary enum flag -#dotnet_diagnostic.rcs1258.severity = suggestion - -# Remove empty syntax -#dotnet_diagnostic.rcs1259.severity = suggestion - -# Add/remove trailing comma -#dotnet_diagnostic.rcs1260.severity = none -# Options: roslynator_trailing_comma_style - -# Resource can be disposed asynchronously -#dotnet_diagnostic.rcs1261.severity = suggestion - -# Unnecessary raw string literal -#dotnet_diagnostic.rcs1262.severity = suggestion - -# Invalid reference in a documentation comment -#dotnet_diagnostic.rcs1263.severity = warning - -# Use 'var' or explicit type -#dotnet_diagnostic.rcs1264.severity = none -# Options: roslynator_use_var - -# Remove redundant catch block -#dotnet_diagnostic.rcs1265.severity = suggestion - -# Use raw string literal -#dotnet_diagnostic.rcs1266.severity = suggestion - -# Use string interpolation instead of 'string.Concat' -#dotnet_diagnostic.rcs1267.severity = suggestion - -# Simplify numeric comparison -#dotnet_diagnostic.rcs1268.severity = suggestion - -# Use pattern matching -#dotnet_diagnostic.rcs9001.severity = silent - -# Use property SyntaxNode.SpanStart -#dotnet_diagnostic.rcs9002.severity = suggestion - -# Unnecessary conditional access -#dotnet_diagnostic.rcs9003.severity = suggestion - -# Call 'Any' instead of accessing 'Count' -#dotnet_diagnostic.rcs9004.severity = suggestion - -# Unnecessary null check -#dotnet_diagnostic.rcs9005.severity = suggestion - -# Use element access -#dotnet_diagnostic.rcs9006.severity = suggestion - -# Use return value -#dotnet_diagnostic.rcs9007.severity = warning - -# Call 'Last' instead of using [] -#dotnet_diagnostic.rcs9008.severity = suggestion - -# Unknown language name -#dotnet_diagnostic.rcs9009.severity = warning - -# Specify ExportCodeRefactoringProviderAttribute.Name -#dotnet_diagnostic.rcs9010.severity = silent - -# Specify ExportCodeFixProviderAttribute.Name -#dotnet_diagnostic.rcs9011.severity = silent - - -# Refactorings - -#roslynator_refactoring.add_all_properties_to_initializer.enabled = true -#roslynator_refactoring.add_argument_name.enabled = true -#roslynator_refactoring.add_braces.enabled = true -#roslynator_refactoring.add_braces_to_if_else.enabled = true -#roslynator_refactoring.add_braces_to_switch_section.enabled = true -#roslynator_refactoring.add_braces_to_switch_sections.enabled = true -#roslynator_refactoring.add_default_value_to_parameter.enabled = true -#roslynator_refactoring.add_empty_line_between_declarations.enabled = true -#roslynator_refactoring.add_exception_element_to_documentation_comment.enabled = true -#roslynator_refactoring.add_generic_parameter_to_declaration.enabled = true -#roslynator_refactoring.add_member_to_interface.enabled = true -#roslynator_refactoring.add_missing_cases_to_switch.enabled = true -#roslynator_refactoring.add_parameter_to_interface_member.enabled = true -#roslynator_refactoring.add_tag_to_documentation_comment.enabled = true -#roslynator_refactoring.add_using_directive.enabled = true -#roslynator_refactoring.add_using_static_directive.enabled = true -#roslynator_refactoring.call_extension_method_as_instance_method.enabled = true -#roslynator_refactoring.call_indexof_instead_of_contains.enabled = true -#roslynator_refactoring.change_accessibility.enabled = true -#roslynator_refactoring.change_method_return_type_to_void.enabled = true -#roslynator_refactoring.change_type_according_to_expression.enabled = true -#roslynator_refactoring.check_expression_for_null.enabled = true -#roslynator_refactoring.check_parameter_for_null.enabled = true -#roslynator_refactoring.comment_out_member_declaration.enabled = true -#roslynator_refactoring.comment_out_statement.enabled = true -#roslynator_refactoring.convert_auto_property_to_full_property.enabled = true -#roslynator_refactoring.convert_auto_property_to_full_property_without_backing_field.enabled = true -#roslynator_refactoring.convert_block_body_to_expression_body.enabled = true -#roslynator_refactoring.convert_comment_to_documentation_comment.enabled = true -#roslynator_refactoring.convert_conditional_expression_to_if_else.enabled = true -#roslynator_refactoring.convert_do_to_while.enabled = true -#roslynator_refactoring.convert_expression_body_to_block_body.enabled = true -#roslynator_refactoring.convert_for_to_foreach.enabled = true -#roslynator_refactoring.convert_for_to_while.enabled = true -#roslynator_refactoring.convert_foreach_to_for.enabled = true -#roslynator_refactoring.convert_foreach_to_for_and_reverse_loop.enabled = false -#roslynator_refactoring.convert_hasflag_call_to_bitwise_operation.enabled = true -#roslynator_refactoring.convert_hexadecimal_literal_to_decimal_literal.enabled = true -#roslynator_refactoring.convert_if_to_conditional_expression.enabled = true -#roslynator_refactoring.convert_if_to_switch.enabled = true -#roslynator_refactoring.convert_interpolated_string_to_concatenation.enabled = true -#roslynator_refactoring.convert_interpolated_string_to_string_format.enabled = true -#roslynator_refactoring.convert_interpolated_string_to_string_literal.enabled = true -#roslynator_refactoring.convert_lambda_block_body_to_expression_body.enabled = true -#roslynator_refactoring.convert_lambda_expression_body_to_block_body.enabled = true -#roslynator_refactoring.convert_method_group_to_lambda.enabled = true -#roslynator_refactoring.convert_regular_string_literal_to_verbatim_string_literal.enabled = true -#roslynator_refactoring.convert_return_statement_to_if.enabled = true -#roslynator_refactoring.convert_statements_to_if_else.enabled = true -#roslynator_refactoring.convert_string_format_to_interpolated_string.enabled = true -#roslynator_refactoring.convert_switch_expression_to_switch_statement.enabled = true -#roslynator_refactoring.convert_switch_to_if.enabled = true -#roslynator_refactoring.convert_verbatim_string_literal_to_regular_string_literal.enabled = true -#roslynator_refactoring.convert_verbatim_string_literal_to_regular_string_literals.enabled = true -#roslynator_refactoring.convert_while_to_do.enabled = true -#roslynator_refactoring.convert_while_to_for.enabled = true -#roslynator_refactoring.copy_argument.enabled = true -#roslynator_refactoring.copy_documentation_comment_from_base_member.enabled = true -#roslynator_refactoring.copy_member_declaration.enabled = true -#roslynator_refactoring.copy_parameter.enabled = true -#roslynator_refactoring.copy_statement.enabled = true -#roslynator_refactoring.copy_switch_section.enabled = true -#roslynator_refactoring.deconstruct_foreach_variable.enabled = true -#roslynator_refactoring.expand_coalesce_expression.enabled = true -#roslynator_refactoring.expand_compound_assignment.enabled = true -#roslynator_refactoring.expand_event_declaration.enabled = true -#roslynator_refactoring.expand_initializer.enabled = false -#roslynator_refactoring.expand_positional_constructor.enabled = true -#roslynator_refactoring.extract_event_handler_method.enabled = true -#roslynator_refactoring.extract_expression_from_condition.enabled = true -#roslynator_refactoring.extract_type_declaration_to_new_file.enabled = false -#roslynator_refactoring.generate_base_constructors.enabled = true -#roslynator_refactoring.generate_combined_enum_member.enabled = true -#roslynator_refactoring.generate_enum_member.enabled = true -#roslynator_refactoring.generate_enum_values.enabled = true -#roslynator_refactoring.generate_event_invoking_method.enabled = true -#roslynator_refactoring.generate_property_for_debuggerdisplay_attribute.enabled = true -#roslynator_refactoring.implement_custom_enumerator.enabled = true -#roslynator_refactoring.implement_iequatable.enabled = true -#roslynator_refactoring.initialize_field_from_constructor.enabled = true -#roslynator_refactoring.initialize_local_variable_with_default_value.enabled = true -#roslynator_refactoring.inline_alias_expression.enabled = true -#roslynator_refactoring.inline_constant.enabled = true -#roslynator_refactoring.inline_constant_value.enabled = true -#roslynator_refactoring.inline_method.enabled = true -#roslynator_refactoring.inline_property.enabled = true -#roslynator_refactoring.inline_using_static.enabled = true -#roslynator_refactoring.insert_string_interpolation.enabled = true -#roslynator_refactoring.introduce_and_initialize_field.enabled = true -#roslynator_refactoring.introduce_and_initialize_property.enabled = true -#roslynator_refactoring.introduce_constructor.enabled = false -#roslynator_refactoring.introduce_field_to_lock_on.enabled = true -#roslynator_refactoring.introduce_local_variable.enabled = true -#roslynator_refactoring.invert_binary_expression.enabled = true -#roslynator_refactoring.invert_boolean_literal.enabled = true -#roslynator_refactoring.invert_conditional_expression.enabled = true -#roslynator_refactoring.invert_if.enabled = true -#roslynator_refactoring.invert_if_else.enabled = true -#roslynator_refactoring.invert_is_expression.enabled = true -#roslynator_refactoring.invert_linq_method_call.enabled = true -#roslynator_refactoring.invert_operator.enabled = true -#roslynator_refactoring.invert_prefix_or_postfix_unary_expression.enabled = true -#roslynator_refactoring.join_string_expressions.enabled = true -#roslynator_refactoring.make_member_abstract.enabled = true -#roslynator_refactoring.make_member_virtual.enabled = true -#roslynator_refactoring.merge_attributes.enabled = true -#roslynator_refactoring.merge_if_statements.enabled = true -#roslynator_refactoring.merge_if_with_parent_if.enabled = true -#roslynator_refactoring.merge_local_declarations.enabled = true -#roslynator_refactoring.merge_switch_sections.enabled = true -#roslynator_refactoring.move_unsafe_context_to_containing_declaration.enabled = true -#roslynator_refactoring.notify_when_property_changes.enabled = true -#roslynator_refactoring.parenthesize_expression.enabled = true -#roslynator_refactoring.promote_local_variable_to_parameter.enabled = true -#roslynator_refactoring.remove_all_comments.enabled = true -#roslynator_refactoring.remove_all_comments_except_documentation_comments.enabled = true -#roslynator_refactoring.remove_all_documentation_comments.enabled = false -#roslynator_refactoring.remove_all_member_declarations.enabled = true -#roslynator_refactoring.remove_all_preprocessor_directives.enabled = true -#roslynator_refactoring.remove_all_region_directives.enabled = true -#roslynator_refactoring.remove_all_statements.enabled = true -#roslynator_refactoring.remove_all_switch_sections.enabled = true -#roslynator_refactoring.remove_argument_name.enabled = true -#roslynator_refactoring.remove_async_await.enabled = true -#roslynator_refactoring.remove_braces.enabled = true -#roslynator_refactoring.remove_braces_from_if_else.enabled = true -#roslynator_refactoring.remove_braces_from_switch_section.enabled = true -#roslynator_refactoring.remove_braces_from_switch_sections.enabled = true -#roslynator_refactoring.remove_comment.enabled = true -#roslynator_refactoring.remove_condition_from_last_else.enabled = true -#roslynator_refactoring.remove_containing_statement.enabled = true -#roslynator_refactoring.remove_empty_lines.enabled = true -#roslynator_refactoring.remove_enum_member_value.enabled = true -#roslynator_refactoring.remove_instantiation_of_local_variable.enabled = true -#roslynator_refactoring.remove_interpolation.enabled = true -#roslynator_refactoring.remove_member_declaration.enabled = true -#roslynator_refactoring.remove_member_declarations_above_or_below.enabled = true -#roslynator_refactoring.remove_parentheses.enabled = true -#roslynator_refactoring.remove_preprocessor_directive.enabled = true -#roslynator_refactoring.remove_property_initializer.enabled = true -#roslynator_refactoring.remove_region.enabled = true -#roslynator_refactoring.remove_statement.enabled = true -#roslynator_refactoring.remove_unnecessary_assignment.enabled = true -#roslynator_refactoring.rename_identifier_according_to_type_name.enabled = true -#roslynator_refactoring.rename_method_according_to_type_name.enabled = true -#roslynator_refactoring.rename_parameter_according_to_type_name.enabled = true -#roslynator_refactoring.rename_property_according_to_type_name.enabled = true -#roslynator_refactoring.replace_as_expression_with_explicit_cast.enabled = true -#roslynator_refactoring.replace_conditional_expression_with_true_or_false_branch.enabled = true -#roslynator_refactoring.replace_equality_operator_with_string_equals.enabled = true -#roslynator_refactoring.replace_equality_operator_with_string_isnullorempty.enabled = true -#roslynator_refactoring.replace_equality_operator_with_string_isnullorwhitespace.enabled = true -#roslynator_refactoring.replace_explicit_cast_with_as_expression.enabled = true -#roslynator_refactoring.replace_interpolated_string_with_interpolation_expression.enabled = true -#roslynator_refactoring.replace_method_with_property.enabled = false -#roslynator_refactoring.replace_null_literal_with_default_expression.enabled = true -#roslynator_refactoring.replace_prefix_operator_with_postfix_operator.enabled = true -#roslynator_refactoring.replace_property_with_method.enabled = true -#roslynator_refactoring.reverse_for_statement.enabled = true -#roslynator_refactoring.simplify_if.enabled = true -#roslynator_refactoring.sort_case_labels.enabled = true -#roslynator_refactoring.sort_member_declarations.enabled = true -#roslynator_refactoring.split_attributes.enabled = true -#roslynator_refactoring.split_if.enabled = true -#roslynator_refactoring.split_if_else.enabled = true -#roslynator_refactoring.split_local_declaration_and_assignment.enabled = true -#roslynator_refactoring.split_switch_labels.enabled = true -#roslynator_refactoring.split_variable_declaration.enabled = true -#roslynator_refactoring.swap_binary_operands.enabled = true -#roslynator_refactoring.swap_member_declarations.enabled = true -#roslynator_refactoring.sync_property_name_and_backing_field_name.enabled = true -#roslynator_refactoring.uncomment_multiline_comment.enabled = true -#roslynator_refactoring.uncomment_singleline_comment.enabled = true -#roslynator_refactoring.use_coalesce_expression_instead_of_if.enabled = true -#roslynator_refactoring.use_constant_instead_of_readonly_field.enabled = true -#roslynator_refactoring.use_element_access_instead_of_linq_method.enabled = true -#roslynator_refactoring.use_enumerator_explicitly.enabled = true -#roslynator_refactoring.use_explicit_type.enabled = true -#roslynator_refactoring.use_implicit_type.enabled = true -#roslynator_refactoring.use_index_initializer.enabled = true -#roslynator_refactoring.use_lambda_instead_of_anonymous_method.enabled = true -#roslynator_refactoring.use_list_instead_of_yield.enabled = true -#roslynator_refactoring.use_object_initializer.enabled = true -#roslynator_refactoring.use_readonly_field_instead_of_constant.enabled = true -#roslynator_refactoring.use_string_empty_instead_of_empty_string_literal.enabled = false -#roslynator_refactoring.use_stringbuilder_instead_of_concatenation.enabled = true -#roslynator_refactoring.wrap_arguments.enabled = true -#roslynator_refactoring.wrap_binary_expression.enabled = true -#roslynator_refactoring.wrap_call_chain.enabled = true -#roslynator_refactoring.wrap_conditional_expression.enabled = true -#roslynator_refactoring.wrap_constraint_clauses.enabled = true -#roslynator_refactoring.wrap_initializer_expressions.enabled = true -#roslynator_refactoring.wrap_lines_in_preprocessor_directive.enabled = true -#roslynator_refactoring.wrap_lines_in_region.enabled = true -#roslynator_refactoring.wrap_lines_in_try_catch.enabled = true -#roslynator_refactoring.wrap_parameters.enabled = true -#roslynator_refactoring.wrap_statements_in_condition.enabled = true -#roslynator_refactoring.wrap_statements_in_using_statement.enabled = true - -# Compiler diagnostic fixes - -#roslynator_compiler_diagnostic_fix.cs0019.enabled = true -#roslynator_compiler_diagnostic_fix.cs0021.enabled = true -#roslynator_compiler_diagnostic_fix.cs0023.enabled = true -#roslynator_compiler_diagnostic_fix.cs0029.enabled = true -#roslynator_compiler_diagnostic_fix.cs0030.enabled = true -#roslynator_compiler_diagnostic_fix.cs0037.enabled = true -#roslynator_compiler_diagnostic_fix.cs0069.enabled = true -#roslynator_compiler_diagnostic_fix.cs0077.enabled = true -#roslynator_compiler_diagnostic_fix.cs0080.enabled = true -#roslynator_compiler_diagnostic_fix.cs0101.enabled = true -#roslynator_compiler_diagnostic_fix.cs0102.enabled = true -#roslynator_compiler_diagnostic_fix.cs0103.enabled = true -#roslynator_compiler_diagnostic_fix.cs0106.enabled = true -#roslynator_compiler_diagnostic_fix.cs0107.enabled = true -#roslynator_compiler_diagnostic_fix.cs0108.enabled = true -#roslynator_compiler_diagnostic_fix.cs0109.enabled = true -#roslynator_compiler_diagnostic_fix.cs0112.enabled = true -#roslynator_compiler_diagnostic_fix.cs0114.enabled = true -#roslynator_compiler_diagnostic_fix.cs0115.enabled = true -#roslynator_compiler_diagnostic_fix.cs0119.enabled = true -#roslynator_compiler_diagnostic_fix.cs0120.enabled = true -#roslynator_compiler_diagnostic_fix.cs0123.enabled = true -#roslynator_compiler_diagnostic_fix.cs0126.enabled = true -#roslynator_compiler_diagnostic_fix.cs0127.enabled = true -#roslynator_compiler_diagnostic_fix.cs0128.enabled = true -#roslynator_compiler_diagnostic_fix.cs0131.enabled = true -#roslynator_compiler_diagnostic_fix.cs0132.enabled = true -#roslynator_compiler_diagnostic_fix.cs0133.enabled = true -#roslynator_compiler_diagnostic_fix.cs0136.enabled = true -#roslynator_compiler_diagnostic_fix.cs0139.enabled = true -#roslynator_compiler_diagnostic_fix.cs0152.enabled = true -#roslynator_compiler_diagnostic_fix.cs0161.enabled = true -#roslynator_compiler_diagnostic_fix.cs0162.enabled = true -#roslynator_compiler_diagnostic_fix.cs0163.enabled = true -#roslynator_compiler_diagnostic_fix.cs0164.enabled = true -#roslynator_compiler_diagnostic_fix.cs0165.enabled = true -#roslynator_compiler_diagnostic_fix.cs0168.enabled = true -#roslynator_compiler_diagnostic_fix.cs0173.enabled = true -#roslynator_compiler_diagnostic_fix.cs0177.enabled = true -#roslynator_compiler_diagnostic_fix.cs0191.enabled = true -#roslynator_compiler_diagnostic_fix.cs0192.enabled = true -#roslynator_compiler_diagnostic_fix.cs0201.enabled = true -#roslynator_compiler_diagnostic_fix.cs0214.enabled = true -#roslynator_compiler_diagnostic_fix.cs0216.enabled = true -#roslynator_compiler_diagnostic_fix.cs0219.enabled = true -#roslynator_compiler_diagnostic_fix.cs0221.enabled = true -#roslynator_compiler_diagnostic_fix.cs0225.enabled = true -#roslynator_compiler_diagnostic_fix.cs0238.enabled = true -#roslynator_compiler_diagnostic_fix.cs0246.enabled = true -#roslynator_compiler_diagnostic_fix.cs0260.enabled = true -#roslynator_compiler_diagnostic_fix.cs0262.enabled = true -#roslynator_compiler_diagnostic_fix.cs0266.enabled = true -#roslynator_compiler_diagnostic_fix.cs0267.enabled = true -#roslynator_compiler_diagnostic_fix.cs0272.enabled = true -#roslynator_compiler_diagnostic_fix.cs0275.enabled = true -#roslynator_compiler_diagnostic_fix.cs0305.enabled = true -#roslynator_compiler_diagnostic_fix.cs0401.enabled = true -#roslynator_compiler_diagnostic_fix.cs0403.enabled = true -#roslynator_compiler_diagnostic_fix.cs0405.enabled = true -#roslynator_compiler_diagnostic_fix.cs0407.enabled = true -#roslynator_compiler_diagnostic_fix.cs0409.enabled = true -#roslynator_compiler_diagnostic_fix.cs0428.enabled = true -#roslynator_compiler_diagnostic_fix.cs0441.enabled = true -#roslynator_compiler_diagnostic_fix.cs0442.enabled = true -#roslynator_compiler_diagnostic_fix.cs0449.enabled = true -#roslynator_compiler_diagnostic_fix.cs0450.enabled = true -#roslynator_compiler_diagnostic_fix.cs0451.enabled = true -#roslynator_compiler_diagnostic_fix.cs0472.enabled = true -#roslynator_compiler_diagnostic_fix.cs0500.enabled = true -#roslynator_compiler_diagnostic_fix.cs0501.enabled = true -#roslynator_compiler_diagnostic_fix.cs0507.enabled = true -#roslynator_compiler_diagnostic_fix.cs0508.enabled = true -#roslynator_compiler_diagnostic_fix.cs0513.enabled = true -#roslynator_compiler_diagnostic_fix.cs0515.enabled = true -#roslynator_compiler_diagnostic_fix.cs0524.enabled = true -#roslynator_compiler_diagnostic_fix.cs0525.enabled = true -#roslynator_compiler_diagnostic_fix.cs0527.enabled = true -#roslynator_compiler_diagnostic_fix.cs0531.enabled = true -#roslynator_compiler_diagnostic_fix.cs0539.enabled = true -#roslynator_compiler_diagnostic_fix.cs0541.enabled = true -#roslynator_compiler_diagnostic_fix.cs0549.enabled = true -#roslynator_compiler_diagnostic_fix.cs0558.enabled = true -#roslynator_compiler_diagnostic_fix.cs0567.enabled = true -#roslynator_compiler_diagnostic_fix.cs0568.enabled = true -#roslynator_compiler_diagnostic_fix.cs0573.enabled = true -#roslynator_compiler_diagnostic_fix.cs0574.enabled = true -#roslynator_compiler_diagnostic_fix.cs0575.enabled = true -#roslynator_compiler_diagnostic_fix.cs0579.enabled = true -#roslynator_compiler_diagnostic_fix.cs0592.enabled = true -#roslynator_compiler_diagnostic_fix.cs0621.enabled = true -#roslynator_compiler_diagnostic_fix.cs0628.enabled = true -#roslynator_compiler_diagnostic_fix.cs0659.enabled = true -#roslynator_compiler_diagnostic_fix.cs0660.enabled = true -#roslynator_compiler_diagnostic_fix.cs0661.enabled = true -#roslynator_compiler_diagnostic_fix.cs0678.enabled = true -#roslynator_compiler_diagnostic_fix.cs0693.enabled = true -#roslynator_compiler_diagnostic_fix.cs0708.enabled = true -#roslynator_compiler_diagnostic_fix.cs0710.enabled = true -#roslynator_compiler_diagnostic_fix.cs0713.enabled = true -#roslynator_compiler_diagnostic_fix.cs0714.enabled = true -#roslynator_compiler_diagnostic_fix.cs0718.enabled = true -#roslynator_compiler_diagnostic_fix.cs0750.enabled = true -#roslynator_compiler_diagnostic_fix.cs0751.enabled = true -#roslynator_compiler_diagnostic_fix.cs0753.enabled = true -#roslynator_compiler_diagnostic_fix.cs0756.enabled = true -#roslynator_compiler_diagnostic_fix.cs0759.enabled = true -#roslynator_compiler_diagnostic_fix.cs0766.enabled = true -#roslynator_compiler_diagnostic_fix.cs0815.enabled = true -#roslynator_compiler_diagnostic_fix.cs0819.enabled = true -#roslynator_compiler_diagnostic_fix.cs0822.enabled = true -#roslynator_compiler_diagnostic_fix.cs1002.enabled = true -#roslynator_compiler_diagnostic_fix.cs1003.enabled = true -#roslynator_compiler_diagnostic_fix.cs1004.enabled = true -#roslynator_compiler_diagnostic_fix.cs1012.enabled = true -#roslynator_compiler_diagnostic_fix.cs1023.enabled = true -#roslynator_compiler_diagnostic_fix.cs1031.enabled = true -#roslynator_compiler_diagnostic_fix.cs1057.enabled = true -#roslynator_compiler_diagnostic_fix.cs1061.enabled = true -#roslynator_compiler_diagnostic_fix.cs1100.enabled = true -#roslynator_compiler_diagnostic_fix.cs1105.enabled = true -#roslynator_compiler_diagnostic_fix.cs1106.enabled = true -#roslynator_compiler_diagnostic_fix.cs1503.enabled = true -#roslynator_compiler_diagnostic_fix.cs1522.enabled = true -#roslynator_compiler_diagnostic_fix.cs1526.enabled = true -#roslynator_compiler_diagnostic_fix.cs1527.enabled = true -#roslynator_compiler_diagnostic_fix.cs1591.enabled = true -#roslynator_compiler_diagnostic_fix.cs1597.enabled = true -#roslynator_compiler_diagnostic_fix.cs1609.enabled = true -#roslynator_compiler_diagnostic_fix.cs1615.enabled = true -#roslynator_compiler_diagnostic_fix.cs1620.enabled = true -#roslynator_compiler_diagnostic_fix.cs1621.enabled = true -#roslynator_compiler_diagnostic_fix.cs1622.enabled = true -#roslynator_compiler_diagnostic_fix.cs1623.enabled = true -#roslynator_compiler_diagnostic_fix.cs1624.enabled = true -#roslynator_compiler_diagnostic_fix.cs1643.enabled = true -#roslynator_compiler_diagnostic_fix.cs1674.enabled = true -#roslynator_compiler_diagnostic_fix.cs1689.enabled = true -#roslynator_compiler_diagnostic_fix.cs1715.enabled = true -#roslynator_compiler_diagnostic_fix.cs1717.enabled = true -#roslynator_compiler_diagnostic_fix.cs1722.enabled = true -#roslynator_compiler_diagnostic_fix.cs1737.enabled = true -#roslynator_compiler_diagnostic_fix.cs1741.enabled = true -#roslynator_compiler_diagnostic_fix.cs1743.enabled = true -#roslynator_compiler_diagnostic_fix.cs1750.enabled = true -#roslynator_compiler_diagnostic_fix.cs1751.enabled = true -#roslynator_compiler_diagnostic_fix.cs1955.enabled = true -#roslynator_compiler_diagnostic_fix.cs1983.enabled = true -#roslynator_compiler_diagnostic_fix.cs1988.enabled = true -#roslynator_compiler_diagnostic_fix.cs1994.enabled = true -#roslynator_compiler_diagnostic_fix.cs1997.enabled = true -#roslynator_compiler_diagnostic_fix.cs3000.enabled = true -#roslynator_compiler_diagnostic_fix.cs3001.enabled = true -#roslynator_compiler_diagnostic_fix.cs3002.enabled = true -#roslynator_compiler_diagnostic_fix.cs3003.enabled = true -#roslynator_compiler_diagnostic_fix.cs3005.enabled = true -#roslynator_compiler_diagnostic_fix.cs3006.enabled = true -#roslynator_compiler_diagnostic_fix.cs3007.enabled = true -#roslynator_compiler_diagnostic_fix.cs3008.enabled = true -#roslynator_compiler_diagnostic_fix.cs3009.enabled = true -#roslynator_compiler_diagnostic_fix.cs3016.enabled = true -#roslynator_compiler_diagnostic_fix.cs3024.enabled = true -#roslynator_compiler_diagnostic_fix.cs3027.enabled = true -#roslynator_compiler_diagnostic_fix.cs7036.enabled = true -#roslynator_compiler_diagnostic_fix.cs8050.enabled = true -#roslynator_compiler_diagnostic_fix.cs8070.enabled = true -#roslynator_compiler_diagnostic_fix.cs8112.enabled = true -#roslynator_compiler_diagnostic_fix.cs8139.enabled = true -#roslynator_compiler_diagnostic_fix.cs8340.enabled = true -#roslynator_compiler_diagnostic_fix.cs8403.enabled = true -#roslynator_compiler_diagnostic_fix.cs8600.enabled = true -#roslynator_compiler_diagnostic_fix.cs8602.enabled = true -#roslynator_compiler_diagnostic_fix.cs8604.enabled = true -#roslynator_compiler_diagnostic_fix.cs8610.enabled = true -#roslynator_compiler_diagnostic_fix.cs8618.enabled = true -#roslynator_compiler_diagnostic_fix.cs8625.enabled = true -#roslynator_compiler_diagnostic_fix.cs8632.enabled = true -#roslynator_compiler_diagnostic_fix.cs8765.enabled = true -#roslynator_compiler_diagnostic_fix.cs8767.enabled = true -` -}; \ No newline at end of file diff --git a/tools/generate_code.ps1 b/tools/generate_code.ps1 index 6d3ec38b36..a4a219de0c 100644 --- a/tools/generate_code.ps1 +++ b/tools/generate_code.ps1 @@ -3,4 +3,4 @@ dotnet build "$PSScriptRoot/../src/Tools/Tools.sln" --no-restore /p:Configuratio if(!$?) { Read-Host; Exit } -dotnet "$PSScriptRoot/../src/Tools/CodeGenerator/bin/Release/net7.0/Roslynator.CodeGenerator.dll" "../src" +dotnet "$PSScriptRoot/../src/Tools/CodeGenerator/bin/Release/net8.0/Roslynator.CodeGenerator.dll" "../src" diff --git a/tools/generate_configuration_file.ps1 b/tools/generate_configuration_file.ps1 index 8c49c87362..ca16681201 100644 --- a/tools/generate_configuration_file.ps1 +++ b/tools/generate_configuration_file.ps1 @@ -3,7 +3,7 @@ dotnet build "$PSScriptRoot/../src/Tools/ConfigurationFileGenerator/Configuratio if(!$?) { Read-Host; Exit } -dotnet "$PSScriptRoot/../src/Tools/ConfigurationFileGenerator/bin/Release/net7.0/Roslynator.ConfigurationFileGenerator.dll" ` +dotnet "$PSScriptRoot/../src/Tools/ConfigurationFileGenerator/bin/Release/net8.0/Roslynator.ConfigurationFileGenerator.dll" ` "../src" ` "$PSScriptRoot/../src/Tools/ConfigurationFileGenerator/configuration.md" ` "build/configuration.md" diff --git a/tools/generate_metadata.ps1 b/tools/generate_metadata.ps1 index 440e87a602..0a0dc50964 100644 --- a/tools/generate_metadata.ps1 +++ b/tools/generate_metadata.ps1 @@ -3,4 +3,4 @@ dotnet build "$PSScriptRoot/../src/Tools/Tools.sln" --no-restore /p:"Configurati if(!$?) { Read-Host; Exit } -& "$PSScriptRoot/../src/Tools/MetadataGenerator/bin/Release/net7.0/Roslynator.MetadataGenerator" "../src" "build" +& "$PSScriptRoot/../src/Tools/MetadataGenerator/bin/Release/net8.0/Roslynator.MetadataGenerator" "../src" "build"