Should we fix Bug-43106

Hi

I am a happy user of various LLVM tools, but this is my first attempt to contribute to the project.

Does anyone know about the progress on BUG-43106.
https://bugs.llvm.org/show_bug.cgi?id=43106

In summery this ask for a clang-tidy check to enforce leading capital letter with snake case for user defined types and concepts.

I have attached a possible extension to the readability-identifier-naming checker in clang-tidy.
I have checked the patch in windows building with MSVC by running check_clang_tidy.py on the readability-identifier-naming.cpp file.

This results in the expected change on the union type definition:

  • union MyUnion_is_wonderful {};
  • union UMy_union_is_wonderful {};


I do not have strong opinions about what to call the option. I followed what was asked for in the ticket, but perhaps we should discuss what to call the option some more. I follow the consistency argument made in the description of BUG-43106:
"
Let’s call it “Camel_lower_case” for the purposes of this description. This is to match the existing “Camel_Snake_Case” and “lower_case”.
"
But there are other options like “Upper_snake_case”, so I encourage a discussion on this.

Could you provide some guidance on how to progress towards getting this checked in to the LLVM project?

Thank you for your effort and time.

Best regards,
Anders Jensen

0001-Bug-43106-Add-Upper-snake-case-option-to-clang-tidy.patch (4.26 KB)

Maybe a bit too cheeky, but how about "Cobra_case"?

    https://i.ytimg.com/vi/tkmVQwj_NUU/maxresdefault.jpg

-Ben

That is an interesting idea. I am fine with this if it is what you prefer. What do you think about getting it in to the main branch?

I'm not a developer, so my opinion isn't of much weight for that. Just
had an idea for the name :slight_smile: .

--Ben

FWIW, I think it's a great name:
1. It avoids adding another token to the name.
2. The projected vision actually matches the shape of the identifier.
3. It also brings out the sub-class relationship between snake_case and Cobra_case.

Sameer.

What about

Stroustrup_case

?