Naming Style vs Agent Smith

There are some features in Agent Smith that are great, like "Follow this rule; except when..".  In particular, the exception based on Method/Property Attributes.

I like my test names to be of the form Will_DoSomething_When_ConditionHappens().  This runs afoul of the PascalCase rule for ReSharper and the No Underscores in Names rule in Agent Smith.  The difference is I can specify in Agent Smith that the rule exception is when the Method attribute Xunit.FactAttribute is present.

The question is, how do I share these rules with my team, allowing Agent Smith to override the ReSharper naming style?  Do I simply turn off ReSharper's?

Thanks - Jon

2 comments

+1

I was about to make exactly this request.  Underscores within method names are very important to readability in certain scenarios.  Mostly tests, sometimes event handlers, but several other contexts too.  There are many English words that are interchangeably verbs or nouns (and most nouns can be forced to act like adjectives, like PrinterPort or MouseWheel), so a method name can easily be ambiguous.  Underscore conventions can help.  E.g.,  does a method called MakeProviderSearchResults() mean "make results of a provider search", or "force provider to search the results"?

Make_ProviderSearch_Results() is more clearly the former, and Make_Provider_SearchResults() the latter.

Please add at least this support ASAP; it seems like a straightforward variation your exisiting code.

Even better but harder would be to customize/extend the choice of "name styles" that can be applied to rules.  A regex would not be too hard, but maybe not performant?  Anyway, thanks for getting at least the underscore option in.

0

Could I just add that it would be great if you could change this on a
project by project basis. My test project uses underscores in the nethod
names: void Should_return_etc() while the application classes follow C#
naming guidelines.

Thanks
Jeremy


"Mark Knell" <no_reply@jetbrains.com> wrote in message
news:18382328.104851240595073031.JavaMail.clearspace@app8.labs.intellij.net...

+1

>

I was about to make exactly this request. Underscores within method names
are very important to readability in certain scenarios. Mostly tests,
sometimes event handlers, but several other contexts too. There are many
English words that are interchangeably verbs or nouns (and most nouns can
be for
ced to act like adjectives, like PrinterPort or MouseWheel), so a method
name can easily be ambiguous. Underscore conventions can help. E.g.,
does a method called MakeProviderSearchResults() mean "make results of a
provider search", or "force provider to search the results"?

>

Make_ProviderSearch_Results() is more clearly the former, and
Make_Provider_SearchResults() the latter.

>

Please add at least this support ASAP; it seems like a straightforward
variation your exisiting code.

>

Even better but harder would be to customize/extend the choice of "name
styles" that can be applied to rules. A regex would not be too hard, but
maybe not performant? Anyway, thanks for getting at least the underscore
option in.

>

---
Original message URL:
http://www.jetbrains.net/devnet/message/5236617#5236617

>

__________ Information from ESET Smart Security, version of virus
signature database 4063 (20090508) __________

>

The message was checked by ESET Smart Security.

>

http://www.eset.com

>
>


__________ Information from ESET Smart Security, version of virus signature database 4063 (20090508) __________

The message was checked by ESET Smart Security.

http://www.eset.com



0

Please sign in to leave a comment.