Questions tagged [stylecop]

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

643 questions
17
votes
2 answers

CA1014 Mark 'some.dll' with CLSCompliant(true) error message with StyleCop of VS2010

When I run StyleCop, I got this error message saying that I need to Mark the dll with CLSCompliant(true). What is this? How can I set the Mark the dll with CLSCompliant(true)? Error 4 CA1014 : Microsoft.Design : Mark 'SOMETHING.dll' with…
prosseek
  • 182,215
  • 215
  • 566
  • 871
17
votes
3 answers

how to properly install stylecop?

Well i downloaded the newest version, then installed, checked to instal entire files on local drive. I restarted VS2010 and rerun it. Unfortunatelly i can't find in menu > tools anything with should be connected with stylecop ( as in tutorial "how…
deadfish
  • 11,996
  • 12
  • 87
  • 136
17
votes
2 answers

StyleCop SA1600 rule and interfaces realisation

StyleCop rule SA1600 demands that every type member has it's own documentation header. I think it's quite reasonable and I like this rule. But suppose we have the following hierarchy: /// /// Documentation for interface ISomeModule. ///…
Dmitrii Lobanov
  • 4,897
  • 1
  • 33
  • 50
17
votes
7 answers

Is there a way to enforce using tabs instead of spaces?

StyleCop offers to check for consistent use of spaces, but sadly lacks the opposite idea: Force source code to use tabs. Is there some way to add this functionality? It does not have to be StyleCop, other tools are welcome as well.
mafu
  • 31,798
  • 42
  • 154
  • 247
17
votes
2 answers

Namespace naming convention when [CompanyName] starts with a lower case "i"

My company name starts with a lower case "i". For example: iWare (this is not the real company name, but it demonstrates the purposes). Because of this I find that I am constantly having to fight StyleCop and Resharper due to the namespace naming…
gregpakes
  • 4,465
  • 29
  • 43
16
votes
5 answers

MS StyleCop and CruiseControl.NET

I wonder if anybody tried to integrate StyleCop into CruiseControl.NET. Does anybody know something about it? or at least did anybody create and publish an xsl file for displaying StyleCop result onto CCNet's dashboard? EDIT: I found this project,…
Steve
  • 371
  • 4
  • 13
16
votes
5 answers

StyleCop for other languages

weve been using StyleCop for enforcing coding standards in C#, I was wondering are there similar tools for other languages? namely: js css sql
James Hollingworth
16
votes
3 answers

Best way to integrate StyleCop with TFS CI

I've been doing research on how to enable source analysis for the project I'm working on and plan to use StyleCop. The setup I have is a TFS Server for source control, using TFS Continuous Integration. I want to enable source analysis for CI builds…
Slavo
  • 15,255
  • 11
  • 47
  • 60
16
votes
7 answers

Alternative to StyleCop for Visual Studio?

I like StyleCop's static code analysis and rules enforcement. However, it is severely lacking in several key departments. Adding new rules isn't officially supported and from what I hear pretty difficult. Automatic "fixing" of trivial rules…
mmcdole
  • 91,488
  • 60
  • 186
  • 222
16
votes
2 answers

How to suppress StyleCop error SA0102 : CSharp.CsParser : A syntax error has been discovered in file when using generic type parameters attributes

Having the following C# code with generic type parameter attribute: [System.AttributeUsage(System.AttributeTargets.GenericParameter)] public class GenericParameterAttribute : System.Attribute { } public class GenericClass<[GenericParameter]…
Sergey Fadeev
  • 333
  • 1
  • 4
  • 10
15
votes
1 answer

How do I set the ReSharper default Company and Copyright?

I just installed Stylecop 4.5RC along with ReSharper. When I create a new class, I see that I am now compliant (yay!), but I want the company to be my company, not Microsoft. I also have too much to do to have to worry about updating the copyright…
tofutim
  • 22,664
  • 20
  • 87
  • 148
15
votes
3 answers

style cop + resharper control comments

this may seem like a trivial question but when i installed the stylecop plugin for resharper my comments are getting formatted like this /// /// Gets the gift item. /// /// /// The uid. /// ///
Rod Johnson
  • 2,387
  • 6
  • 30
  • 48
15
votes
1 answer

Disable stylecop analysis for specific projects within solution

Is there a way to easily stop StyleCop warnings from being displayed within specific projects in a solution. Or, more pointedly, a way to select which projects StyleCop analysis should be performed on by Visual Studio? We have a solution with 9…
levelnis
  • 7,665
  • 6
  • 37
  • 61
15
votes
2 answers

How to suppress a StyleCop warning of entire namespace files

I'm using Style Cop version 4.7. Global suppression don't work for every member of selected namespace. I have two files in the same namespace (StyleCopSample.Test). When I set suppress message in the first file, messages are suppressing only for…
Andrius
  • 153
  • 1
  • 5
14
votes
3 answers

How can you force StyleCop for ReSharper to ignore files?

We’ve just been working on introducing StyleCop to our team and are using the StyleCop ReSharper plugin from Code Plex. Problem is, every single file in the project appears to be getting analysed and we can’t find a way to exclude particular files.…
Troy Hunt
  • 20,345
  • 13
  • 96
  • 151