diff --git a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp --- a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp @@ -491,6 +491,8 @@ std::string IdentifierNamingCheck::HungarianNotation::getPrefix( const Decl *D, const IdentifierNamingCheck::HungarianNotationOption &HNOption) const { + if (!D) + return {}; const auto *ND = dyn_cast(D); if (!ND) return {}; diff --git a/clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/hungarian-notation1/.clang-tidy b/clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/hungarian-notation1/.clang-tidy new file mode 100755 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/hungarian-notation1/.clang-tidy @@ -0,0 +1,58 @@ +Checks: readability-identifier-naming +CheckOptions: + - { key: readability-identifier-naming.AbstractClassCase , value: CamelCase } + - { key: readability-identifier-naming.ClassCase , value: CamelCase } + - { key: readability-identifier-naming.ClassConstantCase , value: CamelCase } + - { key: readability-identifier-naming.ClassMemberCase , value: CamelCase } + - { key: readability-identifier-naming.ConstantCase , value: CamelCase } + - { key: readability-identifier-naming.ConstantMemberCase , value: CamelCase } + - { key: readability-identifier-naming.ConstantParameterCase , value: CamelCase } + - { key: readability-identifier-naming.ConstantPointerParameterCase , value: CamelCase } + - { key: readability-identifier-naming.ConstexprVariableCase , value: CamelCase } + - { key: readability-identifier-naming.EnumConstantCase , value: CamelCase } + - { key: readability-identifier-naming.GlobalConstantCase , value: CamelCase } + - { key: readability-identifier-naming.GlobalConstantPointerCase , value: CamelCase } + - { key: readability-identifier-naming.GlobalPointerCase , value: CamelCase } + - { key: readability-identifier-naming.GlobalVariableCase , value: CamelCase } + - { key: readability-identifier-naming.LocalConstantCase , value: CamelCase } + - { key: readability-identifier-naming.LocalConstantPointerCase , value: CamelCase } + - { key: readability-identifier-naming.LocalPointerCase , value: CamelCase } + - { key: readability-identifier-naming.LocalVariableCase , value: CamelCase } + - { key: readability-identifier-naming.MemberCase , value: CamelCase } + - { key: readability-identifier-naming.ParameterCase , value: CamelCase } + - { key: readability-identifier-naming.PointerParameterCase , value: CamelCase } + - { key: readability-identifier-naming.PrivateMemberCase , value: CamelCase } + - { key: readability-identifier-naming.ProtectedMemberCase , value: CamelCase } + - { key: readability-identifier-naming.PublicMemberCase , value: CamelCase } + - { key: readability-identifier-naming.ScopedEnumConstantCase , value: CamelCase } + - { key: readability-identifier-naming.StaticConstantCase , value: CamelCase } + - { key: readability-identifier-naming.StaticVariableCase , value: CamelCase } + - { key: readability-identifier-naming.VariableCase , value: CamelCase } + - { key: readability-identifier-naming.AbstractClassHungarianPrefix , value: On } + - { key: readability-identifier-naming.ClassHungarianPrefix , value: On } + - { key: readability-identifier-naming.ClassConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.ClassMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstantMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstantParameterHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstantPointerParameterHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstexprVariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.EnumConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.GlobalConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.GlobalConstantPointerHungarianPrefix , value: On } + - { key: readability-identifier-naming.GlobalPointerHungarianPrefix , value: On } + - { key: readability-identifier-naming.GlobalVariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.LocalConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.LocalConstantPointerHungarianPrefix , value: On } + - { key: readability-identifier-naming.LocalPointerHungarianPrefix , value: On } + - { key: readability-identifier-naming.LocalVariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.MemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ParameterHungarianPrefix , value: On } + - { key: readability-identifier-naming.PointerParameterHungarianPrefix , value: On } + - { key: readability-identifier-naming.PrivateMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ProtectedMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.PublicMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ScopedEnumConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.StaticConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.StaticVariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.VariableHungarianPrefix , value: On } \ No newline at end of file diff --git a/clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/hungarian-notation2/.clang-tidy b/clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/hungarian-notation2/.clang-tidy new file mode 100755 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/checkers/Inputs/readability-identifier-naming/hungarian-notation2/.clang-tidy @@ -0,0 +1,137 @@ +Checks: readability-identifier-naming +CheckOptions: + - { key: readability-identifier-naming.AbstractClassCase , value: CamelCase } + - { key: readability-identifier-naming.ClassCase , value: CamelCase } + - { key: readability-identifier-naming.ClassConstantCase , value: CamelCase } + - { key: readability-identifier-naming.ClassMemberCase , value: CamelCase } + - { key: readability-identifier-naming.ConstantCase , value: CamelCase } + - { key: readability-identifier-naming.ConstantMemberCase , value: CamelCase } + - { key: readability-identifier-naming.ConstantParameterCase , value: CamelCase } + - { key: readability-identifier-naming.ConstantPointerParameterCase , value: CamelCase } + - { key: readability-identifier-naming.ConstexprVariableCase , value: CamelCase } + - { key: readability-identifier-naming.EnumConstantCase , value: CamelCase } + - { key: readability-identifier-naming.GlobalConstantCase , value: CamelCase } + - { key: readability-identifier-naming.GlobalConstantPointerCase , value: CamelCase } + - { key: readability-identifier-naming.GlobalPointerCase , value: CamelCase } + - { key: readability-identifier-naming.GlobalVariableCase , value: CamelCase } + - { key: readability-identifier-naming.LocalConstantCase , value: CamelCase } + - { key: readability-identifier-naming.LocalConstantPointerCase , value: CamelCase } + - { key: readability-identifier-naming.LocalPointerCase , value: CamelCase } + - { key: readability-identifier-naming.LocalVariableCase , value: CamelCase } + - { key: readability-identifier-naming.MemberCase , value: CamelCase } + - { key: readability-identifier-naming.ParameterCase , value: CamelCase } + - { key: readability-identifier-naming.PointerParameterCase , value: CamelCase } + - { key: readability-identifier-naming.PrivateMemberCase , value: CamelCase } + - { key: readability-identifier-naming.ProtectedMemberCase , value: CamelCase } + - { key: readability-identifier-naming.PublicMemberCase , value: CamelCase } + - { key: readability-identifier-naming.ScopedEnumConstantCase , value: CamelCase } + - { key: readability-identifier-naming.StaticConstantCase , value: CamelCase } + - { key: readability-identifier-naming.StaticVariableCase , value: CamelCase } + - { key: readability-identifier-naming.VariableCase , value: CamelCase } + - { key: readability-identifier-naming.AbstractClassHungarianPrefix , value: On } + - { key: readability-identifier-naming.ClassHungarianPrefix , value: On } + - { key: readability-identifier-naming.ClassConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.ClassMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstantMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstantParameterHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstantPointerParameterHungarianPrefix , value: On } + - { key: readability-identifier-naming.ConstexprVariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.EnumConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.GlobalConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.GlobalConstantPointerHungarianPrefix , value: On } + - { key: readability-identifier-naming.GlobalPointerHungarianPrefix , value: On } + - { key: readability-identifier-naming.GlobalVariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.LocalConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.LocalConstantPointerHungarianPrefix , value: On } + - { key: readability-identifier-naming.LocalPointerHungarianPrefix , value: On } + - { key: readability-identifier-naming.LocalVariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.MemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ParameterHungarianPrefix , value: On } + - { key: readability-identifier-naming.PointerParameterHungarianPrefix , value: On } + - { key: readability-identifier-naming.PrivateMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ProtectedMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.PublicMemberHungarianPrefix , value: On } + - { key: readability-identifier-naming.ScopedEnumConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.StaticConstantHungarianPrefix , value: On } + - { key: readability-identifier-naming.StaticVariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.VariableHungarianPrefix , value: On } + - { key: readability-identifier-naming.HungarianNotation.Options.TreatStructAsClass , value: false } + - { key: readability-identifier-naming.HungarianNotation.DerivedType.Array , value: ary } + - { key: readability-identifier-naming.HungarianNotation.DerivedType.Pointer , value: p } + - { key: readability-identifier-naming.HungarianNotation.DerivedType.FunctionPointer , value: fn } + - { key: readability-identifier-naming.HungarianNotation.CString.CharPrinter , value: sz } + - { key: readability-identifier-naming.HungarianNotation.CString.CharArray , value: sz } + - { key: readability-identifier-naming.HungarianNotation.CString.WideCharPrinter , value: wsz } + - { key: readability-identifier-naming.HungarianNotation.CString.WideCharArray , value: wsz } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int8_t , value: i8 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int16_t , value: i16 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int32_t , value: i32 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int64_t , value: i64 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.uint8_t , value: u8 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.uint16_t , value: u16 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.uint32_t , value: u32 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.uint64_t , value: u64 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.char8_t , value: c8 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.char16_t , value: c16 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.char32_t , value: c32 } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.float , value: f } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.double , value: d } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.char , value: c } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.bool , value: b } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType._Bool , value: b } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int , value: i } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.size_t , value: n } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.wchar_t , value: wc } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.short-int , value: si } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.short , value: s } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-int , value: si } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-short , value: ss } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-short-int , value: ssi } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-long-long-int , value: slli } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-long-long , value: sll } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-long-int , value: sli } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-long , value: sl } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed , value: s } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-long-long-int , value: ulli } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-long-long , value: ull } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-long-int , value: uli } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-long , value: ul } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-short-int , value: usi } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-short , value: us } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-int , value: ui } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned , value: u } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long-long-int , value: lli } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long-double , value: ld } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long-long , value: ll } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long-int , value: li } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long , value: l } + - { key: readability-identifier-naming.HungarianNotation.PrimitiveType.ptrdiff_t , value: p } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.BOOL , value: b } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.BOOLEAN , value: b } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.BYTE , value: by } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.CHAR , value: c } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UCHAR , value: uc } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.SHORT , value: s } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.USHORT , value: us } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.WORD , value: w } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.DWORD , value: dw } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.DWORD32 , value: dw32 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.DWORD64 , value: dw64 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.LONG , value: l } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.ULONG , value: ul } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.ULONG32 , value: ul32 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.ULONG64 , value: ul64 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.ULONGLONG , value: ull } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.HANDLE , value: h } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT , value: i } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT8 , value: i8 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT16 , value: i16 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT32 , value: i32 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT64 , value: i64 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT , value: ui } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT8 , value: u8 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT16 , value: u16 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT32 , value: u32 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT64 , value: u64 } + - { key: readability-identifier-naming.HungarianNotation.UserDefinedType.PVOID , value: p } diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-hungarian-notation-cfgfile.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-hungarian-notation-cfgfile.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-hungarian-notation-cfgfile.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-hungarian-notation-cfgfile.cpp @@ -1,141 +1,5 @@ -// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \ -// RUN: -config='{ CheckOptions: [ \ -// RUN: { key: readability-identifier-naming.AbstractClassCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ClassCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ClassConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ClassMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstantMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstantParameterCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstantPointerParameterCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstexprVariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.EnumConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.GlobalConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.GlobalConstantPointerCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.GlobalPointerCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.GlobalVariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.LocalConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.LocalConstantPointerCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.LocalPointerCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.LocalVariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.MemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ParameterCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.PointerParameterCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.PrivateMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ProtectedMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.PublicMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ScopedEnumConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.StaticConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.StaticVariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.VariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.AbstractClassHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ClassHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ClassConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ClassMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstantMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstantParameterHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstantPointerParameterHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstexprVariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.EnumConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.GlobalConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.GlobalConstantPointerHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.GlobalPointerHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.GlobalVariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.LocalConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.LocalConstantPointerHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.LocalPointerHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.LocalVariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.MemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ParameterHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.PointerParameterHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.PrivateMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ProtectedMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.PublicMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ScopedEnumConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.StaticConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.StaticVariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.VariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.Options.TreatStructAsClass , value: false }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.DerivedType.Array , value: ary }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.DerivedType.Pointer , value: p }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.DerivedType.FunctionPointer , value: fn }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.CString.CharPrinter , value: sz }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.CString.CharArray , value: sz }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.CString.WideCharPrinter , value: wsz }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.CString.WideCharArray , value: wsz }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int8_t , value: i8 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int16_t , value: i16 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int32_t , value: i32 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int64_t , value: i64 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.uint8_t , value: u8 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.uint16_t , value: u16 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.uint32_t , value: u32 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.uint64_t , value: u64 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.char8_t , value: c8 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.char16_t , value: c16 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.char32_t , value: c32 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.float , value: f }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.double , value: d }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.char , value: c }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.bool , value: b }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType._Bool , value: b }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.int , value: i }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.size_t , value: n }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.wchar_t , value: wc }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.short-int , value: si }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.short , value: s }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-int , value: si }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-short , value: ss }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-short-int , value: ssi }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-long-long-int , value: slli }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-long-long , value: sll }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-long-int , value: sli }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed-long , value: sl }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.signed , value: s }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-long-long-int , value: ulli }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-long-long , value: ull }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-long-int , value: uli }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-long , value: ul }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-short-int , value: usi }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-short , value: us }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned-int , value: ui }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.unsigned , value: u }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long-long-int , value: lli }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long-double , value: ld }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long-long , value: ll }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long-int , value: li }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.long , value: l }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.PrimitiveType.ptrdiff_t , value: p }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.BOOL , value: b }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.BOOLEAN , value: b }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.BYTE , value: by }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.CHAR , value: c }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UCHAR , value: uc }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.SHORT , value: s }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.USHORT , value: us }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.WORD , value: w }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.DWORD , value: dw }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.DWORD32 , value: dw32 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.DWORD64 , value: dw64 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.LONG , value: l }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.ULONG , value: ul }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.ULONG32 , value: ul32 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.ULONG64 , value: ul64 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.ULONGLONG , value: ull }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.HANDLE , value: h }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT , value: i }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT8 , value: i8 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT16 , value: i16 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT32 , value: i32 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.INT64 , value: i64 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT , value: ui }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT8 , value: u8 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT16 , value: u16 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT32 , value: u32 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.UINT64 , value: u64 }, \ -// RUN: { key: readability-identifier-naming.HungarianNotation.UserDefinedType.PVOID , value: p }, \ -// RUN: ]}' +// RUN: clang-tidy %s --config-file=%S/Inputs/readability-identifier-naming/hungarian-notation1/.clang-tidy 2>&1 \ +// RUN: | FileCheck -check-prefixes=CHECK-MESSAGES %s // clang-format off typedef signed char int8_t; // NOLINT diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-hungarian-notation.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-hungarian-notation.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-hungarian-notation.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-hungarian-notation.cpp @@ -1,62 +1,5 @@ -// RUN: %check_clang_tidy %s readability-identifier-naming %t -- \ -// RUN: -config='{ CheckOptions: [ \ -// RUN: { key: readability-identifier-naming.AbstractClassCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ClassCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ClassConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ClassMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstantMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstantParameterCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstantPointerParameterCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ConstexprVariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.EnumConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.GlobalConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.GlobalConstantPointerCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.GlobalPointerCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.GlobalVariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.LocalConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.LocalConstantPointerCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.LocalPointerCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.LocalVariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.MemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ParameterCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.PointerParameterCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.PrivateMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ProtectedMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.PublicMemberCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.ScopedEnumConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.StaticConstantCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.StaticVariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.VariableCase , value: CamelCase }, \ -// RUN: { key: readability-identifier-naming.AbstractClassHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ClassHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ClassConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ClassMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstantMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstantParameterHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstantPointerParameterHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ConstexprVariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.EnumConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.GlobalConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.GlobalConstantPointerHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.GlobalPointerHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.GlobalVariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.LocalConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.LocalConstantPointerHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.LocalPointerHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.LocalVariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.MemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ParameterHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.PointerParameterHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.PrivateMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ProtectedMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.PublicMemberHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.ScopedEnumConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.StaticConstantHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.StaticVariableHungarianPrefix , value: On }, \ -// RUN: { key: readability-identifier-naming.VariableHungarianPrefix , value: On }, \ -// RUN: ]}' +// RUN: clang-tidy %s --config-file=%S/Inputs/readability-identifier-naming/hungarian-notation2/.clang-tidy 2>&1 \ +// RUN: | FileCheck -check-prefixes=CHECK-MESSAGES %s // clang-format off typedef signed char int8_t; // NOLINT