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

Configure clang tidy to run with all targets #55

Open
Sqeaky opened this issue Mar 2, 2018 · 1 comment
Open

Configure clang tidy to run with all targets #55

Sqeaky opened this issue Mar 2, 2018 · 1 comment

Comments

@Sqeaky
Copy link
Member

Sqeaky commented Mar 2, 2018

Using something like this:

set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-style=file;-checks=*")

We can have clang tidy run with every target this could catch a few extra issues.

@Sqeaky Sqeaky added this to the 1.0 milestone Mar 2, 2018
@Sqeaky
Copy link
Member Author

Sqeaky commented Mar 5, 2018

Here is some code I was playing around with that should allow this, but the unit tests slowed to a crawl and will require more investigation:

if("${CMAKE_VERSION}" VERSION_GREATER "3.7.0")
    find_program(MEZZ_ClangTidy clang-tidy DOC "The clang-tidy executable the Jagati could use.")
    if(EXISTS "${MEZZ_ClangTidy}")
        message(STATUS "CMake is supports Clang Tidy and it was found.")
        set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-style=file;-checks=*") # this breaks the tests
    else(EXISTS "${MEZZ_ClangTidy}")
        message(STATUS "CMake is supports Clang Tidy but it is not installed.")
    endif(EXISTS "${MEZZ_ClangTidy}")
else("${CMAKE_VERSION}" VERSION_GREATER "3.7.0")
    message(STATUS "CMake is too old to support automatic use of Clang Tidy.")
endif("${CMAKE_VERSION}" VERSION_GREATER "3.7.0")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant