(Small) Enhancement request for the Method, Properties, and Events

A significant number of us in the speaking/TDD community put underscores in
TestMethod names, and the newest version of 4.5 is calling out that pattern
as a fail. Is it possible to also have a Camel_Case_With_Underscore option
in the Method, Properties, and Events checker? I hate to have to turn it
off.

For example, a test would be named Should_Add_Two_Integers (R# wants to make
it ShouldAddTwoIntegers). The underscores make it infinitely more readable
(for example, I create chm docs from my test assemblies for the business and
qa to review)

Thoughts?


--
Philip Japikse
phil.japikse@pinnsg.com

10 comments

If this is added, can we not force every word to be capitalized? The first
should be, but not all following ones!

"Philip Japikse" <phil.japikse@pinnsg.com> wrote in message
news:gqt7jj$svn$1@is.intellij.net...
>A significant number of us in the speaking/TDD community put underscores in
>TestMethod names, and the newest version of 4.5 is calling out that pattern
>as a fail. Is it possible to also have a Camel_Case_With_Underscore option
>in the Method, Properties, and Events checker? I hate to have to turn it
>off.
>

For example, a test would be named Should_Add_Two_Integers (R# wants to
make it ShouldAddTwoIntegers). The underscores make it infinitely more
readable (for example, I create chm docs from my test assemblies for the
business and qa to review)

>

Thoughts?

>
>

--
Philip Japikse
phil.japikse@pinnsg.com



0

I'd be happy is there was a check box that "Allowed Underscore Separators"
and all of the other options were kept as radio buttons.
Thanks!

"Glen" <glittle@sunwaptasolutions.RemoveThis.com> wrote in message
news:gqtft8$5p9$1@is.intellij.net...

If this is added, can we not force every word to be capitalized? The first
should be, but not all following ones!

>

"Philip Japikse" <phil.japikse@pinnsg.com> wrote in message
news:gqt7jj$svn$1@is.intellij.net...

>>A significant number of us in the speaking/TDD community put underscores
>>in TestMethod names, and the newest version of 4.5 is calling out that
>>pattern as a fail. Is it possible to also have a
>>Camel_Case_With_Underscore option in the Method, Properties, and Events
>>checker? I hate to have to turn it off.
>>
>> For example, a test would be named Should_Add_Two_Integers (R# wants to
>> make it ShouldAddTwoIntegers). The underscores make it infinitely more
>> readable (for example, I create chm docs from my test assemblies for the
>> business and qa to review)
>>
>> Thoughts?
>>
>>
>> --
>> Philip Japikse
>> phil.japikse@pinnsg.com
>


0

Philip Japikse schrieb:

I'd be happy is there was a check box that "Allowed Underscore
Separators" and all of the other options were kept as radio buttons.


Any progress on this topic? With the release candidate, all my events
are marked as falsely named because

void button1_Click(object sender, EventArgs e)

contains an underscore.

Plus, I have classes which are named according to a document structure
in a specification (p.ex. "Node_A_1_4_3_SomeCaption".) I do not want to
rename it to NodeA143SomeCaption...

Thanks,
Alexander

0

Hello Alexander,

Unfortunately, we don't have time to include it in the v4.5. You can suppress
analysis for specific entities in options. Options / Languages / Common /
Naming Style, select rule you want, hit Edit and uncheck "Enable inspections".
We will definitly do something about this issue for future version.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


AR> Philip Japikse schrieb:
AR>
>> I'd be happy is there was a check box that "Allowed Underscore
>> Separators" and all of the other options were kept as radio buttons.
>>
AR> Any progress on this topic? With the release candidate, all my
AR> events are marked as falsely named because
AR>
AR> void button1_Click(object sender, EventArgs e)
AR>
AR> contains an underscore.
AR>
AR> Plus, I have classes which are named according to a document
AR> structure in a specification (p.ex. "Node_A_1_4_3_SomeCaption".) I
AR> do not want to rename it to NodeA143SomeCaption...
AR>
AR> Thanks,
AR> Alexander


0

Ilya Ryzhenkov schrieb:

Hello Alexander,

Unfortunately, we don't have time to include it in the v4.5. You can
suppress analysis for specific entities in options. Options / Languages
/ Common / Naming Style, select rule you want, hit Edit and uncheck
"Enable inspections". We will definitly do something about this issue
for future version.


Too bad. When will EAP for V.Next.Version start ;)

Thanks,
Alexander

0

I don't think this request made it into V5 did it?  Any chance it will be in V6?

0

Hello Philip,

ReSharper v5 should be treat underscores in method names properly. Could
you please attach a screenshot of ReSharper | Options | Languages | Common
| Naming Style | Advanced settings... and a screenshot of the method that
is incorrectly marked by ReSharper? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I don't think this request made it into V5 did it?  Any chance it will
be in V6?

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



0

Capture1.PNGAndrey,

Ok, I see the option now, but I'm not sure how to configure it.  I added a rule for unit test methods (checked 'test type' and 'test method' in affected entities).  However on closing the dialog below the rule doesn't show up in the list of naming styles.

Capture2.PNG

0

Hello Philip,

Please set the naming rule for test methods to 'UpperCamelCase' instead of
'First_upper' and then change the value of 'Event subscription on fields'
from '$event$_On$object$' to '$event$_$object$'. Let me know if this helps.
Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Image:Capture1.PNG Andrey,

Ok, I see the option now, but I'm not sure how to configure it.  I
added a rule for unit test methods (checked 'test type' and 'test
method' in affected entities).  However on closing the dialog below
the rule doesn't show up in the list of naming styles.
Image:Capture2.PNG
---
Original message URL:
http://devnet.jetbrains.net/message/5276416#5276416



0

Andrey,

I got it working. I didn't need to make the changes you specified, it was just a refresh problem.  I needed to close the file and re-open it for the new naming rule to take effect.

Phil

0

Please sign in to leave a comment.