[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-03-18 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau added a comment.

In D144912#4203920 , @carlosgalvezp 
wrote:

> Looks good but I fail to understand what exactly the patch fixes, can you 
> point me to an example in the tests?

The patch fixes these enum tests in C language mode:

  enum REV_TYPE { RevValid };
  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for enum 
constant 'RevValid' [readability-identifier-naming]
  // CHECK-FIXES: {{^}}enum REV_TYPE { rtRevValid };
  
  enum EnumConstantCase { OneByte, TwoByte };
  // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: invalid case style for enum 
constant 'OneByte' [readability-identifier-naming]
  // CHECK-MESSAGES: :[[@LINE-2]]:34: warning: invalid case style for enum 
constant 'TwoByte' [readability-identifier-naming]
  // CHECK-FIXES: {{^}}enum EnumConstantCase { eccOneByte, eccTwoByte };

Without this patch, the suggested fix in a C file by clang-tidy is `iRevValid` 
instead of `rtRevValid`.
This patch makes the behavior on C files the same as C++ files.

In D144912#4203920 , @carlosgalvezp 
wrote:

> It would be easier to review if the NFC changes had been done in a separate 
> patch.

Ok sorry, will do that next time.
Would the new C test file would have been better in a separate patch too (thus 
keep only the main change in the checker) ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144912

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


[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-03-18 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau added a comment.

In D144912#4204088 , @carlosgalvezp 
wrote:

> Looks great, approved! Thanks for fixing :)

Thanks for the review :)

I don't have push access, so please can you (or anyone else) land it for me ?
(as `Alexis Murzeau ` (phabricator mail and handle is the 
same as github))


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144912

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


[PATCH] D144790: [clang-tidy] readability-identifier-naming.HungarianNotation: rename CharPrinter to CharPointer

2023-02-25 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau created this revision.
amurzeau added reviewers: njames93, alexfh, kazu, dougpuob, aaron.ballman, 
carlosgalvezp.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
amurzeau requested review of this revision.
Herald added subscribers: cfe-commits, aheejin.
Herald added a project: clang-tools-extra.

The CharPrinter is a typo and should have been named CharPointer as it
configures the hungarian notation prefix for char pointers (char*).

As all configuration options within
readability-identifier-naming.HungarianNotation.CString.* were not read
at all in the previous clang-tidy version (fixed in D144431 
), this option
rename won't break existing users.

A note in release notes is added to let users know these options were
renamed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144790

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  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/Inputs/identifier-naming/hungarian-notation2/.clang-tidy

Index: clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
+++ clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
@@ -120,11 +120,11 @@
 value:  custp
   - key:readability-identifier-naming.HungarianNotation.DerivedType.FunctionPointer
 value:  custfn
-  - key:readability-identifier-naming.HungarianNotation.CString.CharPrinter
+  - key:readability-identifier-naming.HungarianNotation.CString.CharPointer
 value:  custsz
   - key:readability-identifier-naming.HungarianNotation.CString.CharArray
 value:  custsz
-  - key:readability-identifier-naming.HungarianNotation.CString.WideCharPrinter
+  - key:readability-identifier-naming.HungarianNotation.CString.WideCharPointer
 value:  custwsz
   - key:readability-identifier-naming.HungarianNotation.CString.WideCharArray
 value:  custwsz
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
@@ -2584,9 +2584,9 @@
 - :option:`HungarianNotation.DerivedType.Pointer`
 - :option:`HungarianNotation.DerivedType.FunctionPointer`
 
-- :option:`HungarianNotation.CString.CharPrinter`
+- :option:`HungarianNotation.CString.CharPointer`
 - :option:`HungarianNotation.CString.CharArray`
-- :option:`HungarianNotation.CString.WideCharPrinter`
+- :option:`HungarianNotation.CString.WideCharPointer`
 - :option:`HungarianNotation.CString.WideCharArray`
 
 - :option:`HungarianNotation.PrimitiveType.*`
@@ -2642,7 +2642,7 @@
 FUNC_PTR fnFuncPtr = NULL;
 
 
-.. option:: HungarianNotation.CString.CharPrinter
+.. option:: HungarianNotation.CString.CharPointer
 
 When defined, the check will ensure variable name will add the prefix with
 the given string. The default prefix is `sz`.
@@ -2652,7 +2652,7 @@
 When defined, the check will ensure variable name will add the prefix with
 the given string. The default prefix is `sz`.
 
-.. option:: HungarianNotation.CString.WideCharPrinter
+.. option:: HungarianNotation.CString.WideCharPointer
 
 When defined, the check will ensure variable name will add the prefix with
 the given string. The default prefix is `wsz`.
@@ -2667,13 +2667,13 @@
 
 .. code-block:: c++
 
-// CharPrinter
+// CharPointer
 const char *NamePtr = "Name";
 
 // CharArray
 const char NameArray[] = "Name";
 
-// WideCharPrinter
+// WideCharPointer
 const wchar_t *WideNamePtr = L"Name";
 
 // WideCharArray
@@ -2683,13 +2683,13 @@
 
 .. code-block:: c++
 
-// CharPrinter
+// CharPointer
 const char *szNamePtr = "Name";
 
 // CharArray
 const char szNameArray[] = "Name";
 
-// WideCharPrinter
+// WideCharPointer
 const wchar_t *wszWideNamePtr = L"Name";
 
 // WideCharArray
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -173,6 +173,11 @@
   :doc:`readability-identifier-naming
   ` check.
 
+- Renamed `HungarianNotation.CString` options `CharPrinter` and
+  `WideCharPrinter` to `CharPointer` and `WideCharPointer` respectively in
+  :doc:`readability-identifier-naming
+  ` check.
+
 - Fixed a false positive in :doc:`readability-container-size-empty
   ` check when comparing
  

