I know, StyleCop is not perfect, but we try to use it in a helpful way. I do like the fact that it complains about undocumented arguments. Now, for properties and constructors it recommends what the text should be, but it does not help with Dispose method, and I think it should. We have many classes that implement IDisposable. In this pa...
Our team has some code guidelines that I would like to enforce via stylecop rules. For most of the things a Settings.Stylecop file is used. However, I would like to enforce documentation for private methods and I can not find the way to do this in the Settings file. If I right-click on a project and select "stylecop settings", I can unch...
Sometimes it can be confusing reading code in instance members that refers to other instance members of the same class (or a base class):
public void MyMethod()
{
Where = did + AllTheseWeirdThings(GetDeclared()); // ?
}
Having a coding standard something like "prefix all private/protected members with "_" doesn't help, because ins...
If I use the Code Cleanup ReSharper feature I get this start of a file:
using System.Web.UI;
[assembly: WebResource("Company.Web.Resources.foo.js", "application/x-javascript")]
namespace SiteSeeker.Web.WebControls
{
using System;
using System.Collections.Specialized;
using System.Reflection;
using System.Web;
using...
We have a team of 40+ engineers working on a common code base. We're using resharper, and have been sharing our suggested settings by having a 'definitive' configuration file emailed out which people can import.
However, as time goes on we wish to tighten up on various things on new versions and new work, without requiring refactoring o...
Hi!
I am using StyleCop 4.4.0 RTW. I have installed it, copied the contents to a version controlled directory and I've added it to each of my project files by simply adding this line to each .csproj-file:
<Import Project="..\Library\StyleCop\v4.4\Microsoft.StyleCop.targets" />
The basic functionality seems to work. When I Build a pro...
Hi, is there any plugin for Resharper or VS extensions for auto sorting class/struct members as suggested by StyleCop? I.e. something which sorts public, protected, then private properties, then public, protected, private methods?
...
StyleCop has a rule about using "this." prefix to calling class members (SA1101).
Is this rule holds true about a member (for example a method) of a class which is inherited from its base class.
Example:
class BaseClass
{
protected void F1()
{
...
}
}
class ChildClass : BaseClass
{
protected void F2()
...
I use Visual Studio 2010 Premium Code Analysis (CA) capabilities and force them at every compile with my projects while also showing warnings as errors, so I keep my code nice and well... better.
But.
Since this CA is very nice and all I wouldn't want to use StyleCop as well. Because StyleCop gives me code style specification that CA d...
I like to split the SA1600 stylecop rule but how to do it?
Right now it scans for undocumented classes, constructors, delegates, enums, events, finalizers, indexers, interfaces, methods, properties, and structs. I like to disable the warnings of some of them.
...
this may seem like a trivial question but when i installed the stylecop plugin for resharper my comments are getting formatted like this
/// <summary>
/// Gets the gift item.
/// </summary>
/// <param name="uid">
/// The uid.
/// </param>
/// <param name="upc">
/// The upc.
/// </param>
/// <returns>
/// </returns>
Gift GetGift(long uid...
Got a style conflict between StyleCop and Resharper.
Stylecop 1303 says that const vars should start uppercase and I agree.
Resharper says OK for class-wide const declarations, but when using a const in a local (e.g. method) scope, Reshaper doesn't approve and wants to make everything camelCasing.
Of course no problem to disable this r...
I am sorry for asking a dull question.
I'd like to provide StyleCop as a default code review tool in the company I am working for.
StyleCop is a great tool, but the question is: is there a complete document that describe the code convention rules StyleCop based on? Not a list of warnings, but readable set of rules and explanations.
T...
Hi Everybody,
Is there a way to run StyleCopCmd with StyleCop 4.4.*?
I have tried to simply exchange to old stylecop assemblies with the new ones but this leads to an exception that the assembly with the specific version 4.3.0.8 could not be loaded. Is there a hack?
Thanks in advance.
...
StyleCop is a tool that analyzes C# source code to enforce a set of style and consistency rules.
Is there anything similar for the Ruby language?
...