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

Deal with the large number of clang-tidy warnings we get #3351

Closed
baconpaul opened this issue Dec 4, 2020 · 1 comment
Closed

Deal with the large number of clang-tidy warnings we get #3351

baconpaul opened this issue Dec 4, 2020 · 1 comment
Labels
Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme

Comments

@baconpaul
Copy link
Collaborator

Don't make em errors. But you know.
CLion in SGE shows hundreds of problems. Things like =0 or =NULL vs =nullptr are just good 1.9isms
Also make it so it is easy to run clang-tidy for non-clion users I guess!

@baconpaul baconpaul added the Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme label Dec 4, 2020
@baconpaul baconpaul added this to the 1.9.0 milestone Dec 4, 2020
@baconpaul
Copy link
Collaborator Author

baconpaul commented Dec 4, 2020

On linux this is as easy as apply this diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d6796db..472d63a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,7 @@ cmake_policy(SET CMP0091 NEW)
 set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
 set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9 CACHE STRING "Build for 10.9")
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=-*,readability-*,modernize-*)
 
 if(NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
cmake -Bclt 
cmake --build clt

and you see all the warnings - many of which we don't want

So basically curate that list and add it as a cmake option then voila

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme
Projects
None yet
Development

No branches or pull requests

2 participants