[PATCH] D158787: llvm-project/issues/42451

2023-08-24 Thread Steven Lewis via Phabricator via cfe-commits
MasterCopy8GB created this revision.
MasterCopy8GB added a reviewer: llvm-commits.
Herald added subscribers: PiotrZSL, carlosgalvezp.
Herald added a reviewer: njames93.
Herald added a project: All.
MasterCopy8GB requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Add Leading_upper_snake_case to clang-tidy readability actions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158787

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-case-violation.cpp
  clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
@@ -49,7 +49,7 @@
 // RUN: readability-identifier-naming.StaticConstantCase: UPPER_CASE, \
 // RUN: readability-identifier-naming.StaticVariableCase: camelBack, \
 // RUN: readability-identifier-naming.StaticVariablePrefix: 's_', \
-// RUN: readability-identifier-naming.StructCase: lower_case, \
+// RUN: readability-identifier-naming.StructCase: Leading_upper_snake_case, \
 // RUN: readability-identifier-naming.TemplateParameterCase: UPPER_CASE, \
 // RUN: readability-identifier-naming.TemplateTemplateParameterCase: CamelCase, \
 // RUN: readability-identifier-naming.TemplateUsingCase: lower_case, \
@@ -513,9 +513,9 @@
 
 struct THIS___Structure {
 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'THIS___Structure'
-// CHECK-FIXES: {{^}}struct this_structure {{{$}}
+// CHECK-FIXES: {{^}}struct This_structure {{{$}}
 THIS___Structure();
-// CHECK-FIXES: {{^}}this_structure();{{$}}
+// CHECK-FIXES: {{^}}This_structure();{{$}}
 
   union __MyUnion_is_wonderful__ {};
 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for union '__MyUnion_is_wonderful__'
@@ -524,7 +524,7 @@
 
 typedef THIS___Structure struct_type;
 // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for typedef 'struct_type'
-// CHECK-FIXES: {{^}}typedef this_structure struct_type_t;{{$}}
+// CHECK-FIXES: {{^}}typedef This_structure struct_type_t;{{$}}
 
 struct_type GlobalTypedefTestFunction(struct_type a_argument1) {
 // CHECK-FIXES: {{^}}struct_type_t GlobalTypedefTestFunction(struct_type_t a_argument1) {
@@ -534,7 +534,7 @@
 
 using my_struct_type = THIS___Structure;
 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for type alias 'my_struct_type'
-// CHECK-FIXES: {{^}}using my_Struct_Type_t = this_structure;{{$}}
+// CHECK-FIXES: {{^}}using my_Struct_Type_t = This_structure;{{$}}
 
 template
 using SomeOtherTemplate = my_other_templated_class  <:: FOO_NS  ::my_class>;
@@ -596,6 +596,8 @@
 }
 
 template  struct a {
+// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: invalid case style for struct 'a'
+// CHECK-FIXES: {{^}}template  struct A {{{$}}
   typename t_t::template b<> c;
 
   char const MY_ConstMember_string[4] = "123";
@@ -609,9 +611,11 @@
 
 template
 char const a::MyConstClass_string[] = "123";
-// CHECK-FIXES: {{^}}char const a::kMyConstClassString[] = "123";{{$}}
+// CHECK-FIXES: {{^}}char const A::kMyConstClassString[] = "123";{{$}}
 
 template  class A> struct b { A c; };
+// CHECK-MESSAGES: :[[@LINE-1]]:47: warning: invalid case style for struct 'b'
+// CHECK-FIXES:template  class A> struct B { A c; };{{$}}
 
 unsigned MY_GLOBAL_array[] = {1,2,3};
 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'MY_GLOBAL_array'
@@ -645,17 +649,17 @@
 // CHECK-FIXES: {{^}}using namespace foo_ns::inline_namespace;
 
 void QualifiedTypeLocTest(THIS___Structure);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure);{{$}}
 void QualifiedTypeLocTest(THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &);{{$}}
 void QualifiedTypeLocTest(THIS___Structure &&);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &&);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &&);{{$}}
 void QualifiedTypeLocTest(const THIS___Structure);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure);{{$}}
 void QualifiedTypeLocTest(const THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure &);{{$}}
 void QualifiedTypeLocTest(volatile THIS__

[PATCH] D158787: [clang-tidy][readability] add Leading_upper_snake_case

2023-08-24 Thread Steven Lewis via Phabricator via cfe-commits
MasterCopy8GB updated this revision to Diff 553294.
MasterCopy8GB added a comment.

Update documentation


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158787/new/

https://reviews.llvm.org/D158787

Files:
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst


Index: 
clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
@@ -17,7 +17,8 @@
  - ``CamelCase``,
  - ``camel_Snake_Back``,
  - ``Camel_Snake_Case``,
- - ``aNy_CasE``.
+ - ``aNy_CasE``,
+ - ``Leading_upper_snake_case``.
 
 It also supports a fixed prefix and suffix that will be prepended or appended
 to the identifiers, regardless of the casing.
@@ -2099,7 +2100,7 @@
 
 For example using values of:
 
-   - StructCase of ``lower_case``
+   - StructCase of ``Leading_upper_snake_case``
- StructPrefix of ``pre_``
- StructSuffix of ``_post``
 
@@ -2118,9 +2119,9 @@
 
 .. code-block:: c++
 
-struct pre_foo_post {
-  pre_foo_post();
-  ~pre_foo_post();
+struct pre_Foo_post {
+  pre_Foo_post();
+  ~pre_Foo_post();
 };
 
 .. option:: TemplateParameterCase
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -113,6 +113,10 @@
 
 - Improved `--dump-config` to print check options in alphabetical order.
 
+- Improved :doc:`readability-identifier-naming
+  ` check to allow for
+  Leading_upper_snake_case naming convention.
+
 New checks
 ^^
 


Index: clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
@@ -17,7 +17,8 @@
  - ``CamelCase``,
  - ``camel_Snake_Back``,
  - ``Camel_Snake_Case``,
- - ``aNy_CasE``.
+ - ``aNy_CasE``,
+ - ``Leading_upper_snake_case``.
 
 It also supports a fixed prefix and suffix that will be prepended or appended
 to the identifiers, regardless of the casing.
@@ -2099,7 +2100,7 @@
 
 For example using values of:
 
-   - StructCase of ``lower_case``
+   - StructCase of ``Leading_upper_snake_case``
- StructPrefix of ``pre_``
- StructSuffix of ``_post``
 
@@ -2118,9 +2119,9 @@
 
 .. code-block:: c++
 
-struct pre_foo_post {
-  pre_foo_post();
-  ~pre_foo_post();
+struct pre_Foo_post {
+  pre_Foo_post();
+  ~pre_Foo_post();
 };
 
 .. option:: TemplateParameterCase
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -113,6 +113,10 @@
 
 - Improved `--dump-config` to print check options in alphabetical order.
 
+- Improved :doc:`readability-identifier-naming
+  ` check to allow for
+  Leading_upper_snake_case naming convention.
+
 New checks
 ^^
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158787: [clang-tidy][readability] add Leading_upper_snake_case issue 42451

2023-08-25 Thread Steven Lewis via Phabricator via cfe-commits
MasterCopy8GB updated this revision to Diff 553494.
MasterCopy8GB added a comment.

Update documentation for issue 42451


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158787/new/

https://reviews.llvm.org/D158787

Files:
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst


Index: 
clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
@@ -31,6 +31,10 @@
 but not where they are overridden, as it can't be fixed locally there.
 This also applies for pseudo-override patterns like CRTP.
 
+Leading_upper_snake_case is a naming convention where the first word is 
capitalized
+followed by lower case word(s) seperated by underscore(s) '_'. Examples 
include:
+Cap_snake_case, Cobra_case, Foo_bar_baz, and Master_copy_8gb.
+
 Options
 ---
 
@@ -2100,7 +2104,7 @@
 
 For example using values of:
 
-   - StructCase of ``Leading_upper_snake_case``
+   - StructCase of ``lower_case``
- StructPrefix of ``pre_``
- StructSuffix of ``_post``
 
@@ -2119,9 +2123,9 @@
 
 .. code-block:: c++
 
-struct pre_Foo_post {
-  pre_Foo_post();
-  ~pre_Foo_post();
+struct pre_foo_post {
+  pre_foo_post();
+  ~pre_foo_post();
 };
 
 .. option:: TemplateParameterCase
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -113,10 +113,6 @@
 
 - Improved `--dump-config` to print check options in alphabetical order.
 
-- Improved :doc:`readability-identifier-naming
-  ` check to allow for
-  Leading_upper_snake_case naming convention.
-
 New checks
 ^^
 
@@ -257,6 +253,10 @@
   ` check to
   identify calls to static member functions with out-of-class inline 
definitions.
 
+- Improved :doc:`readability-identifier-naming
+  ` 
Leading_upper_snake_case ->
+  Leading_upper_snake_case. allow for -> support
+
 Removed checks
 ^^
 


Index: clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
@@ -31,6 +31,10 @@
 but not where they are overridden, as it can't be fixed locally there.
 This also applies for pseudo-override patterns like CRTP.
 
+Leading_upper_snake_case is a naming convention where the first word is capitalized
+followed by lower case word(s) seperated by underscore(s) '_'. Examples include:
+Cap_snake_case, Cobra_case, Foo_bar_baz, and Master_copy_8gb.
+
 Options
 ---
 
@@ -2100,7 +2104,7 @@
 
 For example using values of:
 
-   - StructCase of ``Leading_upper_snake_case``
+   - StructCase of ``lower_case``
- StructPrefix of ``pre_``
- StructSuffix of ``_post``
 
@@ -2119,9 +2123,9 @@
 
 .. code-block:: c++
 
-struct pre_Foo_post {
-  pre_Foo_post();
-  ~pre_Foo_post();
+struct pre_foo_post {
+  pre_foo_post();
+  ~pre_foo_post();
 };
 
 .. option:: TemplateParameterCase
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -113,10 +113,6 @@
 
 - Improved `--dump-config` to print check options in alphabetical order.
 
-- Improved :doc:`readability-identifier-naming
-  ` check to allow for
-  Leading_upper_snake_case naming convention.
-
 New checks
 ^^
 
@@ -257,6 +253,10 @@
   ` check to
   identify calls to static member functions with out-of-class inline definitions.
 
+- Improved :doc:`readability-identifier-naming
+  ` Leading_upper_snake_case ->
+  Leading_upper_snake_case. allow for -> support
+
 Removed checks
 ^^
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158787: [clang-tidy][readability] add Leading_upper_snake_case issue 42451

2023-08-25 Thread Steven Lewis via Phabricator via cfe-commits
MasterCopy8GB updated this revision to Diff 553504.
MasterCopy8GB added a comment.

Update diff with complete patch


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158787/new/

https://reviews.llvm.org/D158787

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-case-violation.cpp
  clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
@@ -49,7 +49,7 @@
 // RUN: readability-identifier-naming.StaticConstantCase: UPPER_CASE, \
 // RUN: readability-identifier-naming.StaticVariableCase: camelBack, \
 // RUN: readability-identifier-naming.StaticVariablePrefix: 's_', \
-// RUN: readability-identifier-naming.StructCase: lower_case, \
+// RUN: readability-identifier-naming.StructCase: Leading_upper_snake_case, \
 // RUN: readability-identifier-naming.TemplateParameterCase: UPPER_CASE, \
 // RUN: readability-identifier-naming.TemplateTemplateParameterCase: CamelCase, \
 // RUN: readability-identifier-naming.TemplateUsingCase: lower_case, \
@@ -513,9 +513,9 @@
 
 struct THIS___Structure {
 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'THIS___Structure'
-// CHECK-FIXES: {{^}}struct this_structure {{{$}}
+// CHECK-FIXES: {{^}}struct This_structure {{{$}}
 THIS___Structure();
-// CHECK-FIXES: {{^}}this_structure();{{$}}
+// CHECK-FIXES: {{^}}This_structure();{{$}}
 
   union __MyUnion_is_wonderful__ {};
 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for union '__MyUnion_is_wonderful__'
@@ -524,7 +524,7 @@
 
 typedef THIS___Structure struct_type;
 // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for typedef 'struct_type'
-// CHECK-FIXES: {{^}}typedef this_structure struct_type_t;{{$}}
+// CHECK-FIXES: {{^}}typedef This_structure struct_type_t;{{$}}
 
 struct_type GlobalTypedefTestFunction(struct_type a_argument1) {
 // CHECK-FIXES: {{^}}struct_type_t GlobalTypedefTestFunction(struct_type_t a_argument1) {
@@ -534,7 +534,7 @@
 
 using my_struct_type = THIS___Structure;
 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for type alias 'my_struct_type'
-// CHECK-FIXES: {{^}}using my_Struct_Type_t = this_structure;{{$}}
+// CHECK-FIXES: {{^}}using my_Struct_Type_t = This_structure;{{$}}
 
 template
 using SomeOtherTemplate = my_other_templated_class  <:: FOO_NS  ::my_class>;
@@ -596,6 +596,8 @@
 }
 
 template  struct a {
+// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: invalid case style for struct 'a'
+// CHECK-FIXES: {{^}}template  struct A {{{$}}
   typename t_t::template b<> c;
 
   char const MY_ConstMember_string[4] = "123";
@@ -609,9 +611,11 @@
 
 template
 char const a::MyConstClass_string[] = "123";
-// CHECK-FIXES: {{^}}char const a::kMyConstClassString[] = "123";{{$}}
+// CHECK-FIXES: {{^}}char const A::kMyConstClassString[] = "123";{{$}}
 
 template  class A> struct b { A c; };
+// CHECK-MESSAGES: :[[@LINE-1]]:47: warning: invalid case style for struct 'b'
+// CHECK-FIXES:template  class A> struct B { A c; };{{$}}
 
 unsigned MY_GLOBAL_array[] = {1,2,3};
 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'MY_GLOBAL_array'
@@ -645,17 +649,17 @@
 // CHECK-FIXES: {{^}}using namespace foo_ns::inline_namespace;
 
 void QualifiedTypeLocTest(THIS___Structure);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure);{{$}}
 void QualifiedTypeLocTest(THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &);{{$}}
 void QualifiedTypeLocTest(THIS___Structure &&);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &&);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &&);{{$}}
 void QualifiedTypeLocTest(const THIS___Structure);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure);{{$}}
 void QualifiedTypeLocTest(const THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure &);{{$}}
 void QualifiedTypeLocTest(volatile THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(volatile this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void Qualified

[PATCH] D158787: [clang-tidy][readability] add Leading_upper_snake_case

2023-08-25 Thread Steven Lewis via Phabricator via cfe-commits
MasterCopy8GB updated this revision to Diff 553550.
MasterCopy8GB added a comment.

Fix documentation comments


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158787/new/

https://reviews.llvm.org/D158787

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-case-violation.cpp
  clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
@@ -49,7 +49,7 @@
 // RUN: readability-identifier-naming.StaticConstantCase: UPPER_CASE, \
 // RUN: readability-identifier-naming.StaticVariableCase: camelBack, \
 // RUN: readability-identifier-naming.StaticVariablePrefix: 's_', \
-// RUN: readability-identifier-naming.StructCase: lower_case, \
+// RUN: readability-identifier-naming.StructCase: Leading_upper_snake_case, \
 // RUN: readability-identifier-naming.TemplateParameterCase: UPPER_CASE, \
 // RUN: readability-identifier-naming.TemplateTemplateParameterCase: CamelCase, \
 // RUN: readability-identifier-naming.TemplateUsingCase: lower_case, \
@@ -513,9 +513,9 @@
 
 struct THIS___Structure {
 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'THIS___Structure'
-// CHECK-FIXES: {{^}}struct this_structure {{{$}}
+// CHECK-FIXES: {{^}}struct This_structure {{{$}}
 THIS___Structure();
-// CHECK-FIXES: {{^}}this_structure();{{$}}
+// CHECK-FIXES: {{^}}This_structure();{{$}}
 
   union __MyUnion_is_wonderful__ {};
 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for union '__MyUnion_is_wonderful__'
@@ -524,7 +524,7 @@
 
 typedef THIS___Structure struct_type;
 // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for typedef 'struct_type'
-// CHECK-FIXES: {{^}}typedef this_structure struct_type_t;{{$}}
+// CHECK-FIXES: {{^}}typedef This_structure struct_type_t;{{$}}
 
 struct_type GlobalTypedefTestFunction(struct_type a_argument1) {
 // CHECK-FIXES: {{^}}struct_type_t GlobalTypedefTestFunction(struct_type_t a_argument1) {
@@ -534,7 +534,7 @@
 
 using my_struct_type = THIS___Structure;
 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for type alias 'my_struct_type'
-// CHECK-FIXES: {{^}}using my_Struct_Type_t = this_structure;{{$}}
+// CHECK-FIXES: {{^}}using my_Struct_Type_t = This_structure;{{$}}
 
 template
 using SomeOtherTemplate = my_other_templated_class  <:: FOO_NS  ::my_class>;
@@ -596,6 +596,8 @@
 }
 
 template  struct a {
+// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: invalid case style for struct 'a'
+// CHECK-FIXES: {{^}}template  struct A {{{$}}
   typename t_t::template b<> c;
 
   char const MY_ConstMember_string[4] = "123";
@@ -609,9 +611,11 @@
 
 template
 char const a::MyConstClass_string[] = "123";
-// CHECK-FIXES: {{^}}char const a::kMyConstClassString[] = "123";{{$}}
+// CHECK-FIXES: {{^}}char const A::kMyConstClassString[] = "123";{{$}}
 
 template  class A> struct b { A c; };
+// CHECK-MESSAGES: :[[@LINE-1]]:47: warning: invalid case style for struct 'b'
+// CHECK-FIXES:template  class A> struct B { A c; };{{$}}
 
 unsigned MY_GLOBAL_array[] = {1,2,3};
 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'MY_GLOBAL_array'
@@ -645,17 +649,17 @@
 // CHECK-FIXES: {{^}}using namespace foo_ns::inline_namespace;
 
 void QualifiedTypeLocTest(THIS___Structure);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure);{{$}}
 void QualifiedTypeLocTest(THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &);{{$}}
 void QualifiedTypeLocTest(THIS___Structure &&);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &&);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &&);{{$}}
 void QualifiedTypeLocTest(const THIS___Structure);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure);{{$}}
 void QualifiedTypeLocTest(const THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure &);{{$}}
 void QualifiedTypeLocTest(volatile THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(volatile this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeL

[PATCH] D158787: [clang-tidy][readability] add Leading_upper_snake_case

2023-08-25 Thread Steven Lewis via Phabricator via cfe-commits
MasterCopy8GB updated this revision to Diff 553593.
MasterCopy8GB added a comment.

Combine readability-identifier-naming improvements in release notes


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158787/new/

https://reviews.llvm.org/D158787

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-case-violation.cpp
  clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp
@@ -49,7 +49,7 @@
 // RUN: readability-identifier-naming.StaticConstantCase: UPPER_CASE, \
 // RUN: readability-identifier-naming.StaticVariableCase: camelBack, \
 // RUN: readability-identifier-naming.StaticVariablePrefix: 's_', \
-// RUN: readability-identifier-naming.StructCase: lower_case, \
+// RUN: readability-identifier-naming.StructCase: Leading_upper_snake_case, \
 // RUN: readability-identifier-naming.TemplateParameterCase: UPPER_CASE, \
 // RUN: readability-identifier-naming.TemplateTemplateParameterCase: CamelCase, \
 // RUN: readability-identifier-naming.TemplateUsingCase: lower_case, \
@@ -513,9 +513,9 @@
 
 struct THIS___Structure {
 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'THIS___Structure'
-// CHECK-FIXES: {{^}}struct this_structure {{{$}}
+// CHECK-FIXES: {{^}}struct This_structure {{{$}}
 THIS___Structure();
-// CHECK-FIXES: {{^}}this_structure();{{$}}
+// CHECK-FIXES: {{^}}This_structure();{{$}}
 
   union __MyUnion_is_wonderful__ {};
 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for union '__MyUnion_is_wonderful__'
@@ -524,7 +524,7 @@
 
 typedef THIS___Structure struct_type;
 // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for typedef 'struct_type'
-// CHECK-FIXES: {{^}}typedef this_structure struct_type_t;{{$}}
+// CHECK-FIXES: {{^}}typedef This_structure struct_type_t;{{$}}
 
 struct_type GlobalTypedefTestFunction(struct_type a_argument1) {
 // CHECK-FIXES: {{^}}struct_type_t GlobalTypedefTestFunction(struct_type_t a_argument1) {
@@ -534,7 +534,7 @@
 
 using my_struct_type = THIS___Structure;
 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for type alias 'my_struct_type'
-// CHECK-FIXES: {{^}}using my_Struct_Type_t = this_structure;{{$}}
+// CHECK-FIXES: {{^}}using my_Struct_Type_t = This_structure;{{$}}
 
 template
 using SomeOtherTemplate = my_other_templated_class  <:: FOO_NS  ::my_class>;
@@ -596,6 +596,8 @@
 }
 
 template  struct a {
+// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: invalid case style for struct 'a'
+// CHECK-FIXES: {{^}}template  struct A {{{$}}
   typename t_t::template b<> c;
 
   char const MY_ConstMember_string[4] = "123";
@@ -609,9 +611,11 @@
 
 template
 char const a::MyConstClass_string[] = "123";
-// CHECK-FIXES: {{^}}char const a::kMyConstClassString[] = "123";{{$}}
+// CHECK-FIXES: {{^}}char const A::kMyConstClassString[] = "123";{{$}}
 
 template  class A> struct b { A c; };
+// CHECK-MESSAGES: :[[@LINE-1]]:47: warning: invalid case style for struct 'b'
+// CHECK-FIXES:template  class A> struct B { A c; };{{$}}
 
 unsigned MY_GLOBAL_array[] = {1,2,3};
 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'MY_GLOBAL_array'
@@ -645,17 +649,17 @@
 // CHECK-FIXES: {{^}}using namespace foo_ns::inline_namespace;
 
 void QualifiedTypeLocTest(THIS___Structure);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure);{{$}}
 void QualifiedTypeLocTest(THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &);{{$}}
 void QualifiedTypeLocTest(THIS___Structure &&);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(this_structure &&);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &&);{{$}}
 void QualifiedTypeLocTest(const THIS___Structure);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure);{{$}}
 void QualifiedTypeLocTest(const THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const this_structure &);{{$}}
+// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure &);{{$}}
 void QualifiedTypeLocTest(volatile THIS___Structure &);
-// CHECK-FIXES: {{^}}void QualifiedTypeLocTest(volatile this_structure &);{{$}}

[PATCH] D158787: [clang-tidy][readability] add Leading_upper_snake_case

2023-08-28 Thread Steven Lewis via Phabricator via cfe-commits
MasterCopy8GB added a comment.

Hello @PiotrZSL, I do not have rights to commit to the LLVM repository. Could 
you please commit these changes for me? Thank you for all of your time and 
effort!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158787/new/

https://reviews.llvm.org/D158787

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158787: [clang-tidy][readability] add Leading_upper_snake_case

2023-08-28 Thread Steven Lewis via Phabricator via cfe-commits
MasterCopy8GB added a comment.

In D158787#4621915 , @PiotrZSL wrote:

> In D158787#4621587 , @MasterCopy8GB 
> wrote:
>
>> Hello @PiotrZSL, I do not have rights to commit to the LLVM repository. 
>> Could you please commit these changes for me? Thank you for all of your time 
>> and effort!
>
> Under which user ? Name / Email ?

MasterCopy8GB / gdayman...@hotmail.com Please


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158787/new/

https://reviews.llvm.org/D158787

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits