1

We just finished defining our coding standards in our group and I'd like to create some custom rules in Resharper to enforce said standards.

Among them is enforcing that all comments start with a space, a capital letter and ends with a period.

Are there any way in Resharper to create such a rule ?

Hussein Khalil
  • 1,585
  • 2
  • 25
  • 47
  • "Among them is enforcing that all comments start with a space, a capital letter and ends with a period." Or else...what? The code doesn't compile? – Kirk Woll Dec 06 '11 at 18:30
  • I simply want to bring up a warning, just like resharper does. If it could reformat the comment, it would be even better. Unless your comment was sarcastic and was a jab at our coding standards. In which case, you're amazingly "funny". – Hussein Khalil Dec 06 '11 at 18:39
  • A little off-topic, but if you're trying to enforce grammar then what about ending with a question mark, or a exclamation mark? – Ron Sijm Dec 06 '11 at 18:47
  • Ending what with an exclamation mark ? The comment ? Then yes they should be flagged too. – Hussein Khalil Dec 06 '11 at 18:49
  • @Hussein, I find your retort *extremely* rude. My question was asked with complete sincerity. (frankly I cannot fathom how you could interpret it otherwise) You will not find any help from me (or others) with a hostile attitude like that. – Kirk Woll Dec 06 '11 at 19:00
  • I'm sorry, but the question really did seem sarcastic at first glance. – Hussein Khalil Dec 06 '11 at 19:07
  • How!? What is the layer of sarcasm? You explained you want to "enforce a rule" and I wanted to know by what mechanism that enforcement would be carried out. "treat warnings as errors" does precisely what I hypotheszied so it wasn't remotely "sarcastic". – Kirk Woll Dec 06 '11 at 19:11
  • Unfortunately the internet makes it hard to really gauge someone's intentions, hence misinterpretation can often occur. In this particular case, my past experiences with developers being very reticent to apply such a rule caused me to take for granted that you were sarcastic. It's a simple case of misinterpreting your intentions. – Hussein Khalil Dec 06 '11 at 19:14

1 Answers1

4

Out of the box Resharper does not offer anything for restructuring comments. It does have custom code restructuring capabilities, but looking in that list does not show anything for comments in the placeholders.

Maybe something else like StyleCop or GhostDoc might be of use. The former plugs into Resharper.

Kit
  • 20,354
  • 4
  • 60
  • 103