diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 987c3d36..52254f9d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,3 +5,12 @@ repos: hooks: - id: clang-format args: [--style=file] + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 # Use the ref you want to point at + hooks: + - id: trailing-whitespace + - id: check-json + - id: check-case-conflict + - id: check-illegal-windows-names + - id: trailing-whitespace \ No newline at end of file diff --git a/cmake/3rd.cmake b/cmake/3rd.cmake index a9993d13..82625937 100644 --- a/cmake/3rd.cmake +++ b/cmake/3rd.cmake @@ -52,6 +52,11 @@ # add_library(Freetype::Freetype ALIAS freetype) # endif() +# Pre-commit hooks +if (NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) + EXECUTE_PROCESS(COMMAND pre-commit install) +endif () + # https://github.com/google/googletest.git if (NOT TARGET gtest) add_subdirectory(3rd/googletest)