Skip to content
Snippets Groups Projects
Verified Commit 70aa34fa authored by Lars Bilke's avatar Lars Bilke
Browse files

[pre-commit] Run git clang-format as a pre-commit check.

If git clang-format is not available the check always passes. I did
not found a way to let pre-commit mark the check as skipped or not
available to indicate that the checks are not run complete.
parent dc91a2b3
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,11 @@ repos:
- id: cmake-lint
additional_dependencies: ["cmakelang[YAML]"]
exclude: "scripts/cmake/jedbrown/.*|PackagingMacros.cmake|conan.cmake|CPM.cmake|FindFilesystem.cmake|ConanSetup.cmake|BuildExternalProject.cmake"
- repo: git://github.com/doublify/pre-commit-clang-format
rev: 62302476d0da01515660132d76902359bed0f782
- repo: local
hooks:
- id: clang-format
- id: git-clang-format
name: git-clang-format
entry: bash -c 'if command -v git-clang-format &> /dev/null; then git clang-format; else exit 0; fi'
language: system
pass_filenames: false
files: \.(h|cpp)$
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment