Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set up in StyleCop rules that all private fields must begin with underscore?

Tags:

.net

stylecop

How can I set up in StyleCop rules that all private fields must begin with underscore _?

like image 600
Alexander Molodih Avatar asked Nov 14 '11 10:11

Alexander Molodih


People also ask

How do you change rules on StyleCop?

In your StyleCop install, there's a Settings. StyleCop file. You can edit this to turn off rules globally. Drag that file onto the Settings Editor executable in that file to edit it.

What is StyleCop JSON?

stylecop.jsonCode analysis rule sets are the standard way to configure most diagnostic analyzers within Visual Studio. Information about creating and customizing these files can be found in the Using Rule Sets to Group Code Analysis Rules documentation on docs.microsoft.com.


1 Answers

You could take a look at StyleCop+ with its flexible naming rules. It is open-source, so you could also use it for writing your own custom rules.

P.S. A similar question: Find out if CsElement is a static field? (StyleCop custom rule)

like image 104
Oleg Shuruev Avatar answered Sep 24 '22 22:09

Oleg Shuruev