[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-02-27 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau created this revision.
amurzeau added reviewers: njames93, alexfh, kazu, dougpuob, aaron.ballman, 
carlosgalvezp.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
amurzeau requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

When checking a C file, enum tags are of type `int` instead of the enum
type as in C++.
So the checker was using `i` as the prefix for enum tags instead of main
letters of the enum type name (for example `rt` for `enum REV_TYPE`).

This commit fixes this divergence and makes the behavior the same between
C and C++ files.

For example, `enum REV_TYPE { rtRevValid };` won't be reported as badly
named when in a C file. Previously, it would have proposed a rename to
`iRevValid`.

This commit also add a file to test the hungarian notation checker with C
files.
The test file was made from identifier-naming-hungarian-notation.cpp
with C++-only features removed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144912

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
===
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
@@ -0,0 +1,586 @@
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy
+
+// clang-format off
+typedef signed char int8_t; // NOLINT
+typedef short   int16_t;// NOLINT
+typedef longint32_t;// NOLINT
+typedef long long   int64_t;// NOLINT
+typedef unsigned char   uint8_t;// NOLINT
+typedef unsigned short  uint16_t;   // NOLINT
+typedef unsigned long   uint32_t;   // NOLINT
+typedef unsigned long long  uint64_t;   // NOLINT
+#ifndef _WIN32
+typedef unsigned long long  size_t; // NOLINT
+#endif
+typedef longintptr_t;   // NOLINT
+typedef unsigned long   uintptr_t;  // NOLINT
+typedef long intptrdiff_t;  // NOLINT
+typedef unsigned char   BYTE;   // NOLINT
+typedef unsigned short  WORD;   // NOLINT
+typedef unsigned long   DWORD;  // NOLINT
+typedef int BOOL;   // NOLINT
+typedef int BOOLEAN;// NOLINT
+typedef float   FLOAT;  // NOLINT
+typedef int INT;// NOLINT
+typedef unsigned intUINT;   // NOLINT
+typedef unsigned long   ULONG;  // NOLINT
+typedef short   SHORT;  // NOLINT
+typedef unsigned short  USHORT; // NOLINT
+typedef charCHAR;   // NOLINT
+typedef unsigned char   UCHAR;  // NOLINT
+typedef signed char INT8;   // NOLINT
+typedef signed shortINT16;  // NOLINT
+typedef signed int  INT32;  // NOLINT
+typedef signed long longINT64;  // NOLINT
+typedef unsigned char   UINT8;  // NOLINT
+typedef unsigned short  UINT16; // NOLINT
+typedef unsigned intUINT32; // NOLINT
+typedef unsigned long long  UINT64; // NOLINT
+typedef longLONG;   // NOLINT
+typedef signed int  LONG32; // NOLINT
+typedef unsigned intULONG32;// NOLINT
+typedef uint64_tULONG64;// NOLINT
+typedef unsigned intDWORD32;// NOLINT
+typedef uint64_tDWORD64;// NOLINT
+typedef uint64_tULONGLONG;  // NOLINT
+typedef void*   PVOID;  // NOLINT
+typedef void*   HANDLE; // NOLINT
+typedef void*   FILE;   // NOLINT
+typedef _Bool   bool;   // NOLINT
+typedef __WCHAR_TYPE__  wchar_t;// NOLINT
+#define true1   // NOLINT
+#define false   0   // NOLINT
+#define NULL(0) // NOLINT
+// clang-format on
+
+// clang-format off
+//===--===//
+// Cases to CheckOptions
+//===--===//
+const int GlobalConstantCase = 0;
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global constant 'GlobalConstantCase' [readability-identifier-naming]
+// CHECK-FIXES: {{^}}const int iGlobalConstantCase = 0;
+
+const int* GlobalConstantPointerCase = NULL;
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global pointer 'GlobalConstantPointerCase' [readability-identifier-naming]
+// CHECK-FIXES: {{^}}const int* piGlobalConstantPointerCase = NULL;
+
+int* GlobalPointerCase = NULL;
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning:

[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-02-27 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau updated this revision to Diff 500905.
amurzeau added a comment.

Update the release notes too, to notify of this changes with C files.

Suggest the user to use `EnumConstantPrefix` instead of
`EnumConstantHungarianPrefix` to keep the previous behavior of using `i` for
all enum tags.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144912

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
===
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
@@ -0,0 +1,586 @@
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy
+
+// clang-format off
+typedef signed char int8_t; // NOLINT
+typedef short   int16_t;// NOLINT
+typedef longint32_t;// NOLINT
+typedef long long   int64_t;// NOLINT
+typedef unsigned char   uint8_t;// NOLINT
+typedef unsigned short  uint16_t;   // NOLINT
+typedef unsigned long   uint32_t;   // NOLINT
+typedef unsigned long long  uint64_t;   // NOLINT
+#ifndef _WIN32
+typedef unsigned long long  size_t; // NOLINT
+#endif
+typedef longintptr_t;   // NOLINT
+typedef unsigned long   uintptr_t;  // NOLINT
+typedef long intptrdiff_t;  // NOLINT
+typedef unsigned char   BYTE;   // NOLINT
+typedef unsigned short  WORD;   // NOLINT
+typedef unsigned long   DWORD;  // NOLINT
+typedef int BOOL;   // NOLINT
+typedef int BOOLEAN;// NOLINT
+typedef float   FLOAT;  // NOLINT
+typedef int INT;// NOLINT
+typedef unsigned intUINT;   // NOLINT
+typedef unsigned long   ULONG;  // NOLINT
+typedef short   SHORT;  // NOLINT
+typedef unsigned short  USHORT; // NOLINT
+typedef charCHAR;   // NOLINT
+typedef unsigned char   UCHAR;  // NOLINT
+typedef signed char INT8;   // NOLINT
+typedef signed shortINT16;  // NOLINT
+typedef signed int  INT32;  // NOLINT
+typedef signed long longINT64;  // NOLINT
+typedef unsigned char   UINT8;  // NOLINT
+typedef unsigned short  UINT16; // NOLINT
+typedef unsigned intUINT32; // NOLINT
+typedef unsigned long long  UINT64; // NOLINT
+typedef longLONG;   // NOLINT
+typedef signed int  LONG32; // NOLINT
+typedef unsigned intULONG32;// NOLINT
+typedef uint64_tULONG64;// NOLINT
+typedef unsigned intDWORD32;// NOLINT
+typedef uint64_tDWORD64;// NOLINT
+typedef uint64_tULONGLONG;  // NOLINT
+typedef void*   PVOID;  // NOLINT
+typedef void*   HANDLE; // NOLINT
+typedef void*   FILE;   // NOLINT
+typedef _Bool   bool;   // NOLINT
+typedef __WCHAR_TYPE__  wchar_t;// NOLINT
+#define true1   // NOLINT
+#define false   0   // NOLINT
+#define NULL(0) // NOLINT
+// clang-format on
+
+// clang-format off
+//===--===//
+// Cases to CheckOptions
+//===--===//
+const int GlobalConstantCase = 0;
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global constant 'GlobalConstantCase' [readability-identifier-naming]
+// CHECK-FIXES: {{^}}const int iGlobalConstantCase = 0;
+
+const int* GlobalConstantPointerCase = NULL;
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global pointer 'GlobalConstantPointerCase' [readability-identifier-naming]
+// CHECK-FIXES: {{^}}const int* piGlobalConstantPointerCase = NULL;
+
+int* GlobalPointerCase = NULL;
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global pointer 'GlobalPointerCase' [readability-identifier-naming]
+// CHECK-FIXES: {{^}}int* piGlobalPointerCase = NULL;
+
+int GlobalVariableCase = 0;
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'GlobalVariableCase' [readability-identifier-naming]
+// CHECK-FIXES: {{^}}int iGlobalVariableCase = 0;
+
+void Func1(){
+  int const LocalConstantCase = 3;
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for local constant 'LocalConstantCase' [readability-identifier-naming]
+  // CHECK-FIXES: {{^}

[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-02-28 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau updated this revision to Diff 501247.
amurzeau added a comment.

Fix clang-format error, release notes and factorize typedefs in tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144912

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-c-language.c
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-standard-types.h

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-standard-types.h
===
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-standard-types.h
@@ -0,0 +1,58 @@
+#pragma once
+
+// clang-format off
+typedef signed char int8_t; // NOLINT
+typedef short   int16_t;// NOLINT
+typedef longint32_t;// NOLINT
+typedef long long   int64_t;// NOLINT
+typedef unsigned char   uint8_t;// NOLINT
+typedef unsigned short  uint16_t;   // NOLINT
+typedef unsigned long   uint32_t;   // NOLINT
+typedef unsigned long long  uint64_t;   // NOLINT
+#ifndef _WIN32
+typedef unsigned long long  size_t; // NOLINT
+#endif
+typedef longintptr_t;   // NOLINT
+typedef unsigned long   uintptr_t;  // NOLINT
+typedef long intptrdiff_t;  // NOLINT
+typedef unsigned char   BYTE;   // NOLINT
+typedef unsigned short  WORD;   // NOLINT
+typedef unsigned long   DWORD;  // NOLINT
+typedef int BOOL;   // NOLINT
+typedef int BOOLEAN;// NOLINT
+typedef float   FLOAT;  // NOLINT
+typedef int INT;// NOLINT
+typedef unsigned intUINT;   // NOLINT
+typedef unsigned long   ULONG;  // NOLINT
+typedef short   SHORT;  // NOLINT
+typedef unsigned short  USHORT; // NOLINT
+typedef charCHAR;   // NOLINT
+typedef unsigned char   UCHAR;  // NOLINT
+typedef signed char INT8;   // NOLINT
+typedef signed shortINT16;  // NOLINT
+typedef signed int  INT32;  // NOLINT
+typedef signed long longINT64;  // NOLINT
+typedef unsigned char   UINT8;  // NOLINT
+typedef unsigned short  UINT16; // NOLINT
+typedef unsigned intUINT32; // NOLINT
+typedef unsigned long long  UINT64; // NOLINT
+typedef longLONG;   // NOLINT
+typedef signed int  LONG32; // NOLINT
+typedef unsigned intULONG32;// NOLINT
+typedef uint64_tULONG64;// NOLINT
+typedef unsigned intDWORD32;// NOLINT
+typedef uint64_tDWORD64;// NOLINT
+typedef uint64_tULONGLONG;  // NOLINT
+typedef void*   PVOID;  // NOLINT
+typedef void*   HANDLE; // NOLINT
+typedef void*   FILE;   // NOLINT
+
+#define NULL(0) // NOLINT
+
+#ifndef __cplusplus
+typedef _Bool   bool;   // NOLINT
+typedef __WCHAR_TYPE__  wchar_t;// NOLINT
+#define true1   // NOLINT
+#define false   0   // NOLINT
+#endif
+// clang-format on
Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -1,53 +1,7 @@
-// RUN: %check_clang_tidy %s readability-identifier-naming %t -- --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \
+// RUN:   --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy -- -I %S
 
-// clang-format off
-typedef signed char int8_t; // NOLINT
-typedef short   int16_t;// NOLINT
-typedef longint32_t;// NOLINT
-typedef long long   int64_t;// NOLINT
-typedef unsigned char   uint8_t;// NOLINT
-typedef unsigned short  uint16_t;   // NOLINT
-typedef unsigned long   uint32_t;   // NOLINT
-typedef unsigned long long  uint64_t;   // NOLINT
-#ifndef _WIN32
-typedef unsigned long long  size_t; // NOLINT
-#endif
-typedef longintptr_t;   // NOLINT
-typedef unsigned long   uintptr_t;  // NOLINT
-typedef lon

[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-02-28 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau marked an inline comment as done.
amurzeau added a comment.

I see the build is still marked as failed in phabricator, but succeed in 
buildkite, do I need to do something, like a rebuild ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144912

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


[PATCH] D144912: [clang-tidy] readability-identifier-naming: fix hungarian enum prefix in C

2023-03-06 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau added a comment.

Hi, thanks PiotrZSL, the build is now passed and is green.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144912

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


[PATCH] D147779: [clang-tidy] Fix hungarian notation failed to indicate the number of asterisks in check-clang-extra-clang-tidy-checkers-readability

2023-04-10 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau accepted this revision.
amurzeau added a comment.

Thanks ! LGTM, nothing to add.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147779

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


[PATCH] D144510: [clang-tidy] improve readability-identifier-naming hungarian options test

2023-04-10 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau added a comment.

In D144510#4254959 , @dougpuob wrote:

> Hi @amurzeau
>
> I missed the review before landing. I have a suggestion regarding the 
> customized prefix "cust" because it confused me when I found the Hungarian 
> notation patterns in the output message. Perhaps using "my" instead of "cust" 
> would improve readability.
>
> Take some examples:
>
> - const char *`custszNamePtr` = "Name"; --> `myszNamePtr`
> - uint8_t `custu8ValueU8` = 0; --> `myu8ValueU8`
> - DWORD `custdwMsDword` = 0; --> `mydwMsDword`

Hi,

Yes this is a good idea, m and y are less used as type prefixes.

Do you want to make the change ? I can do it if you want.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144510

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


[PATCH] D144037: [clang-tidy] allow tests to use -config-file instead of -config

2023-02-14 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau created this revision.
amurzeau added reviewers: njames93, alexfh, kazu, dougpuob.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
amurzeau requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

The previous way to test hungarian notation doesn't check CHECK-FIXES.

This will allow readability-identifier-naming tests of Hungarian
notation to keep the use of an external .clang-tidy file (not embedded
within the .cpp test file) and properly check CHECK-FIXES.

Also, it turns out the hungarian notation tests use the wrong
.clang-tidy file, so fix that too to make these tests ok.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144037

Files:
  clang-tools-extra/test/clang-tidy/check_clang_tidy.py
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp


Index: 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
===
--- 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
+++ 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
@@ -1,5 +1,4 @@
-// RUN: clang-tidy %s 
--config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- 
-config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy
 
 // clang-format off
 typedef signed char int8_t; // NOLINT
Index: 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -1,5 +1,4 @@
-// RUN: clang-tidy %s 
--config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- 
-config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
 
 // clang-format off
 typedef signed char int8_t; // NOLINT
Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py
===
--- clang-tools-extra/test/clang-tidy/check_clang_tidy.py
+++ clang-tools-extra/test/clang-tidy/check_clang_tidy.py
@@ -108,7 +108,7 @@
 # auto-detection logic can discover a ".clang-tidy" file that is not 
related to
 # the test.
 if not any(
-[arg.startswith('-config=') for arg in self.clang_tidy_extra_args]):
+[arg.startswith('-config=') or arg.startswith('-config-file=') for arg 
in self.clang_tidy_extra_args]):
   self.clang_tidy_extra_args.append('-config={}')
 
 if extension in ['.m', '.mm']:


Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
@@ -1,5 +1,4 @@
-// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- -config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy
 
 // clang-format off
 typedef signed char int8_t; // NOLINT
Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -1,5 +1,4 @@
-// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- -config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
 
 // clang-format off
 typedef signed char int8_t; // NOLINT
Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py
===
--- clang-tools-extra/test/clang-tidy/check_clang_tidy.py
+++ clang-tools-e

[PATCH] D144041: [clang-tidy] add primitive types for hungarian identifier-naming (unsigned char and void)

2023-02-14 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau created this revision.
amurzeau added reviewers: njames93, alexfh, kazu, dougpuob.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a project: All.
amurzeau requested review of this revision.
Herald added subscribers: cfe-commits, aheejin.
Herald added a project: clang-tools-extra.

Add `unsigned char` and `void` types to recognized PrimitiveTypes.
Fixes: #60670

Depends on D144037 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144041

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
@@ -567,6 +567,10 @@
 // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for global variable 'ValueUnsignedInt' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}unsigned int uiValueUnsignedInt = 0;
 
+unsigned char ValueUnsignedChar = 0;
+// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for global variable 'ValueUnsignedChar' [readability-identifier-naming]
+// CHECK-FIXES: {{^}}unsigned char ucValueUnsignedChar = 0;
+
 long int ValueLongInt = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'ValueLongInt' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}long int liValueLongInt = 0;
Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -366,15 +366,15 @@
 
 void *BufferPtr1;
 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global pointer 'BufferPtr1' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}void *pBufferPtr1;
+// CHECK-FIXES: {{^}}void *pvBufferPtr1;
 
 void **BufferPtr2;
 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global pointer 'BufferPtr2' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}void **ppBufferPtr2;
+// CHECK-FIXES: {{^}}void **ppvBufferPtr2;
 
 void **pBufferPtr3;
 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for global pointer 'pBufferPtr3' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}void **ppBufferPtr3;
