4

I've been looking for somethig like JsHint for a while now, but aimed at verifying whether a team's coding conventions are being followed in C# instead of Javascript. I've been googlinghigh and low but I can't find anything. Do you fellow overflowers know of such a tool?

I'm ultimately thinking about making one of my own, should none currently exist.

Geeky Guy
  • 9,229
  • 4
  • 42
  • 62
  • 5
    http://www.jetbrains.com/resharper/ – jbabey Jul 18 '13 at 16:49
  • http://stylecop.codeplex.com/ maybe more exact match (if you need build time integration). – Alexei Levenkov Jul 18 '13 at 16:52
  • 1
    I agree with jbabey that this question seems like a duplicate - I even voted to close it so it would have that banner redirecting to the other question - but then I saw that it was asked in 2009. I think new tools may have arised in the last four years. StyleCop, for example - for all I know, it was created in 2010. – Geeky Guy Jul 18 '13 at 16:53
  • Alexei's vote, however, is for a 2012 question - so yes, I think this one is really better of marked as a duplicate. – Geeky Guy Jul 18 '13 at 16:56
  • 1
    @Renan see [How to ask a “Recommended design / tool for the job” question correctly, and where?](http://meta.stackexchange.com/questions/147641/how-to-ask-a-recommended-design-tool-for-the-job-question-correctly-and-whe), where the answer is: don't (anymore). Here you [could ask](http://stackoverflow.com/help/dont-ask) whether a specific tool is up for the job, but you can try that yourself by using it. :-) (Disregard the programmers.se suggestion I edited out, there it's [explicitly forbidden](http://programmers.stackexchange.com/help/on-topic) in the FAQ). – CodeCaster Jul 18 '13 at 16:57
  • 1
    @CodeCaster yeah, but the help section of *Programmers* says SO is the best place for this kind of question, so I was stuck in an infinite loop. I ended up asking here because this is where I lurk more. – Geeky Guy Jul 18 '13 at 17:00

2 Answers2

5

Assuming you are using Visual Studio, stylecop is one great linter tool for C#.

mjgpy3
  • 8,597
  • 5
  • 30
  • 51
2

You're looking for Code Analysis / FxCop.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • FxCop won't install in our machines, giving the most useless error message ever (asking to refer to a file that wasn't created so as to fix the issue). Two minutes googling for it showed that the solution is an arcane ritual involving uninstalling windows components, downloading obscure patches that don't come automatically with WU and messing with the registry. Not feasible for my team :( – Geeky Guy Jul 18 '13 at 17:10
  • @Renan: What version of VS do you use? Code analysis is included with most recent versions. – SLaks Jul 18 '13 at 20:04
  • I'm trying it with VS2010. – Geeky Guy Jul 18 '13 at 20:14