From 670237723b966db9826c5ad8b56ebbf4508f14df Mon Sep 17 00:00:00 2001 From: Alexander Novotny Date: Mon, 6 Jan 2025 17:26:31 -0500 Subject: [PATCH] Add linting with clang tidy --- .clang-tidy | 11 +++++++++++ CMakeLists.txt | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..5391fcc --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,11 @@ +Checks: '-*,--clang-analyzer-*,-clang-analyzer-cplusplus*,google-*,bugprone-*,cppcoreguidelines-*,readability-*,-*-magic-numbers,-bugprone-easily-swappable-parameters' +# Checks: '-*,readability-identifier-naming' +HeaderFilterRegex: '.*' # Makes certain to check header files (by default ignores them) +CheckOptions: + readability-identifier-naming.LocalVariableCase: 'lower_case' + readability-identifier-naming.MemberCase: 'lower_case' + readability-identifier-naming.MemberSuffix: '_' + readability-identifier-naming.FunctionCase: 'camelBack' + readability-identifier-naming.ClassCase: 'CamelCase' + readability-identifier-naming.EnumCase: 'UPPER_CASE' + readability-identifier-naming.ConstexprVariableCase: 'UPPER_CASE' \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 95d4600..2bf5fff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,8 @@ cmake_minimum_required(VERSION 3.12) project(gridkit) +set(CMAKE_CXX_CLANG_TIDY clang-tidy) + set(PACKAGE_NAME "GRIDKIT") set(PACKAGE_STRING "GRIDKIT 0.0.7") set(PACKAGE_TARNAME "gridkit")