+// CHECK-FIXES: {{^}}void **ppvBufferPtr3;
 
 int *pBufferPtr4;
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global pointer 'pBufferPtr4' [readability-identifier-naming]
@@ -387,7 +387,7 @@
 
 void *ValueVoidPtr = NULL;
 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global pointer 'ValueVoidPtr' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}void *pValueVoidPtr = NULL;
+// CHECK-FIXES: {{^}}void *pvValueVoidPtr = NULL;
 
 ptrdiff_t PtrDiff = NULL;
 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global variable 'PtrDiff' [readability-identifier-naming]
@@ -403,7 +403,7 @@
 
 void MyFunc2(void* Val){}
 // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: invalid case style for pointer parameter 'Val' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}void MyFunc2(void* pVal){}
+// CHECK-FIXES: {{^}}void MyFunc2(void* pvVal){}
 
 
 //===--===//
@@ -567,6 +567,10 @@
 // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for global variable 'ValueUnsignedInt' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}unsigned int uiValueUnsignedInt = 0;
 
+unsigned char ValueUnsignedChar = 0;
+// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for global variable 'ValueUnsignedChar' [readability-identifier-naming]
+// CHECK-FIXES: {{^}}unsigned char ucValueUnsignedChar = 0;
+
 long int ValueLongInt = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'ValueLongInt' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}long int liValueLongInt = 0;
