This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] readability-identifier-naming - support for other case types
ClosedPublic

Authored by JamesReynolds on Jun 17 2016, 7:54 AM.

Diff Detail

Event Timeline

JamesReynolds retitled this revision from to [clang-tidy] readability-identifier-naming - support for other case types.
JamesReynolds updated this object.
JamesReynolds added a reviewer: alexfh.
JamesReynolds added a subscriber: cfe-commits.

I'm not 100% sure that my regexes are the best balance between readability and terseness - or that I've named the case types particularly well. If there are better ideas for either of those things I'm very happy to accept criticism!

alexfh edited edge metadata.Jul 4 2016, 3:18 AM

IIUC, Stroustrup style mandates Single_capital_letter_to_start_a_type_name (http://www.stroustrup.com/Programming/PPP-style.pdf). So both styles you're adding in this patch should not be named after Stroustrup. Also, do these come from real-life projects/requirements or is it just a desire to add eVERYpOSSIBLEsTYLEiNtHEwORLD? ;)

alexfh requested changes to this revision.Jul 4 2016, 3:36 AM
alexfh edited edge metadata.
This revision now requires changes to proceed.Jul 4 2016, 3:36 AM

Ah, I took this from a single example in the CPP core guidelines - that PDF is indeed a very different style. An idea we toyed with was "UpperSeparated" and "UpperSeparatedBack"? Would that work?

This comes from a concession to Window developers in a large commercial codebase with a Windows origin. I'll admit it isn't my favourite style but for class names and functions it eventually grows on you. At least I got them to let go of the SHOUTING_TYPEDEFS..!

alexfh added a comment.Jul 5 2016, 3:57 PM

Ah, I took this from a single example in the CPP core guidelines - that PDF is indeed a very different style. An idea we toyed with was "UpperSeparated" and "UpperSeparatedBack"? Would that work?

You mean Upper_Separated and upper_Separated_Back? ;) Actually, these names are not particularly clear. I've managed to find "Camel_Snake_Case" used for exactly this naming convention (in the https://github.com/t6/camel_snake_kebab library). Maybe "camel_Snake_Back" as well?

This comes from ...

I just wanted to hear that this is actually going to be used. No objections.

JamesReynolds updated this object.
JamesReynolds edited edge metadata.

You mean Upper_Separated and upper_Separated_Back? ;) Actually, these names are not particularly clear. I've managed to find "Camel_Snake_Case"
used for exactly this naming convention (in the https://github.com/t6/camel_snake_kebab library). Maybe "camel_Snake_Back" as well?

Thank you, a very good find! I've changed the patch accordingly.

alexfh accepted this revision.Jul 19 2016, 7:25 AM
alexfh edited edge metadata.

LG

This revision is now accepted and ready to land.Jul 19 2016, 7:25 AM

Thank you! Can you land this for me please?

This is me done for the time being, but once our implementation gets into the swing of things I'll try and start picking up some bugs / enhancements.

This revision was automatically updated to reflect the committed changes.