diff --git a/.clang-tidy b/.clang-tidy index 0f0d9b609d..6ac1a8cfe7 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,40 +1,4 @@ -Checks: '*, - -abseil-string-find-startswith, - -bugprone-exception-escape, - -bugprone-macro-parentheses, - -bugprone-suspicious-semicolon, - -cert-err58-cpp, - -cppcoreguidelines-avoid-c-arrays, - -cppcoreguidelines-avoid-goto, - -cppcoreguidelines-avoid-magic-numbers, - -cppcoreguidelines-macro-usage, - -cppcoreguidelines-non-private-member-variables-in-classes, - -cppcoreguidelines-pro-bounds-array-to-pointer-decay, - -cppcoreguidelines-pro-bounds-constant-array-index, - -cppcoreguidelines-pro-bounds-pointer-arithmetic, - -cppcoreguidelines-pro-type-const-cast, - -cppcoreguidelines-pro-type-reinterpret-cast, - -fuchsia-default-arguments, - -fuchsia-multiple-inheritance, - -fuchsia-overloaded-operator, - -fuchsia-statically-constructed-objects, - -fuchsia-trailing-return, - -google-build-using-namespace, - -google-explicit-constructor, - -google-readability-braces-around-statements, - -hicpp-avoid-c-arrays, - -hicpp-avoid-goto, - -hicpp-braces-around-statements, - -hicpp-explicit-conversions, - -hicpp-no-array-decay, - -llvm-header-guard, - -misc-macro-parentheses, - -misc-non-private-member-variables-in-classes, - -misc-suspicious-semicolon, - -misc-unused-parameters, - -modernize-avoid-c-arrays, - -modernize-use-nodiscard, - -readability-braces-around-statements, - -readability-container-size-empty, - -readability-implicit-bool-conversion, - -readability-magic-numbers' +Checks: '-*, + bugprone-*, + clang-analyzer-*, + performance-*' diff --git a/CHANGES b/CHANGES index b72fa3c5af..b4be1072f5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,12 @@ +3.1.0-dev.40 | 2019-08-13 23:44:45 +0000 + + * Change over to whitelisting clang-tidy options instead of + blacklisting. (Tim Wojtulewicz, Corelight) + + * Use FindClangTidy from the cmake submodule. (Tim Wojtulewicz, + Corelight) + 3.1.0-dev.36 | 2019-08-13 22:42:54 +0000 * Replace use of deprecated pcap_lookupdev(). (Jon Siwek, Corelight) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6c18ad693..e3b09766c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ if ( NOT CMAKE_INSTALL_LIBDIR ) endif () include(cmake/CommonCMakeConfig.cmake) +include(cmake/FindClangTidy.cmake) ######################################################################## ## Project/Build Configuration diff --git a/VERSION b/VERSION index 0eb907283f..2469a155eb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.0-dev.36 +3.1.0-dev.40 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a48407361..bc362c6d62 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -444,17 +444,12 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/sqlite3.h DESTINATION include/zeek/3rdparty ) -find_program(CLANG_TIDY NAMES clang-tidy) -if (CLANG_TIDY) - set(TIDY_SRCS "") - foreach(f ${MAIN_SRCS}) - list(APPEND TIDY_SRCS "src/${f}") - endforeach(f) - # TODO: this currently doesn't include many of the subdirectories/plugins - # that build static libraries for inclusion into the final zeek binary - # (analyzers, broker, etc.) or generated code (BIFs, BinPAC, etc.). - add_custom_target(clang-tidy - COMMAND ${CLANG_TIDY} -p ${CMAKE_BINARY_DIR} ${TIDY_SRCS} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - ) -endif() +######################################################################## +## Clang-tidy target now that we have all of the sources + +add_clang_tidy_files(${MAIN_SRCS}) + +# At this point we have included all of the cc files in src, all of the BinPAC +# (*.pac.cc) files, and most of the generated code for BIFs (not including +# *.bif.register.cc) +create_clang_tidy_target()