Index: clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
++

[PATCH] D144037: [clang-tidy] allow tests to use --config-file instead of --config

2023-02-15 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau updated this revision to Diff 497773.
amurzeau retitled this revision from "[clang-tidy] allow tests to use 
-config-file instead of -config" to "[clang-tidy] allow tests to use 
--config-file instead of --config".
amurzeau added a comment.

Allow use of --config and --config-file (with double dashes)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144037

Files:
  clang-tools-extra/test/clang-tidy/check_clang_tidy.py
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp


Index: 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
===
--- 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
+++ 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
@@ -1,5 +1,4 @@
-// RUN: clang-tidy %s 
--config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- 
--config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy
 
 // clang-format off
 typedef signed char int8_t; // NOLINT
Index: 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ 
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -1,5 +1,4 @@
-// RUN: clang-tidy %s 
--config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- 
--config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
 
 // clang-format off
 typedef signed char int8_t; // NOLINT
Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py
===
--- clang-tools-extra/test/clang-tidy/check_clang_tidy.py
+++ clang-tools-extra/test/clang-tidy/check_clang_tidy.py
@@ -107,9 +107,10 @@
 # If the test does not specify a config style, force an empty one; 
otherwise
 # auto-detection logic can discover a ".clang-tidy" file that is not 
related to
 # the test.
