roslynator

Roslynator is a set of code analysis tools for C#, powered by Roslyn.

OTHER License

Stars
3K
Committers
42

Bot releases are hidden (Show)

roslynator -

Published by JosefPihrt almost 8 years ago

Analyzers

New Analyzers
  • RemoveEmptyRegion

Refactorings

New Refactorings
  • GenerateOnEventMethod
roslynator -

Published by JosefPihrt almost 8 years ago

Refactorings

Improvements
  • InlineMethod - void method with multiple statements can be inlined.
  • CheckParameterForNull - refactoring can be applied to multiple parameters at once.
  • AddBraces - braces can be added to if statement in last else-if.
New Refactorings
  • GenerateBaseConstructors
roslynator -

Published by JosefPihrt about 8 years ago

Refactorings

New Refactorings
  • PromoteLocalToParameter
  • RemoveInterpolation
roslynator -

Published by JosefPihrt about 8 years ago

Analyzers

New Analyzers
  • UsePostfixUnaryOperatorInsteadOfAssignment
  • AddConfigureAwait
roslynator -

Published by JosefPihrt about 8 years ago

Analyzers

New Analyzers
  • UseLinefeedAsNewline
  • UseCarriageReturnAndLinefeedAsNewline
  • AvoidUsageOfTab
roslynator -

Published by JosefPihrt about 8 years ago

Refactorings

Changes
  • ReplaceMethodWithProperty and ReplacePropertyWithMethod refactorings significantly improved.
New Refactorings
  • ExtractTypeDeclarationToNewFile
  • MergeLocalDeclarations
roslynator -

Published by JosefPihrt about 8 years ago

  • Entire project was renamed to Roslynator
  • Visual Studio extension C# Analyzers and Refactorings was renamed to Roslynator
  • Visual Studio extension C# Refactorings was renamed to Roslynator Refactorings
  • Some assemblies were renamed. As a result ruleset files must be updated in a following way:
    • replace <Rules AnalyzerId="Pihrtsoft.CodeAnalysis.CSharp" RuleNamespace="Pihrtsoft.CodeAnalysis.CSharp">
    • with <Rules AnalyzerId="Roslynator.CSharp.Analyzers" RuleNamespace="Roslynator.CSharp.Analyzers">
roslynator -

Published by JosefPihrt about 8 years ago

Analyzers

Changes
  • "DeclareEachTypeInSeparateFile" has code fix.
Bug Fixes
  • "ReplacePropertyWithAutoProperty" - property and field must be of equal type.

Refactorings

Bug Fixes
  • "InsertInterpolation" - '{' and '}' are escaped by doubling when creating interpolated string from string literal.
roslynator -

Published by JosefPihrt about 8 years ago

Analyzers

Changes
  • "UseExplicitTypeInsteadOfVar" and "UseVarInsteadOfExplicitType" allow 'var' for enum member expression.
  • "AddDefaultAccessModifier" works with partial classes.
  • "AvoidUsageOfUsingAliasDirective" has code fix.

Refactorings

New Refactorings
  • ReplaceIfElseWithConditionalExpression
  • ReplaceConditionalExpressionWithExpression
roslynator -

Published by JosefPihrt about 8 years ago

Analyzers

Changes
  • "RemoveRedundantEmptyLine" analyzer - empty line is allowed when it is last line in 'do' statement's body (when 'while' token is on the same line as closing brace)
  • "UseExplicitTypeInsteadOfVar" and "UseVarInsteadOfExplicitType" analyzers - 'var' is allowed for 'default(T)' expression

Refactorings

New Refactorings
  • MergeAssignmentExpressionWithReturnStatement
  • CollapseToInitializer
  • IntroduceAndInitializeField
  • IntroduceAndInitializeProperty
roslynator -

Published by JosefPihrt about 8 years ago

Refactorings

New Refactorings
  • AddRegion
  • AddIfDirective
  • RemoveAllStatements
  • RemoveAllMembers
  • AddUsingDirective
roslynator -

Published by JosefPihrt about 8 years ago

Refactorings

New Refactorings
  • MergeIfStatements
  • AddDefaultValueToReturnStatement
  • InlineMethod
