Новая структура проекта
This commit is contained in:
parent
e71c75a0e4
commit
e5d0988040
81
CMakeLists.txt
Normal file
81
CMakeLists.txt
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
project(clang-naming)
|
||||||
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
|
||||||
|
find_program(
|
||||||
|
CLANG_TIDY_EXE
|
||||||
|
NAMES
|
||||||
|
clang-tidy-14
|
||||||
|
clang-tidy-13
|
||||||
|
clang-tidy-12
|
||||||
|
clang-tidy-11
|
||||||
|
clang-tidy-10
|
||||||
|
clang-tidy-9
|
||||||
|
clang-tidy)
|
||||||
|
|
||||||
|
set(TESTS
|
||||||
|
AbstractClass
|
||||||
|
ClassConstant
|
||||||
|
Class
|
||||||
|
ClassMember
|
||||||
|
ClassMethod
|
||||||
|
Constant
|
||||||
|
ConstantMember
|
||||||
|
ConstantParameter
|
||||||
|
ConstantPointerParameter
|
||||||
|
ConstexprFunction
|
||||||
|
ConstexprMethod
|
||||||
|
ConstexprVariable
|
||||||
|
EnumConstant
|
||||||
|
Enum
|
||||||
|
Function
|
||||||
|
GlobalConstant
|
||||||
|
GlobalConstantPointer
|
||||||
|
GlobalFunction
|
||||||
|
GlobalPointer
|
||||||
|
GlobalVariable
|
||||||
|
IgnoreMainLikeFunctions
|
||||||
|
InlineNamespace
|
||||||
|
LocalConstant
|
||||||
|
LocalConstantPointer
|
||||||
|
LocalPointer
|
||||||
|
LocalVariable
|
||||||
|
MacroDefinition
|
||||||
|
Member
|
||||||
|
Method
|
||||||
|
Namespace
|
||||||
|
Parameter
|
||||||
|
ParameterPack
|
||||||
|
PointerParameter
|
||||||
|
PrivateMember
|
||||||
|
PrivateMethod
|
||||||
|
ProtectedMember
|
||||||
|
ProtectedMethod
|
||||||
|
PublicMember
|
||||||
|
PublicMethod
|
||||||
|
ScopedEnumConstant
|
||||||
|
StaticConstant
|
||||||
|
StaticVariable
|
||||||
|
Struct
|
||||||
|
TemplateParameter
|
||||||
|
TemplateTemplateParameter
|
||||||
|
TypeAlias
|
||||||
|
Typedef
|
||||||
|
TypeTemplateParameter
|
||||||
|
Union
|
||||||
|
ValueTemplateParameter
|
||||||
|
Variable
|
||||||
|
VirtualMethod
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_target(test ALL)
|
||||||
|
|
||||||
|
foreach(T ${TESTS})
|
||||||
|
add_custom_target(
|
||||||
|
${T}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E echo "Fomatting ${T}.cpp"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/sources/${T}.cpp" "${CMAKE_BINARY_DIR}/${T}.cpp"
|
||||||
|
COMMAND ${CLANG_TIDY_EXE} --fix -p ${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}/${T}.cpp"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E compare_files "${CMAKE_SOURCE_DIR}/expected/${T}.cpp" "${CMAKE_BINARY_DIR}/${T}.cpp"
|
||||||
|
)
|
||||||
|
add_dependencies(test ${T})
|
||||||
|
endforeach(T)
|
94
Makefile
94
Makefile
@ -7,53 +7,53 @@ UNKNOWN = \
|
|||||||
test_Variable.cpp \
|
test_Variable.cpp \
|
||||||
|
|
||||||
SOURCES= \
|
SOURCES= \
|
||||||
test_AbstractClass.cpp \
|
sources/AbstractClass.cpp \
|
||||||
test_ClassConstant.cpp \
|
sources/ClassConstant.cpp \
|
||||||
test_Class.cpp \
|
sources/Class.cpp \
|
||||||
test_ClassMember.cpp \
|
sources/ClassMember.cpp \
|
||||||
test_ClassMethod.cpp \
|
sources/ClassMethod.cpp \
|
||||||
test_ConstantMember.cpp \
|
sources/ConstantMember.cpp \
|
||||||
test_ConstantParameter.cpp \
|
sources/ConstantParameter.cpp \
|
||||||
test_ConstantPointerParameter.cpp \
|
sources/ConstantPointerParameter.cpp \
|
||||||
test_ConstexprFunction.cpp \
|
sources/ConstexprFunction.cpp \
|
||||||
test_ConstexprMethod.cpp \
|
sources/ConstexprMethod.cpp \
|
||||||
test_ConstexprVariable.cpp \
|
sources/ConstexprVariable.cpp \
|
||||||
test_EnumConstant.cpp \
|
sources/EnumConstant.cpp \
|
||||||
test_Enum.cpp \
|
sources/Enum.cpp \
|
||||||
test_Function.cpp \
|
sources/Function.cpp \
|
||||||
test_GlobalConstant.cpp \
|
sources/GlobalConstant.cpp \
|
||||||
test_GlobalConstantPointer.cpp \
|
sources/GlobalConstantPointer.cpp \
|
||||||
test_GlobalFunction.cpp \
|
sources/GlobalFunction.cpp \
|
||||||
test_GlobalPointer.cpp \
|
sources/GlobalPointer.cpp \
|
||||||
test_GlobalVariable.cpp \
|
sources/GlobalVariable.cpp \
|
||||||
test_InlineNamespace.cpp \
|
sources/InlineNamespace.cpp \
|
||||||
test_LocalConstant.cpp \
|
sources/LocalConstant.cpp \
|
||||||
test_LocalConstantPointer.cpp \
|
sources/LocalConstantPointer.cpp \
|
||||||
test_LocalPointer.cpp \
|
sources/LocalPointer.cpp \
|
||||||
test_LocalVariable.cpp \
|
sources/LocalVariable.cpp \
|
||||||
test_MacroDefinition.cpp \
|
sources/MacroDefinition.cpp \
|
||||||
test_Namespace.cpp \
|
sources/Namespace.cpp \
|
||||||
test_Parameter.cpp \
|
sources/Parameter.cpp \
|
||||||
test_ParameterPack.cpp \
|
sources/ParameterPack.cpp \
|
||||||
test_PointerParameter.cpp \
|
sources/PointerParameter.cpp \
|
||||||
test_PrivateMember.cpp \
|
sources/PrivateMember.cpp \
|
||||||
test_PrivateMethod.cpp \
|
sources/PrivateMethod.cpp \
|
||||||
test_ProtectedMember.cpp \
|
sources/ProtectedMember.cpp \
|
||||||
test_ProtectedMethod.cpp \
|
sources/ProtectedMethod.cpp \
|
||||||
test_PublicMember.cpp \
|
sources/PublicMember.cpp \
|
||||||
test_PublicMethod.cpp \
|
sources/PublicMethod.cpp \
|
||||||
test_ScopedEnumConstant.cpp \
|
sources/ScopedEnumConstant.cpp \
|
||||||
test_StaticConstant.cpp \
|
sources/StaticConstant.cpp \
|
||||||
test_StaticVariable.cpp \
|
sources/StaticVariable.cpp \
|
||||||
test_Struct.cpp \
|
sources/Struct.cpp \
|
||||||
test_TemplateParameter.cpp \
|
sources/TemplateParameter.cpp \
|
||||||
test_TemplateTemplateParameter.cpp \
|
sources/TemplateTemplateParameter.cpp \
|
||||||
test_TypeAlias.cpp \
|
sources/TypeAlias.cpp \
|
||||||
test_Typedef.cpp \
|
sources/Typedef.cpp \
|
||||||
test_TypeTemplateParameter.cpp \
|
sources/TypeTemplateParameter.cpp \
|
||||||
test_Union.cpp \
|
sources/Union.cpp \
|
||||||
test_ValueTemplateParameter.cpp \
|
sources/ValueTemplateParameter.cpp \
|
||||||
test_VirtualMethod.cpp
|
sources/VirtualMethod.cpp
|
||||||
|
|
||||||
OBJECTS=$(SOURCES:.cpp=.o)
|
OBJECTS=$(SOURCES:.cpp=.o)
|
||||||
|
|
||||||
|
6
expected/AbstractClass.cpp
Normal file
6
expected/AbstractClass.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class AbstractClass {
|
||||||
|
public:
|
||||||
|
AbstractClass();
|
||||||
|
virtual int function();
|
||||||
|
};
|
||||||
|
|
6
expected/Class.cpp
Normal file
6
expected/Class.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class TestClass {
|
||||||
|
public:
|
||||||
|
TestClass();
|
||||||
|
~TestClass();
|
||||||
|
};
|
||||||
|
|
5
expected/ClassConstant.cpp
Normal file
5
expected/ClassConstant.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithClassConstant {
|
||||||
|
public:
|
||||||
|
static int const CLASS_CONSTANT = 0;
|
||||||
|
};
|
||||||
|
|
5
expected/ClassMember.cpp
Normal file
5
expected/ClassMember.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithClassMember {
|
||||||
|
public:
|
||||||
|
static int classMember;
|
||||||
|
};
|
||||||
|
|
5
expected/ClassMethod.cpp
Normal file
5
expected/ClassMethod.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithMethod {
|
||||||
|
public:
|
||||||
|
static int getInt() { return 0; };
|
||||||
|
};
|
||||||
|
|
5
expected/ConstantMember.cpp
Normal file
5
expected/ConstantMember.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithConstantMember {
|
||||||
|
public:
|
||||||
|
char const const_member[4] = "123";
|
||||||
|
};
|
||||||
|
|
4
expected/ConstantParameter.cpp
Normal file
4
expected/ConstantParameter.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
char returnChar(const char returnValue) {
|
||||||
|
return returnValue;
|
||||||
|
};
|
||||||
|
|
4
expected/ConstantPointerParameter.cpp
Normal file
4
expected/ConstantPointerParameter.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
void* returnVoid(void* const returnValue) {
|
||||||
|
return returnValue;
|
||||||
|
};
|
||||||
|
|
3
expected/ConstexprFunction.cpp
Normal file
3
expected/ConstexprFunction.cpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
constexpr int getFive() {
|
||||||
|
return ( 5 );
|
||||||
|
}
|
5
expected/ConstexprMethod.cpp
Normal file
5
expected/ConstexprMethod.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithConstexprMethod {
|
||||||
|
private:
|
||||||
|
constexpr int getInt() { return 0; };
|
||||||
|
};
|
||||||
|
|
2
expected/ConstexprVariable.cpp
Normal file
2
expected/ConstexprVariable.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
constexpr int const_five = 5;
|
||||||
|
|
2
expected/Enum.cpp
Normal file
2
expected/Enum.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
enum TestEnum { ONE, TWO };
|
||||||
|
|
2
expected/EnumConstant.cpp
Normal file
2
expected/EnumConstant.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
enum TestEnum { ONE, TWO };
|
||||||
|
|
4
expected/Function.cpp
Normal file
4
expected/Function.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
static int staticFunction() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
2
expected/GlobalConstant.cpp
Normal file
2
expected/GlobalConstant.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
const int THE_ONE = 1;
|
||||||
|
|
3
expected/GlobalConstantPointer.cpp
Normal file
3
expected/GlobalConstantPointer.cpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
void* global_pointer;
|
||||||
|
void* const global_const_pointer = global_pointer;
|
||||||
|
|
4
expected/GlobalFunction.cpp
Normal file
4
expected/GlobalFunction.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
int globalFunction() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
2
expected/GlobalPointer.cpp
Normal file
2
expected/GlobalPointer.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
void* global_pointer;
|
||||||
|
|
1
expected/GlobalVariable.cpp
Normal file
1
expected/GlobalVariable.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
unsigned global_variable;
|
6
expected/InlineNamespace.cpp
Normal file
6
expected/InlineNamespace.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
5
expected/LocalConstant.cpp
Normal file
5
expected/LocalConstant.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
int functionWithLocalConstant() {
|
||||||
|
const int localConstant = 0;
|
||||||
|
return localConstant;
|
||||||
|
}
|
||||||
|
|
6
expected/LocalConstantPointer.cpp
Normal file
6
expected/LocalConstantPointer.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
void* functionWithLocalConstPointer() {
|
||||||
|
void* pointer = nullptr;
|
||||||
|
void* const localConstPointer = pointer;
|
||||||
|
return localConstPointer;
|
||||||
|
}
|
||||||
|
|
5
expected/LocalPointer.cpp
Normal file
5
expected/LocalPointer.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
void* function() {
|
||||||
|
void* localPointer = nullptr;
|
||||||
|
return localPointer;
|
||||||
|
}
|
||||||
|
|
5
expected/LocalVariable.cpp
Normal file
5
expected/LocalVariable.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
int function() {
|
||||||
|
int localVariable = 0;
|
||||||
|
return localVariable;
|
||||||
|
}
|
||||||
|
|
1
expected/MacroDefinition.cpp
Normal file
1
expected/MacroDefinition.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#define MACRO_DEFINITION 0
|
4
expected/Namespace.cpp
Normal file
4
expected/Namespace.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
4
expected/Parameter.cpp
Normal file
4
expected/Parameter.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
int returnInt(int returnValue) {
|
||||||
|
return returnValue;
|
||||||
|
};
|
||||||
|
|
2
expected/ParameterPack.cpp
Normal file
2
expected/ParameterPack.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
template<class ... Types> void f(Types ... parametersPack);
|
||||||
|
|
4
expected/PointerParameter.cpp
Normal file
4
expected/PointerParameter.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
void* returnPtr(void* returnValue) {
|
||||||
|
return returnValue;
|
||||||
|
};
|
||||||
|
|
5
expected/PrivateMember.cpp
Normal file
5
expected/PrivateMember.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithPrivateMember {
|
||||||
|
private:
|
||||||
|
int m_privateMember;
|
||||||
|
};
|
||||||
|
|
4
expected/PrivateMethod.cpp
Normal file
4
expected/PrivateMethod.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class ClassWithPrivateMethod {
|
||||||
|
private:
|
||||||
|
int getInt() { return 0; };
|
||||||
|
};
|
5
expected/ProtectedMember.cpp
Normal file
5
expected/ProtectedMember.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithProtectedMember {
|
||||||
|
protected:
|
||||||
|
int protectedMember;
|
||||||
|
};
|
||||||
|
|
5
expected/ProtectedMethod.cpp
Normal file
5
expected/ProtectedMethod.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithProtectedMethod {
|
||||||
|
protected:
|
||||||
|
int getInt() { return 0; };
|
||||||
|
};
|
||||||
|
|
5
expected/PublicMember.cpp
Normal file
5
expected/PublicMember.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithPublicMember {
|
||||||
|
public:
|
||||||
|
int publicMember;
|
||||||
|
};
|
||||||
|
|
5
expected/PublicMethod.cpp
Normal file
5
expected/PublicMethod.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ClassWithPublicMethod {
|
||||||
|
public:
|
||||||
|
int getInt() { return 0; };
|
||||||
|
};
|
||||||
|
|
1
expected/ScopedEnumConstant.cpp
Normal file
1
expected/ScopedEnumConstant.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
enum class TestEnum { Big, Small };
|
5
expected/StaticConstant.cpp
Normal file
5
expected/StaticConstant.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
int functionWithStaticConstant() {
|
||||||
|
static const int staticConstant = 0;
|
||||||
|
return staticConstant;
|
||||||
|
}
|
||||||
|
|
5
expected/StaticVariable.cpp
Normal file
5
expected/StaticVariable.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
int functionWithStaticVariable() {
|
||||||
|
static int staticVariable = 0;
|
||||||
|
return staticVariable;
|
||||||
|
}
|
||||||
|
|
3
expected/Struct.cpp
Normal file
3
expected/Struct.cpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
struct TestStruct {
|
||||||
|
int a;
|
||||||
|
};
|
4
expected/TemplateParameter.cpp
Normal file
4
expected/TemplateParameter.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
template<typename TType>int tFunction(TType tValue) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
1
expected/TemplateTemplateParameter.cpp
Normal file
1
expected/TemplateTemplateParameter.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
template<template<class T> class tplTplParameter> class AllmightyClass { };
|
5
expected/TypeAlias.cpp
Normal file
5
expected/TypeAlias.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
struct MyStructure {
|
||||||
|
int a;
|
||||||
|
};
|
||||||
|
using MyStructType = MyStructure;
|
||||||
|
|
4
expected/TypeTemplateParameter.cpp
Normal file
4
expected/TypeTemplateParameter.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
template<typename TType>int tFunction(TType value) {
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
2
expected/Typedef.cpp
Normal file
2
expected/Typedef.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
typedef int my_int;
|
||||||
|
|
5
expected/Union.cpp
Normal file
5
expected/Union.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
union TestUnion {
|
||||||
|
int a;
|
||||||
|
char b;
|
||||||
|
};
|
||||||
|
|
4
expected/ValueTemplateParameter.cpp
Normal file
4
expected/ValueTemplateParameter.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
template<typename TType, int argCount> int tFunction(TType tValue) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
4
expected/VirtualMethod.cpp
Normal file
4
expected/VirtualMethod.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class ClassWithVirtualMethod {
|
||||||
|
private:
|
||||||
|
virtual int getInt() { return 0; };
|
||||||
|
};
|
1
sources/Constant.cpp
Normal file
1
sources/Constant.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
// FIXME
|
2
sources/IgnoreMainLikeFunctions.cpp
Normal file
2
sources/IgnoreMainLikeFunctions.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
int main() {
|
||||||
|
}
|
1
sources/Member.cpp
Normal file
1
sources/Member.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
/// FIXME
|
1
sources/Method.cpp
Normal file
1
sources/Method.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
// FIXME
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user