-if not any(
-[arg.startswith('-config=') for arg in self.clang_tidy_extra_args]):
-  self.clang_tidy_extra_args.append('-config={}')
+if not any([
+re.match('^-?-config(-file)?=', arg)
+for arg in self.clang_tidy_extra_args]):
+  self.clang_tidy_extra_args.append('--config={}')
 
 if extension in ['.m', '.mm']:
   self.clang_extra_args = ['-fobjc-abi-version=2', '-fobjc-arc', 
'-fblocks'] + \


Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp
@@ -1,5 +1,4 @@
-// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy
 
 // clang-format off
 typedef signed char int8_t; // NOLINT
Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -1,5 +1,4 @@
-// RUN: clang-tidy %s --config-file=%S/Inputs/identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \
-// RUN:   | FileCheck -check-prefixes=CHECK-MESSAGES %s
+// RUN: %check_clang_tidy %s readability-identifier-naming %t -- --config-file=%S/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
 
 // clang-format off
 typedef signed char int8_t; // NOLINT
Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py
===
--- clang-tools-extra/test/clang-tidy/check_clang_tidy.py
+++ clang-tools-extra/test/clang-tidy/check_clang_tidy.py
@@ -107,9 +107,10 @@
   

[PATCH] D144037: [clang-tidy] allow tests to use --config-file instead of --config

2023-02-20 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau added a comment.

I do not have commit access to the repo, can someone commit this patch for me ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144037

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


[PATCH] D144041: [clang-tidy] add primitive types for hungarian identifier-naming (unsigned char and void)

2023-02-20 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau added a comment.

I do not have commit access to the repo, can someone commit this patch for me ? 
(after D144037 )


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144041

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


[PATCH] D144422: [clang-tidy] update docs for new hungarian identifier-naming types (unsigned char and void)

2023-02-20 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau created this revision.
amurzeau added reviewers: njames93, alexfh, kazu, dougpuob, aaron.ballman, 
carlosgalvezp.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
amurzeau requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Since 37e6a4f9496c8e35efc654d7619a79d6dbb72f99 
, `void` 
and
`unsigned char` were added to primitive types for hungarian notation.

This commit adds them to the documentation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144422

Files:
  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
@@ -2541,15 +2541,15 @@
 doubled  unsigned short int usiULONG   
ul
 char  c  unsigned short us ULONG32 
ul32
 bool  b  unsigned int   ui ULONG64 
