From 8e7f3d1bb092cae62fa17c3be374bd89a975b619 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Thu, 14 Mar 2024 09:38:53 +0100 Subject: [PATCH] chore: enable pre-commit --- .nix/flake.nix | 8 ++++++++ .pre-commit-config.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.nix/flake.nix b/.nix/flake.nix index ac7a6c0..ee64884 100644 --- a/.nix/flake.nix +++ b/.nix/flake.nix @@ -17,7 +17,15 @@ cmake ninja sccache + + # pre-commit + pre-commit + commitizen ]; + + shellHook = '' + pre-commit install --allow-missing-config --hook-type pre-commit --hook-type commit-msg + ''; }; } ); diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3e76f32 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +repos: + - repo: https://github.com/commitizen-tools/commitizen + rev: v3.15.0 + hooks: + - id: commitizen + stages: [commit-msg] + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + name: check markdown/yaml formatting + types_or: + - markdown + - yaml + args: [--no-config] + exclude: CHANGELOG.md + + - repo: https://github.com/pocc/pre-commit-hooks + rev: v1.3.5 + hooks: + - id: clang-format + - id: clang-tidy + + - repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-format + - id: cmake-lint