This project has moved. For the latest updates, please go here.

Clean up codebase to comply with default Stylecop setting?

Jul 27, 2010 at 11:41 PM

Granted the codebase has been around for quite awhile, but is there any possibility of cleaning up the codebase to comply with most of the default Stylecop settings?  With the exception of those that would move namespaces or rename classes, of course.  But things like cleaning up the comments, explicitly providing visibility, grouping methods/properties/fields by their visibility (that wouldn't impact the structure layout) would make looking over the codebase a lot easier.  As of right now the NAudio project alone has several thousand violations so it's definitely no small undertaking. I'd be up for the undertaking if there's actually interest.

Aug 1, 2010 at 11:26 PM

For those interested, I did nearly all StyleCop fixes to changeset 57274 with the exception of documentation and explicit parenthesis around math operations.  For naming rules I put in a number of SuppressMessage attributes so that there's no breaking changes from the current external API.  There hasn't been any functionality or name changes, but nearly every file has been changed due to a lot of implicit conventions (letting the compiler figure out object visibility (private, internal, etc.)), spacing around things like commas, or adhering to "one non-nested class per file".

Since this repository is SVN based rather than Hg based, the power of using Git-svn came in handy as I could do single commits for each rule.  And because of that I can't do a pull request, but I have the file hosted on my website available at http://sleeplessmonkey.com/projects/NAudio_57274_WithStyleCop.zip.  Hopefully others find it useful (and it gets merged into the actual project...)

Coordinator
Sep 29, 2010 at 9:35 AM

Hmmm, interesting, if not slightly OCD! I find some of sytlecop's rules to be over fussy. However, I started NAudio ages ago when I was still programming in a Java style so the codebase could do with a bit of a cleanup.

Maybe if I get NAudio changed over to Mercurial, we could look into doing this. Probably not before NAudio 1.4 though.

Mark

Sep 29, 2010 at 5:50 PM

Being really OCD would be getting into compliance with FxCop/Code Analysis settings as well.  Like I said, I'd be more than willing to work with you on defining what StyleCop settings to use and undertake the process of getting the code base into compliance with it.  Using StyleCop for Resharper makes quick work of a lot of the issues.

Coordinator
Oct 12, 2010 at 7:23 PM

good idea, we'll look at this after I release 1.4