StyleFix provides a GUI interface to selectively exclude/include files for
StyleCop violation checks. It also automatically fixes them.
How it is done?
- It builds the project (using msbuild) in the background and then parses the output to get the line numbers and file names.
- It then goes to the source file on those line and fixes the problem using string replacement, regular expression etc.
The image below shows the interface where you can selectively choose which files should be included in the StyleCop check. This is useful as it will allow you to manage the StyleCop violations a piece at a time.

These are the current violations that can be automatically fixed. More are on the way!
SA1000 - KeywordsMustBeSpacedCorrectly
SA1001 - CommasMustBeSpaceCorrectly
SA1003 - SymbolsMustBeSpaceCorrectly
SA1005 - SingleLineCommentsMustBeginWithSingleSpace
SA1009 - ClosingParenthesisMustBeSpacedCorrectly
SA1010 - OpeningSquareBracketsMustBeSpacedCorrectly
SA1025 - CodeMustNotContainMultipleWhitespaceInARow
SA1027 - TabsMustNotBeUsed
SA1101 - PrefixLocalCallsWithThis
SA1121 - UseBuiltInTypeAlias
SA1122 - UseStringEmptyForEmptyStrings
SA1200 - UsingDirectivesMustBePlacedWithinNamespace
SA1210 - UsingDirectivesMustBeOrderedAlphabeticallyByNamespace
SA1500 - CurlyBracketsForMultiLineStatementsMustNotShareLine
SA1501 - StatementMustNotBeOnASingleLine
SA1505 - OpeningCurlyBracketsMustNotBeFollowedByBlankLine
SA1506 - ElementDocumentationHeadersMustNotBeFollowedByBlankLine
SA1507 - CodeMustNotContainMultipleBlankLinesInARow
SA1508 - ClosingCurlyBracketsMustNotBePrecededByBlankLine
SA1509 - OpeningCurlyBracketsMustNotBePrecededByBlankLine
SA1510 - ChainedStatementBlocksMustNotBePrecededByBlankLine
SA1512 - SingleLineCommentsMustNotBeFollowedByBlankLine
SA1513 - ClosingCurlyBracketsMustNotBeFollowedByBlankLine
SA1515 - SingleLineCommentsMustBePrecededByBlankLine
SA1516 - ElementsMustBeSeparatedByBlankLine
SA1633 - FileMustHaveHeader
More Information on this is available on the blog:
http://blog.officeclip.com/2009/02/stylefix-how-to-fix-stylecop-violationsIf you want to provide some Development or QA help on this tool, please leave a message.
Note: This program is currently in beta. Please keep backups of all your code before applying this program.