Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add clang-tidy checks #307

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/keyvi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libsnappy-dev libzzip-dev zlib1g-dev libboost-all-dev
sudo apt-get install -y libsnappy-dev libzzip-dev zlib1g-dev libboost-all-dev clang-tidy
- name: install macOS deps
if: runner.os == 'macOS'
run: |
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ if (CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
endif()

#### Linting
find_program(CLANGTIDY clang-tidy)
if(CLANGTIDY)
message ("-- Found clang-tidy")
set(CMAKE_CXX_CLANG_TIDY clang-tidy; --extra-arg-before=-std=c++17)
else()
message ("-- clang-tidy not found")
endif()

#### Cmake modules
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")

Expand Down
18 changes: 18 additions & 0 deletions keyvi/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-modernize-use-trailing-return-type,
-zircon-*,
-readability-else-after-return,
-readability-static-accessed-through-instance,
-readability-avoid-const-params-in-decls,
-cppcoreguidelines-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
"
HeaderFilterRegex: ''
FormatStyle: none
9 changes: 9 additions & 0 deletions keyvi/tests/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# be less strict for tests
InheritParentConfig: true
Checks: "-cppcoreguidelines-avoid-magic-numbers,
-readability-function-cognitive-complexity,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
"
Loading