diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..1844f7f2f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +# Pre-commit hooks for automated formatting and linting +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks + +repos: + # C++ formatting with clang-format + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v20.1.7 + hooks: + - id: clang-format + files: \.(cpp|hpp|c|h)$ + exclude: ^(3rdparty/|build.*/|install/) + args: [--style=file] + + # CMake formatting + - repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-format + files: \.(cmake|CMakeLists\.txt)$ + exclude: ^(3rdparty/|build.*/|install/) + +# Configuration +default_stages: [pre-commit] +fail_fast: false