ul64
-_Bool b  unsigned   u  
ULONGLONG   ull
-int   i  long long int  lliHANDLE  
h
-size_tn  long doubleld INT 
i
-short s  long long  ll INT8
i8
-signedi  long int   li INT16   
i16
-unsigned  u  long   l  INT32   
i32
-long  l  ptrdiff_t  p  INT64   
i64
-long long ll   UINT
ui
-unsigned long ul   UINT8   
u8
+_Bool b  unsigned char  uc 
ULONGLONG   ull
+int   i  unsigned   u  HANDLE  
h
+size_tn  long long int  lliINT 
i
+short s  long doubleld INT8
i8
+signedi  long long  ll INT16   
i16
+unsigned  u  long int   li INT32   
i32
+long  l  long   l  INT64   
i64
+long long ll ptrdiff_t  p  UINT
ui
+unsigned long ul void   *none* UINT8   
u8
 long double   ld   UINT16  
u16
 ptrdiff_t pUINT32  
u32
 wchar_t   wc   UINT64  
u64


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
@@ -2541,15 +2541,15 @@
 doubled  unsigned short int usiULONG   ul
 char  c  unsigned short us ULONG32 ul32
 bool  b  unsigned int   ui ULONG64 ul64
-_Bool b  unsigned   u  ULONGLONG   ull
-int   i  long long int  lliHANDLE  h
-size_tn  long doubleld INT i
-short s  long long  ll INT8i8
-signedi  long int   li INT16   i16
-unsigned  u  long   l  INT32   i32
-long  l  ptrdiff_t  p  INT64   i64
-long long ll   UINTui
-unsigned long ul   UINT8   u8
+_Bool b  unsigned char  uc ULONGLONG   ull
+int   i  unsigned   u  HANDLE  h
+size_tn  long long int  lliINT i
+short s  long doubleld INT8i8
+signedi  long long  ll INT16   i16

[PATCH] D144422: [clang-tidy] update docs for new hungarian identifier-naming types (unsigned char and void)

2023-02-20 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau added a comment.

I don't have commit access to the repo, so please commit this for me when 
accepted. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144422

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


[PATCH] D144431: [clang-tidy] Fix readability-identifer-naming Hungarian CString options

2023-02-20 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau created this revision.
amurzeau added reviewers: njames93, alexfh, kazu, dougpuob, aaron.ballman, 
carlosgalvezp.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
amurzeau requested review of this revision.
Herald added subscribers: cfe-commits, aheejin.
Herald added a project: clang-tools-extra.

When reading readability-identifier-naming.HungarianNotation.CString
options, correctly use the type string stored in CStr.second instead of
the option name (CStr.first) as the HNOption.CString map key.

This will make CString options really working and properly parsed by the
checker.

Also adjust identifier-naming-hungarian-notation-cfgfile test with
changes for all configs in .clang-tidy to ensure they are really taken
into account.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144431

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -57,159 +57,159 @@
 public:
   static int ClassMemberCase;
   // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for class member 'ClassMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  static int iClassMemberCase;
+  // CHECK-FIXES: {{^}}  static int custiClassMemberCase;
 
   char const ConstantMemberCase = 0;
   // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for constant member 'ConstantMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  char const cConstantMemberCase = 0;
+  // CHECK-FIXES: {{^}}  char const custcConstantMemberCase = 0;
 
   void MyFunc1(const int ConstantParameterCase);
   // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for constant parameter 'ConstantParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void MyFunc1(const int iConstantParameterCase);
+  // CHECK-FIXES: {{^}}  void MyFunc1(const int custiConstantParameterCase);
 
   void MyFunc2(const int* ConstantPointerParameterCase);
   // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: invalid case style for pointer parameter 'ConstantPointerParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void MyFunc2(const int* piConstantPointerParameterCase);
+  // CHECK-FIXES: {{^}}  void MyFunc2(const int* custpcustiConstantPointerParameterCase);
 
   static constexpr int ConstexprVariableCase = 123;
   // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: invalid case style for constexpr variable 'ConstexprVariableCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  static constexpr int iConstexprVariableCase = 123;
+  // CHECK-FIXES: {{^}}  static constexpr int custiConstexprVariableCase = 123;
 };
 
 const int GlobalConstantCase = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global constant 'GlobalConstantCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}const int iGlobalConstantCase = 0;
+// CHECK-FIXES: {{^}}const int custiGlobalConstantCase = 0;
 
 const int* GlobalConstantPointerCase = nullptr;
 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global pointer 'GlobalConstantPointerCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}const int* piGlobalConstantPointerCase = nullptr;
+// CHECK-FIXES: {{^}}const int* custpcustiGlobalConstantPointerCase = nullptr;
 
 int* GlobalPointerCase = nullptr;
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global pointer 'GlobalPointerCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}int* piGlobalPointerCase = nullptr;
+// CHECK-FIXES: {{^}}int* custpcustiGlobalPointerCase = nullptr;
 
 int GlobalVariableCase = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'GlobalVariableCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}int iGlobalVariableCase = 0;
+// CHECK-FIXES: {{^}}int custiGlobalVariableCase = 0;
 
 void Func1(){
   int const LocalConstantCase = 3;
   // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for local constant 'LocalConstantCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  int const iLocalConstantCase = 3;
+  // CHECK-FIXES: {{^}}  int const custiLocalConstantCase = 3;
 
   unsigned const ConstantCase = 1;
   // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for local constant 'ConstantCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  unsigned const uConstantCa

[PATCH] D144431: [clang-tidy] Fix readability-identifer-naming Hungarian CString options

2023-02-21 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau updated this revision to Diff 499235.
amurzeau edited the summary of this revision.
amurzeau added a comment.

Remove test changes, I will make a different patch for that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144431

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp


Index: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
===
--- clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -472,7 +472,7 @@
 Buffer.append(CStr.first);
 StringRef Val = Options.get(Buffer, "");
 if (!Val.empty())
-  HNOption.CString[CStr.first] = Val.str();
+  HNOption.CString[CStr.second] = Val.str();
   }
 
   Buffer = {Section, "PrimitiveType."};