roslynator -

Published by JosefPihrt about 8 years ago

Refactorings

New Refactorings
  • AddExpressionFromIfStatement
  • RemoveAllSwitchSections
  • RemoveStatementsFromSwitchSections
  • AddConfigureAwait
  • RemovePreprocessorDirectiveAndRelatedDirectives
roslynator -

Published by JosefPihrt about 8 years ago

Refactorings

New Refactorings
  • ReplaceReturnStatementWithIfStatement
  • WrapStatementsInTryCatch
  • WrapStatementsInIfStatement
  • RemoveMemberDeclarations
roslynator -

Published by JosefPihrt over 8 years ago

Refactorings

New Refactorings
  • AddIdentifierToVariableDeclaration
  • RemoveEmptyLines
roslynator -

Published by JosefPihrt over 8 years ago

Refactorings

New Refactorings
  • CommentOutMember
  • CommentOutStatement
  • IntializerLocalWithDefaultValue
  • AddDefaultValueToParameter
Improvements
  • refactoring "ChangeTypeAccordingToExpression" works for field declaration
  • refactoring "AddCastExpression" works for case label expression
  • refactoring "FormatExpressionChain" does not format namespace
  • refactoring "ReplacePropertyWithMethod" works for property with setter
  • refactoring "ReverseForLoop" works for reversed for loop
roslynator -

Published by JosefPihrt over 8 years ago

Refactorings

New Refactorings
  • RemoveConditionFromLastElseIf
  • RemoveAllXmlComments
  • RemoveStatement
  • DuplicateStatement
  • ReplaceAnonymousMethodWithLambdaExpression
  • SplitVariableDeclaration
  • ReplaceCountWithLengthOrLengthWithCount
Changes
  • ChangeMethodReturnTypeToVoid
    • refactoring is available only when method body contains at least one statement
    • refactoring is not available for async method that returns Task
  • IntroduceUsingStaticDirective
    • refactoring is available only when class name is selected
roslynator -

Published by JosefPihrt over 8 years ago

Refactorings

New Refactorings
  • ReplaceDoStatementWithWhileStatement
  • ReplaceWhileStatementWithDoStatement
  • IntroduceUsingStaticDirective
  • ChangeMethodReturnTypeToVoid
  • ReplaceEnumHasFlagWithBitwiseOperation
roslynator -

Published by JosefPihrt over 8 years ago

Analyzers

Changes
  • many analyzers renamed
  • developmentDependency element added to CSharpAnalyzers.nuspec

Refactorings

New Refactorings
  • AddInterpolation
  • SimplifyLambdaExpression
Changes
  • refactorings can be enabled/disabled in Visual Studio UI (Tools - Options)
  • some refactorings are available only when C# 6.0 is available.
  • many refactorings renamed
  • refactoring "ChangeMemberTypeAccordingToReturnExpression" improved for async method
  • refactoring "AddCastToReturnExpression" improved for async method
  • refactoring "CheckParameterForNull" is not available for lambda and anonymous method
Bug Fixes
  • refactoring "MarkMemberAsStatic" should not be available for a constant.
roslynator -

Published by JosefPihrt over 8 years ago

Analyzers

Changes
  • analyzer "MergeIfStatementWithContainedIfStatement" renamed to "MergeIfStatementWithNestedIfStatement"

Refactorings

New Refactorings
  • MarkMemberAsStatic
  • MarkAllMembersAsStatic
  • FormatAccessorBracesOnSingleLine
  • GenerateSwitchSections
  • ConvertStringLiteralToCharacterLiteral
Changes
  • refactoring "ReverseForLoop" is available within 'for' keyword.
  • refactoring "SwapExpressionsInBinaryExpression" is available only for logical and/or expression.
  • refactoring "AddCastAccordingToParameterType" can offer more than one cast.
  • refactorings "SwapParameters" and "SwapArguments" removed (these are covered by "Change signature..." dialog)
  • refactorings "RemoveMember" and "DuplicateMember" are available only at opening/closing brace
Bug Fixes
  • refactoring "RemoveAllRegions" is available inside #endregion directive.
  • refactoring "RenameMethodAccordingToTypeName" handles properly async method.