Questions tagged [stylecop]

StyleCop analyzes C# source code to enforce a set of style and consistency rules.

643 questions
14
votes
4 answers

How to get rid of StyleCop

Someone on our team installed StyleCop and since then all of the projects he loaded up and committed to source control refuse to load unless stylecop is installed. I know I can manually edit the .csproj files to get rid of it, but is there an easy…
gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
14
votes
4 answers

How do you resolve the discrepancy between "StyleCop C# style" and "Framework Design Guidelines C# style"?

After going through the Appendix A, "C# Coding Style Conventions" of the great book "Framework Design Guidelines" (2nd edition from November 2008), I am quite confused as to what coding style is Microsoft using internally / recommending. The blog…
Milan Gardian
  • 11,326
  • 5
  • 38
  • 45
13
votes
1 answer

Temporarily disable StyleCop warnings on ReSharper 6

I downloaded StyleCop 4.6.3 which integrates with ReSharper 6 and the results are really fantastic! However on a specific project I would like to disable the StyleCop warnings (temporarily) and enable again later on. Is there any way of doing this?…
Nikos Baxevanis
  • 10,868
  • 2
  • 46
  • 80
13
votes
3 answers

How can I make VS2010 insert using statements in the order dictated by StyleCop rules

The related default StyleCop rules are: Place using statements inside namespace. Sort using statements alphabetically. But ... System using come first (still trying to figure out if that means just using System; or using System[.*];). So, my use…
Hamish Grubijan
  • 10,562
  • 23
  • 99
  • 147
13
votes
4 answers

Specify path to CustomDictionary file for StyleCop spellchecking

Spell checking of the comments was added to the recent versions of StyleCop. It seems I can reuse my existing CustomDictionary file (that I created for FxCop) with StyleCop. SA1650 rule documentation does not say that it is possible. But in release…
Andrew Bezzub
  • 15,744
  • 7
  • 51
  • 73
12
votes
8 answers

FxCop/StyleCop for Delphi?

Does anyone know of an equivalent to FxCop/StyleCop for Delphi? I would really like to get the automatic checking of style, etc. into Continuous Integration.
mmmm
  • 2,431
  • 2
  • 35
  • 56
12
votes
1 answer

StyleCop-Where's my output?

When I run it, I see this output in the "Output" window. Where can I find the detail about the actual violations found? ------ StyleCop started ------ Pass 1: Form1.Designer.cs... Pass 1: Form1.cs... Pass 1: MonthPeriod.cs... Pass 1:…
VJK
  • 532
  • 1
  • 5
  • 16
11
votes
2 answers

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

How can I set up in StyleCop rules that all private fields must begin with underscore _?
Alexander Molodih
  • 1,928
  • 2
  • 20
  • 30
11
votes
3 answers

StyleCop/FxCop 10 - How do you properly suppress a message only on a namespace level?

FxCop 10 is complaining about the following: using XYZ.Blah; //CA1709 - "XYZ" using Xyz.Blah; //No complaint. using XylophoneSuperDuperLongFullName.Blah; //I don't want to have a long full name for my company name. The problem is... I want my…
michael
  • 14,844
  • 28
  • 89
  • 177
11
votes
2 answers

How do I prevent StyleCop warning of a Hungarian notation when prefix is valid

I have the following code: var fxRate = new FxRate(); which is giving me the following StyleCop ReSharper warning: The variable name 'fxRate' begins with a prefix that looks like Hungarian notation. I have tried copying the Settings.StyleCop…
openshac
  • 4,966
  • 5
  • 46
  • 77
11
votes
2 answers

Disable Stylecop on single code line (the namespace)

We have an existing product where we would like to implement the usage of StyleCop. However, we have one problem with this and it's that all our namespaces starts with lower-case (for instance lowerCase.UpperCase.Etc.Etc.) and ofcourse that leads to…
J. Abrahamsson
  • 431
  • 4
  • 21
10
votes
3 answers

Which are the differences between StyleCop and Code Analysis when talking about the rules of each?

Could you please tell me which are the differences between rules of StyleCop and Code Analysis ? Should it be used together or not ? Thanks.
lex87
  • 1,276
  • 1
  • 15
  • 33
10
votes
3 answers

How do you use stylecop with .xaml files

I have been tasked with utilizing stylecop on .xaml files. Does anyone have a good place to start looking for the best way to accomplish this task. I have drifted around the internet and have yet to find a good solution. Our development environment…
billmiller
  • 191
  • 1
  • 2
  • 6
10
votes
2 answers

sharing resharper & stylecop settings with team in solution

I have a team of 5 developers which I work with and within the team we all use Resharper and Stylecop to assist with out development. We develop .net applications in C# using visual studio and use TFS for source control. Each developer has a…
amateur
  • 43,371
  • 65
  • 192
  • 320
10
votes
2 answers

Properly remove StyleCop R# plugin

I installed StyleCop and the associated plugin for ReSharper 5. After getting annoyed with it I removed both the plugin and StyleCop, but ReSharper is still using some of the StyleCop behaviour - most notably moving using statements to within the…
Michael Shimmins
  • 19,961
  • 7
  • 57
  • 90