diff --git a/.gitattributes b/.gitattributes index 8151ec8b95..0e7ab060a3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,7 @@ .clang-tidy export-ignore .codespellrc export-ignore .editorconfig export-ignore +.pre-commit-config.yaml export-ignore .typos.toml export-ignore # Custom attribute to mark sources as using our C code style. diff --git a/CMakeLists.txt b/CMakeLists.txt index ca0d5ab87d..2e1dfe1eb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,8 +325,8 @@ if(CMake_RUN_CLANG_TIDY) unset(clang_tidy_module_sha1) endif() + configure_file(.clang-tidy .clang-tidy COPYONLY) endif() -configure_file(.clang-tidy .clang-tidy COPYONLY) option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF) diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 5e6ef0a361..e377733c5f 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -17,5 +17,7 @@ if(CMake_BUILD_WIX_CUSTOM_ACTION) add_subdirectory(Release/WiX) endif() -# Make sure generated files use the same clang-tidy checks (none). -configure_file(.clang-tidy .clang-tidy COPYONLY) +if(CMake_RUN_CLANG_TIDY) + # Make sure generated files use the same clang-tidy checks (none). + configure_file(.clang-tidy .clang-tidy COPYONLY) +endif()