Skip to content

Commit

Permalink
3rd: auto install pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: Zone.NiuZH <[email protected]>
  • Loading branch information
MRNIU committed Dec 5, 2024
1 parent a070171 commit 5a7e340
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions cmake/3rd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5a7e340

Please sign in to comment.