瀏覽代碼

Add clang-format to lefthook

DarthSim 1 年之前
父節點
當前提交
06cd9413c6
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      lefthook.yml

+ 4 - 0
lefthook.yml

@@ -2,6 +2,10 @@ pre-commit:
   scripts:
   scripts:
     lint:
     lint:
       tags: lint
       tags: lint
+  commands:
+    lint-clang:
+      tags: lint
+      run: command -v clang-format && find . -not -path "./.tmp/*" -not -path "./.git/*" \( -iname "*.h" -o -iname "*.c" -o -iname "*.cpp" \) | xargs clang-format --dry-run --Werror
 
 
 pre-push:
 pre-push:
   scripts:
   scripts: