From 64b9b2faee533e1a011f8c53df1806fb64dab3c7 Mon Sep 17 00:00:00 2001 From: Antoine Lambert Date: Tue, 3 Sep 2024 19:43:46 +0200 Subject: [PATCH] Add pre-commit configuration --- .pre-commit-config.yaml | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..3e2970e383 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,68 @@ +repos: + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: "v18.1.8" + hooks: + - id: clang-format + files: '\.(cpp|c|cxx|h)$' + types: [file] + + - repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-format + files: '(CMakeLists\.txt|\.cmake)$' + types: [file] + additional_dependencies: [pyyaml] + + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + name: Check source code spelling + stages: [commit] + args: + - -L lod + - -L SOM + - -L som + - -L thirdparty + - -L assertIn + - -L inout + - -L nin + - -L HSI + - -L siz + - -L readD + - -L writeD + - -L nd + - -L inH + - -L Bu + - -L eNew + - -L tesselator + - -L Tesselation + - -L somme + - -L Pich + - -L Brin + - -L socio-economic + - -L ist + - -S *.json + - -S *.api + - -S *.css + - -S *.js + - -S *.gexf + - -S *.ui + - -S *.net + - -S doc/python/tabulate.py + - id: codespell + name: Check commit message spelling + stages: [commit-msg] + + - repo: local + hooks: + - id: update-license-years + name: update-license-years + entry: bash + args: [./utils/git-hooks/pre-commit-license-years] + pass_filenames: false + language: system + +exclude: ^thirdparty/