SVNStyleCop utility allows to integrate StyleCop with SVN server. This utility will run StlyeCop for every committed file (in pre-commit hook) and roll back commit if violation occurs. Detailed violation report sent back to the client.
How to install:
- Download archive and unpack it anywhere on SVN server
- Set valid path to svnlook.exe in SVNStyleCop.exe.config file
- Replace SVNSettings.StyleCop with your standards if needed
- Add path patterns to pathPatterns group in SVNStyleCop.exe.config file. It should be a valid regex. Example:
will analyze all *.cs files that about to be committed to SalesManager and Utiltes folder on SVN server (autogenerated files will not be analyzed according to SVNSettings.StyleCop file).
Now you can be sure that nobody will commit files with StyleCop violations!
- Set valid path to SVNStyleCop.exe and svnlook.exe in pre-commit.cmd
- Move pre-commit.cmd to the hooks folder of your SVN repository. It also enables comments to be required. You can comment corresponding lines in pre-commit.cmd if it is not needed.