diff --git a/scripts/clang-tidy-wrapper.sh b/scripts/clang-tidy-wrapper.sh index e61209ebdf..425a3d0a34 100755 --- a/scripts/clang-tidy-wrapper.sh +++ b/scripts/clang-tidy-wrapper.sh @@ -14,7 +14,7 @@ fi # Filter out anything that we aren't trying to compile. Older clang-tidy # versions (<=6) skipped them automatically. -if grep "${FILE}" "${CMAKE_BINARY_DIR}/compile_commands.json"; then +if grep -q "${FILE}" "${CMAKE_BINARY_DIR}/compile_commands.json"; then ${CLANG_TIDY} -quiet -header-filter="\(${CMAKE_SOURCE_DIR}|\\.\\.\)/src/.*" --extra-arg-before=-Wno-unknown-warning-option -format-style=file -p "${CMAKE_BINARY_DIR}" "${FILE}" else echo "Skipping ${FILE}"