StyleCopAid is a Visual Studio extension that helps to automatically fix code formatting warnings identified by the StyleCop tool.
Benefits
- Automatically fix over 40 different StyleCop violations, including some the most labor-intensive ordering and documentation ones
- Automatically suppress rules that otherwise require code refactoring
- As a safety feature, undo the last change when making fixes
Donate
While free for general use, donations to support past, present, and future tool development are welcomed and greatly appreciated.
Usage Guide
Analyze your code using the StyleCop tool. Select a rule violation that you want to fix or suppress and use the right-click contextual menu to pick appropriate action. Verify that the change is acceptable. Use the Undo feature as needed. Fixing/suppressing of multiple warnings is supported but we recommend you do them in smaller chunks before you familiarize yourself with the tool.
Supported Visual Studio versions
The tool supports Visual Studio 2010, 2012, and 2013 versions.
Supported Rules
Fix automatically
Spacing Rules
SA1001: CommasMustBeSpacedCorrectly
SA1003: SymbolsMustBeSpacedCorrectly
SA1005: SingleLineCommentsMustBeginWithSingeSpace
SA1012: OpeningCurlyBracketsMustBeSpacedCorrectly
SA1013: ClosingCurlyBracketsMustBeSpacedCorrectly
SA1014: OpeningGenericBracketsMustBeSpacedCorrectly
SA1025: CodeMustNotContainMultipleWhitespaceInARow
SA1027: TabsMustNotBeUsed
Readability Rules
SA1101: PrefixLocalCallsWithThis
SA1102: QueryClauseMustFollowPreviousClause
SA1111: ClosingParenthesisMustBeOnLineOfOpeningParenthesis
SA1115: ParameterMustFollowComma
SA1116: SplitParametersMustStartOnLineAfterDeclaration
SA1118: ParameterMustNotSpanMultipleLines
SA1120: CommentsMustContainText
SA1122: UseStringEmptyForEmptyStrings
Ordering Rules
SA1200: UsingDirectivesMustBePlacedWithinNamespace
SA1201: ElementsMustAppearInTheCorrectOrder
SA1202: ElementsMustBeOrderedByAccess
SA1204: StaticElementsMustAppearBeforeInstanceElements
SA1206: ElementsMustBeOrderedByAccess
SA1208: SystemUsingDirectivesMustBePlacedBeforeOtherUsingDirectives
SA1210: UsingDirectivesMustBeOrderedAlphabeticallyByNamespace
SA1215: InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements
Maintainability Rules
SA1407: ArithmeticExpressionsMustDeclarePrecedence
Layout Rules
SA1500: CurlyBracketsForMultiLineStatementsMustNotShareLine
SA1501: StatementMustNotBeOnSingleLine
SA1502: ElementMustNotBeOnSingleLine
SA1503: CurlyBracketsMustNotBeOmitted
SA1505: OpeningCurlyBracketsMustNotBeFollowedByBlankLine
SA1507: CodeMustNotContainMultipleBlankLinesInARow
SA1508: ClosingCurlyBracketsMustNotBePrecededByBlankLine
SA1512: SingleLineCommentsMustNotBeFollowedByBlankLine
SA1513: ClosingCurlyBracketMustBeFollowedByBlankLine
SA1514: ElementDocumentationHeaderMustBePrecededByBlankLine
SA1515: SingleLineCommentMustBePrecededByBlankLine
SA1516: ElementsMustBeSeparatedByBlankLine
SA1517: CodeMustNotContainBlankLinesAtStartOfFile
SA1518: CodeMustNotContainBlankLinesAtEndOfFile
Documentation Rules
SA1600: ElementsMustBeDocumented
SA1615: ElementReturnValueMustBeDocumented
SA1622: GenericTypeParameterDocumentationMustHaveText
SA1626: SingleLineCommentsMustNotUseDocumentationStyleSlashes
SA1627: DocumentationTextMustNotBeEmpty
SA1633: FileMustHaveHeader
Suppress automatically
Naming Rules
SA1300: ElementMustBeginWithUpperCaseLetter
SA1304: NonPrivateReadonlyFieldsMustBeginWithUpperCaseLetter
SA1306: FieldNamesMustBeginWithLowerCaseLetter
SA1307: AccessibleFieldsMustBeginWithUpperCaseLetter
SA1309: FieldNamesMustNotBeginWithUnderscore
SA1310: FieldNamesMustNotContainUnderscore
SA1311: StaticReadonlyFieldsMustBeginWithUpperCaseLetter
Maintainability Rules
SA1400: AccessModifierMustBeDeclared
SA1401: FieldsMustBePrivate
SA1407: ArithmeticExpressionsMustDeclarePrecedence
SA1409: RemoveUnnecessaryCode
Layout Rules
SA1500: CurlyBracketsForMultiLineStatementsMustNotShareLine
Documentation Rules
SA1644: DocumentationHeadersMustNotContainBlankLines
SA1650: ElementDocumentationMustBeSpelledCorrectly
Version History
See here