Should we fix Bug-43106

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Should we fix Bug-43106

Fangrui Song via cfe-dev
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.
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

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

0001-Bug-43106-Add-Upper-snake-case-option-to-clang-tidy.patch (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Should we fix Bug-43106

Fangrui Song via cfe-dev
On Sun, Mar 29, 2020 at 16:52:18 +0200, Anders Jensen via cfe-dev wrote:
> 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".

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

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

-Ben
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Should we fix Bug-43106

Fangrui Song via cfe-dev
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?

Den fre. 3. apr. 2020 kl. 15.59 skrev Ben Boeckel <[hidden email]>:
On Sun, Mar 29, 2020 at 16:52:18 +0200, Anders Jensen via cfe-dev wrote:
> 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".

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

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

-Ben

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Should we fix Bug-43106

Fangrui Song via cfe-dev
On Sun, Apr 26, 2020 at 09:43:48 +0200, Anders Jensen wrote:
> 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 :) .

--Ben
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Should we fix Bug-43106

Fangrui Song via cfe-dev
In reply to this post by Fangrui Song via cfe-dev
On 2020-04-03 19:29, Ben Boeckel via cfe-dev wrote:

> On Sun, Mar 29, 2020 at 16:52:18 +0200, Anders Jensen via cfe-dev
> wrote:
>> 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".
>
> Maybe a bit too cheeky, but how about "Cobra_case"?
>
>     https://i.ytimg.com/vi/tkmVQwj_NUU/maxresdefault.jpg

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.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Should we fix Bug-43106

Fangrui Song via cfe-dev
What about

Stroustrup_case

?

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev