Multiple errors on one line recorded inconsistently

Aug 27, 2012 at 2:13 PM

I am using stylecop on a project and I've noticed something that I don't understand and I'm hoping someone may be able to shed some light on?

There are 2 errors one one line of code.

As the build runs the error is only logged once (1576,1):

build    27-Aug-2012 11:02:38    C:\Bamboo\xml-data\build-dir\CATMEM-CI-JOB1\CatalystMembers.DomainServices\AccountDevice\AccountDeviceService.cs(1576,1): warning : SA1001: Invalid spacing around the comma. [C:\Bamboo\xml-data\build-dir\CATMEM-CI-JOB1\CatalystMembers.DomainServices\CatalystMembers.DomainServices.csproj]

 

A change is made in this file on a different line, and then when stylecop is run the next time the 2 errors are logged seperately:

build    27-Aug-2012 12:47:42    C:\Bamboo\xml-data\build-dir\CATMEM-CI-JOB1\CatalystMembers.DomainServices\AccountDevice\AccountDeviceService.cs(1576,259,1576,259): warning : SA1001: Invalid spacing around the comma. [C:\Bamboo\xml-data\build-dir\CATMEM-CI-JOB1\CatalystMembers.DomainServices\CatalystMembers.DomainServices.csproj]

build    27-Aug-2012 12:47:42    C:\Bamboo\xml-data\build-dir\CATMEM-CI-JOB1\CatalystMembers.DomainServices\AccountDevice\AccountDeviceService.cs(1576,273,1576,273): warning : SA1001: Invalid spacing around the comma. [C:\Bamboo\xml-data\build-dir\CATMEM-CI-JOB1\CatalystMembers.DomainServices\CatalystMembers.DomainServices.csproj]

If I rerun StyleCop again without making change the error goes back to being logged only once:

build    27-Aug-2012 14:34:39    C:\Bamboo\xml-data\build-dir\CATMEM-CI-JOB1\CatalystMembers.DomainServices\AccountDevice\AccountDeviceService.cs(1576,1): warning : SA1001: Invalid spacing around the comma. [C:\Bamboo\xml-data\build-dir\CATMEM-CI-JOB1\CatalystMembers.DomainServices\CatalystMembers.DomainServices.csproj]

 

I was hoping someone could explain if this is correct behaviour?

Is there a way to get the output consistent?

 

The reason it is a problem is that we are trying to make the number of stylecop errors go down, if they go up it fails our CI build.

 

I'd appreciate any help, thanks.

Danny

Coordinator
Aug 27, 2012 at 2:15 PM

Hi,

Please open a work item and attach a sample file with repro steps and I'll investigate and fix for you.

Sep 3, 2012 at 3:39 PM

Done:

http://stylecop.codeplex.com/workitem/7390