Rule SA1516 as applied to AssemblyInfo.cs

Mar 21, 2011 at 1:21 PM

Rule SA1516 brings up a series of messages relating to the Assembly macros in AssemblyInfo.cs.

Why is it necessary to add a blank line between each Assembly Macro?

Coordinator
Mar 21, 2011 at 1:55 PM

You mean the [assembly: ] attributes, correct?

Mar 21, 2011 at 2:13 PM
andyr wrote:

You mean the [assembly: ] attributes, correct?

Yes.

Coordinator
Mar 21, 2011 at 2:18 PM

Because they are adjacent elements.

All adjacent elements must be separated by a blank line.

Are you proposing that adjacent elements do not need to be separated by a blank line if the elements are assembly attributes only?

Mar 21, 2011 at 2:32 PM
andyr wrote:

Because they are adjacent elements.

All adjacent elements must be separated by a blank line.

Are you proposing that adjacent elements do not need to be separated by a blank line if the elements are assembly attributes only?

Yes - they have always been generated that was by default from Visual Studio.

Coordinator
Mar 21, 2011 at 2:34 PM

Yes, there are a few generated files that need to be reformatted for StyleCop rules.

Developer
Mar 21, 2011 at 8:17 PM

I actually noticed this yesterday too and was also going to raise this issue.  Raising warnings for these is new behavior that was not present in StyleCop 4.4.0.14 (nor 4.3 to my recollection).

If raising warnings is proposed as new, intended behavior:  IMO, whether we're talking assembly attributes or method attributes or property attributes (etc), they are "decorating" the same thing (assembly, method, property, etc) and thus make sense to be allowed tightly coupled with the thing they apply to.

Mar 21, 2011 at 8:19 PM
karak wrote:

I actually noticed this yesterday too and was also going to raise this issue.  Raising warnings for these is new behavior that was not present in StyleCop 4.4.0.14 (nor 4.3 to my recollection).

If raising warnings is proposed as new, intended behavior:  IMO, whether we're talking assembly attributes or method attributes or property attributes (etc), they are "decorating" the same thing (assembly, method, property, etc) and thus make sense to be allowed tightly coupled with the thing they apply to.

I think Karak is correct.

Coordinator
Mar 21, 2011 at 8:23 PM

Ah, I didn't see that it was new behaviour. Please open a bug and I'll fix.

Coordinator
Mar 21, 2011 at 9:23 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Mar 21, 2011 at 9:34 PM

Fixed in 4.5.0.3 now.

Apr 12, 2011 at 6:23 AM

I confirm fixed.