Index: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
===
--- clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -472,7 +472,7 @@
 Buffer.append(CStr.first);
 StringRef Val = Options.get(Buffer, "");
 if (!Val.empty())
-  HNOption.CString[CStr.first] = Val.str();
+  HNOption.CString[CStr.second] = Val.str();
   }
 
   Buffer = {Section, "PrimitiveType."};
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D144431: [clang-tidy] Fix readability-identifer-naming Hungarian CString options

2023-02-21 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau updated this revision to Diff 499239.
amurzeau added a comment.

Add a release note for this fix.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144431

Files:
  clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/docs/ReleaseNotes.rst


Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -169,6 +169,10 @@
   ` check.
   Global options of the same name should be used instead.
 
+- Fixed reading `HungarianNotation.CString.*` options in
+  :doc:`readability-identifier-naming
+  ` check.
+
 Removed checks
 ^^
 
Index: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
===
--- clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -472,7 +472,7 @@
 Buffer.append(CStr.first);
 StringRef Val = Options.get(Buffer, "");
 if (!Val.empty())
-  HNOption.CString[CStr.first] = Val.str();
+  HNOption.CString[CStr.second] = Val.str();
   }
 
   Buffer = {Section, "PrimitiveType."};


Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -169,6 +169,10 @@
   ` check.
   Global options of the same name should be used instead.
 
+- Fixed reading `HungarianNotation.CString.*` options in
+  :doc:`readability-identifier-naming
+  ` check.
+
 Removed checks
 ^^
 
Index: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
===
--- clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -472,7 +472,7 @@
 Buffer.append(CStr.first);
 StringRef Val = Options.get(Buffer, "");
 if (!Val.empty())
-  HNOption.CString[CStr.first] = Val.str();
+  HNOption.CString[CStr.second] = Val.str();
   }
 
   Buffer = {Section, "PrimitiveType."};
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D144510: [clang-tidy] improve readability-identifier-naming hungarian options test

2023-02-21 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau created this revision.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
amurzeau requested review of this revision.
Herald added subscribers: cfe-commits, aheejin.
Herald added a project: clang-tools-extra.

Adjust identifier-naming-hungarian-notation-cfgfile test with
changes for all configs in .clang-tidy to ensure they are really taken
into account.

This is done this way:

- Set all HungarianNotation.* options to `cust` prefix + their default value.
- Set TreatStructAsClass to true as it defaults to false.
- Because of the TreatStructAsClass change, add a test to check that structs 
are really checked the same way as classes (see `struct StructCase`).

Also, `TreatStructAsClass` was wrongly named in the test's .clang-tidy file
and was fixed (it is in `General`, not in `Options`).

Depends on D144431 


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144510

Files:
  
clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -57,159 +57,159 @@
 public:
   static int ClassMemberCase;
   // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for class member 'ClassMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  static int iClassMemberCase;
+  // CHECK-FIXES: {{^}}  static int custiClassMemberCase;
 
   char const ConstantMemberCase = 0;
   // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for constant member 'ConstantMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  char const cConstantMemberCase = 0;
+  // CHECK-FIXES: {{^}}  char const custcConstantMemberCase = 0;
 
   void MyFunc1(const int ConstantParameterCase);
   // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for constant parameter 'ConstantParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void MyFunc1(const int iConstantParameterCase);
+  // CHECK-FIXES: {{^}}  void MyFunc1(const int custiConstantParameterCase);
 
   void MyFunc2(const int* ConstantPointerParameterCase);
   // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: invalid case style for pointer parameter 'ConstantPointerParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void MyFunc2(const int* piConstantPointerParameterCase);
+  // CHECK-FIXES: {{^}}  void MyFunc2(const int* custpcustiConstantPointerParameterCase);
 
   static constexpr int ConstexprVariableCase = 123;
   // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: invalid case style for constexpr variable 'ConstexprVariableCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  static constexpr int iConstexprVariableCase = 123;
+  // CHECK-FIXES: {{^}}  static constexpr int custiConstexprVariableCase = 123;
 };
 
 const int GlobalConstantCase = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global constant 'GlobalConstantCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}const int iGlobalConstantCase = 0;
+// CHECK-FIXES: {{^}}const int custiGlobalConstantCase = 0;
 
 const int* GlobalConstantPointerCase = nullptr;
 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global pointer 'GlobalConstantPointerCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}const int* piGlobalConstantPointerCase = nullptr;
+// CHECK-FIXES: {{^}}const int* custpcustiGlobalConstantPointerCase = nullptr;
 
 int* GlobalPointerCase = nullptr;
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global pointer 'GlobalPointerCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}int* piGlobalPointerCase = nullptr;
+// CHECK-FIXES: {{^}}int* custpcustiGlobalPointerCase = nullptr;
 
 int GlobalVariableCase = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'GlobalVariableCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}int iGlobalVariableCase = 0;
