Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which StyleCop rules should I follow when writing a open source library [closed]

Tags:

I am currently writing an open source wrapper for a COM object. I have just installed StyleCop and run it against some of my code, and as I expected it threw up a load of warnings (some of which I should have been doing already eg adding "this." to all local method calls and variables)

How many of these warnings should I try and reduce? Which ones would be the best ones when writing an open source library?

like image 308
Nathan W Avatar asked Dec 02 '08 13:12

Nathan W


1 Answers

The general idea with StyleCop is: All of them :)

The more options you turn off the less value StyleCop has in enforcing a one-true code format. That being said, if you don't like some of the options then some options is better than none, include the StyleCop settings file with your code and others working on it can then use the same settings.

Some of the settings may seem weird at first if you're not familiar with StyleCop, but having used it for two years now I leave all the options on and our team is quite happy with the results.

I'd also say that if you're providing a library or framework that using FxCop may be more important than using StyleCop.

like image 83
Simon Steele Avatar answered Nov 09 '22 23:11

Simon Steele