exclude LINQEntityBase.cs from code analysis?

Jun 11, 2010 at 5:36 PM

 

Mike (and all L2sEb developers) --

It might be a good idea to exclude "LINQEntityBase.cs" from code analysis.

It can be done by simply making this line...

// <auto‐generated />

...the 1st line in the file.

If this line is added, then StyleCop (and similar tools) will not complain.

Alternately, it might be a good idea to make the code StyleCop-compliant, but that is certainly more work.

This is a minor suggestion, as food for thought.

HTH.

Thank you.

-- Mark Kamoski

 

Coordinator
Jun 14, 2010 at 9:25 AM
Hi Mark, I never thought of that, I'm a bit a against putting in the text // <auto-generated /> (or the [GeneratedCode] attribute) and was thinking more along this line: http://stackoverflow.com/questions/1445415/ignore-code-analysis-rules-in-visual-studio What do you think? Cheers Matt.
Coordinator
Jun 14, 2010 at 10:24 PM
Hi Guys, I've just had a look at "SuppressMessage" again, and in order to use this, you need a statement for every message Code Analysis you have in order to them all suppressed - unfortunately there isn't one which you can apply to a class that says "suppress all". Anyway, I've done separate messages and seems to work fine. Let me know how you go... Grab the latest from here: http://linq2sqleb.codeplex.com/SourceControl/list/changesets I'll work on changing the code to meet the code Analysis rules where it doesn't cause breaking changes in my next round of changes. Surprisingly, there are not that many. Cheers Matt.
Coordinator
Jun 14, 2010 at 10:24 PM
Anyone noticed that codeplex is trimming of newline chars for comments???
Jun 30, 2010 at 2:29 PM
mhunter wrote:
Anyone noticed that codeplex is trimming of newline chars for comments???

Mike --

Yes, that newline trimming has been a common problem here at www.CodePlex.com for some time, at least for me.

It seems intermittent and or it seems to happen in certain areas and not in other areas.

I was blaming it on Chrome but it could be CodePlex and or Chrome.

-- Mark Kamoski

Jun 30, 2010 at 2:40 PM

 

Mike --

Regarding this...

>>>I've just had a look at "SuppressMessage" again, and in order to use this, you need a statement for every message Code Analysis you have in order to them all suppressed - unfortunately there isn't one which you can apply to a class that says "suppress all".

...yes, SuppressMessage is not as useful as it looks, IMHO, for the reasons you state.

Making the LinqToSqlEntityBase file StyleCop-compliant is probably the best way to go, IMHO; but, "who is doing the work" and I would not want to increase your workload.

As such, I was suggesting just a quick hack, GEFN, I think.

Just for the record, note that other quick hacks are available-- for example, one can make sure a file ends with one of the following suffixes...

*.Designer.cs

*.g.cs

*.generated.cs

...and then one simply needs to set StyleCop as AnalyzeGeneratedFiles=NotChecked and AnalyzeDesignerFiles=NotChecked, which is essentially required given that Visual Studio auto-creates a lot of these files, and then StyleCop will skip-over the file.

(BTW, it turns out that adding the "// <auto‐generated />" may not really work as advertized-- my tests were inconclusive.)

HTH.

Thank you.

-- Mark Kamoski

 

Jun 30, 2010 at 2:50 PM
mhunter wrote:
Anyone noticed that codeplex is trimming of newline chars for comments???

BTW, I set Chrome to use IeTab for CodePlex and it is OK now.

That is just sweeping it under the rug, I know, but it is a workaround.

Even so, IeTab is a bit flaky itself, which may be IeTab's issue or Ie's issue or Chrome's issue or some combination thereof-- ug, this is getting complicated-- what happened to simple browsers?

:-)

 

Coordinator
Jul 2, 2010 at 6:19 AM

Lol, I actually like where the browsers are heading in terms of standards compliance, but they are not quite there yet... 

CODE ANALYSIS: When I did if for the built in code analysis, there wasn't that much that it complained about, only a few things like LINQ and the other that don't affect method signatures aren't too hard to correct.  It won't take me long.