What is StyleCop+?
StyleCop+ is a plug-in that extends original StyleCop
It offers you a variety of rules for building C# code style that best suits your needs.
Please read full StyleCop+ documentation
for more detailed information, such as quick start guide
or rules reference
Advanced Naming Rules
StyleCop+ contains rich and flexible naming rules that are intended to completely replace all original Naming Rules (SA13xx
They allow specifying separate naming rules for each code entity - namespaces, classes, interfaces, methods... etc.
As a result, you can build any style you need, whether it is "m_field
" style, "_field
" style, or any other.
- Rich variety of entities
- For example, you can specify separate rules for private event handlers (buttonStart_Click) or unit test methods (Setting_Null_Throws_Exception).
- Several naming templates for each entity
- Make your style more flexible or add some exceptions to the basic rules.
- Usage of naming macros
- Most popular naming styles are available (PascalCasing, camelCasing, ALL_UPPER... etc.)
- Abbreviations support
- Specify the abbreviations you want to use, e.g. ID or OK.
- Checking name endings for derived classes
- For example, you could ensure that all classes derived from Exception are named like ...Exception.
Read more about Advanced Naming Rules in documentation. (this page is not ready yet)
More Custom Rules
StyleCop+ offers more custom rules for making your style tougher.
Most of them have flexible settings, configured through user-friendly UI.
And a small example illustrates what this rule is about.
Please send new rule proposals
, if your code style needs more checks.
If they are common enough, they will likely be added as soon as possible.
Read more about More Custom Rules in documentation. (this page is not ready yet)
Extended Original Rules (experimental feature)
StyleCop+ also contains rules that are based on the original ones, but work in a bit diferent way.
They may remove some restrictions, or add more options for customizing original checking behavior.
For example, original SA1509
rule prohibits using a blank line before opening curly bracket.
But sometime people want to use constructions like this:
// some statements
int a; // declaration of local variables required to set value of f1
this.f1 = ...;
int a; // declaration of local variables required to set value of f2
this.f2 = ...;
StyleCop+ has its own rule - SP1509
, which behaves like SA1509
, but doesn't throw a violation on such "nested code blocks".
In other cases, SP1509
rule works exactly as original SA1509
Note that StyleCop+ doesn't have its own code which looks like original SA1509 check - it really executes original StyleCop's SA1509 check, but analyzes the result in its own way.
Read more about Extended Original Rules in documentation. (this page is not ready yet)