+// CHECK-FIXES: {{^}}int custiGlobalVariableCase = 0;
 
 void Func1(){
   int const LocalConstantCase = 3;
   // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for local constant 'LocalConstantCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  int const iLocalConstantCase = 3;
+  // CHECK-FIXES: {{^}}  int const custiLocalConstantCase = 3;
 
   unsigned const ConstantCase = 1;
   // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for local constant 'ConstantCase' [readability-identifier-naming]
-  // CHE

[PATCH] D144431: [clang-tidy] Fix readability-identifer-naming Hungarian CString options

2023-02-22 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau marked an inline comment as done.
amurzeau added inline comments.



Comment at: 
clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy:115
 value:  On
-  - key:
readability-identifier-naming.HungarianNotation.Options.TreatStructAsClass
-value:  false
+  - key:
readability-identifier-naming.HungarianNotation.General.TreatStructAsClass
+value:  true

carlosgalvezp wrote:
> Sorry, maybe I wasn't clear. Isn't this line meant to stay, since this is 
> what the patch is fixing?
The patch only fixes reading 
`readability-identifier-naming.HungarianNotation.CString.*` options.

I've updated the test completely to make options parsing issues tested.
The test was not catching the issue with `HungarianNotation.CString.*` because 
all options were set to their default value in this `.clang-tidy` file, so the 
test couldn't really check that the option was really correctly read (and it 
turns out it wasn't for `HungarianNotation.CString.*`).

This one 
(`readability-identifier-naming.HungarianNotation.General.TreatStructAsClass`) 
is correctly read, but was just misnamed in this test file with `Options` 
instead of `General`.
I found that while updating this test.

Both the code and docs currently use 
`readability-identifier-naming.HungarianNotation.General.TreatStructAsClass`.


The minimal changes in this test that reproduce the exact issue that is fixed 
here are the changes on 
`readability-identifier-naming.HungarianNotation.CString.*` options.
But I found it weird to just test them without updating all other options as 
well, that's why I've updated all options instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144431

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


[PATCH] D144431: [clang-tidy] Fix readability-identifer-naming Hungarian CString options

2023-02-23 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau added a comment.

In D144431#4146524 , @carlosgalvezp 
wrote:

> Alright, sounds good, thanks for the clarification! Then I misunderstood the 
> change in the tests and indeed it belonged together in this patch, sorry for 
> the confusion. I have approved both patches so we can land them now. Can you 
> land the patch or would you like me to do it for you? If so please provide 
> name and email (same as your Github account) for attribution.

No worries, yes please land the patches for me as `Alexis Murzeau 
` (phabricator mail and handle is the same as github).
Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144431

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


[PATCH] D144510: [clang-tidy] improve readability-identifier-naming hungarian options test

2023-02-24 Thread Alexis Murzeau via Phabricator via cfe-commits
amurzeau updated this revision to Diff 500256.
amurzeau added a comment.

Rebase on main


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144510

Files:
  
clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/identifier-naming/hungarian-notation2/.clang-tidy
  
clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp

Index: clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
===
--- clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp
@@ -57,159 +57,159 @@
 public:
   static int ClassMemberCase;
   // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for class member 'ClassMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  static int iClassMemberCase;
+  // CHECK-FIXES: {{^}}  static int custiClassMemberCase;
 
   char const ConstantMemberCase = 0;
   // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for constant member 'ConstantMemberCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  char const cConstantMemberCase = 0;
+  // CHECK-FIXES: {{^}}  char const custcConstantMemberCase = 0;
 
   void MyFunc1(const int ConstantParameterCase);
   // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for constant parameter 'ConstantParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void MyFunc1(const int iConstantParameterCase);
+  // CHECK-FIXES: {{^}}  void MyFunc1(const int custiConstantParameterCase);
 
   void MyFunc2(const int* ConstantPointerParameterCase);
   // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: invalid case style for pointer parameter 'ConstantPointerParameterCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  void MyFunc2(const int* piConstantPointerParameterCase);
+  // CHECK-FIXES: {{^}}  void MyFunc2(const int* custpcustiConstantPointerParameterCase);
 
   static constexpr int ConstexprVariableCase = 123;
   // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: invalid case style for constexpr variable 'ConstexprVariableCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  static constexpr int iConstexprVariableCase = 123;
+  // CHECK-FIXES: {{^}}  static constexpr int custiConstexprVariableCase = 123;
 };
 
 const int GlobalConstantCase = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global constant 'GlobalConstantCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}const int iGlobalConstantCase = 0;
+// CHECK-FIXES: {{^}}const int custiGlobalConstantCase = 0;
 
 const int* GlobalConstantPointerCase = nullptr;
 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global pointer 'GlobalConstantPointerCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}const int* piGlobalConstantPointerCase = nullptr;
+// CHECK-FIXES: {{^}}const int* custpcustiGlobalConstantPointerCase = nullptr;
 
 int* GlobalPointerCase = nullptr;
 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global pointer 'GlobalPointerCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}int* piGlobalPointerCase = nullptr;
+// CHECK-FIXES: {{^}}int* custpcustiGlobalPointerCase = nullptr;
 
 int GlobalVariableCase = 0;
 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'GlobalVariableCase' [readability-identifier-naming]
-// CHECK-FIXES: {{^}}int iGlobalVariableCase = 0;
+// CHECK-FIXES: {{^}}int custiGlobalVariableCase = 0;
 
 void Func1(){
   int const LocalConstantCase = 3;
   // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for local constant 'LocalConstantCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  int const iLocalConstantCase = 3;
+  // CHECK-FIXES: {{^}}  int const custiLocalConstantCase = 3;
 
   unsigned const ConstantCase = 1;
   // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for local constant 'ConstantCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  unsigned const uConstantCase = 1;
+  // CHECK-FIXES: {{^}}  unsigned const custuConstantCase = 1;
 
   int* const LocalConstantPointerCase = nullptr;
   // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for local constant pointer 'LocalConstantPointerCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  int* const piLocalConstantPointerCase = nullptr;
+  // CHECK-FIXES: {{^}}  int* const custpcustiLocalConstantPointerCase = nullptr;
 
   int *LocalPointerCase = nullptr;
   // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for local pointer 'LocalPointerCase' [readability-identifier-naming]
-  // CHECK-FIXES: {{^}}  int *piLocalPointerCase = nullptr;
+  // CHE