.pre-commit-config.yaml 1.9 KB
Newer Older
朔-望's avatar
朔-望 已提交
1 2 3 4 5 6 7 8
repos:
-   repo: https://github.com/Lucas-C/pre-commit-hooks.git
    sha: v1.0.1
    hooks:
    -   id: remove-crlf
        files: (src).*\.(md|py|mm|swift|java|c|cc|cxx|cpp|cu|h|hpp|hxx)$
    -   id: remove-tabs
        files: (src).*\.(md|py|mm|swift|java|c|cc|cxx|cpp|cu|h|hpp|hxx)$
9

朔-望's avatar
朔-望 已提交
10 11 12 13 14 15 16 17 18 19 20 21
-   repo: https://github.com/pre-commit/pre-commit-hooks
    sha: 5bf6c09bfa1297d3692cadd621ef95f1284e33c0
    hooks:
    -   id: check-added-large-files
    -   id: check-merge-conflict
    -   id: check-symlinks
    -   id: detect-private-key
        files: (?!.*tar.gz)^.*$ 
    -   id: end-of-file-fixer
        files: (src).*\.(md|py|mm|swift|java|c|cc|cxx|cpp|cu|h|hpp|hxx)$
    -   id: trailing-whitespace
        files: (src).*\.(md|py|mm|swift|java|c|cc|cxx|cpp|cu|h|hpp|hxx)$
22

朔-望's avatar
朔-望 已提交
23 24 25 26 27 28 29
-   repo: local
    hooks:
    -   id: clang-format
        name: clang-format
        description: Format files with ClangFormat.
        entry: bash ./tools/pre-commit.hooks/.clang-format.hook -i
        language: system
朔-望's avatar
朔-望 已提交
30 31 32 33 34 35 36 37 38 39 40
        files: (src).*\.(c|cc|cxx|cpp|h|hpp|hxx)$

#     
#-   repo: local
#    hooks:
#    -   id: clang-tidy
#        name: clang-tidy
#        description: Check C++ code style using clang-tidy.
#        entry: bash ./tools/pre-commit.hooks/.clang-tidy.hook -i
#        language: system
#        files: (src).*\.(c|cc|cxx|cpp|h|hpp|hxx)$
朔-望's avatar
朔-望 已提交
41

朔-望's avatar
朔-望 已提交
42 43
-   repo: local
    hooks:
朔-望's avatar
朔-望 已提交
44 45 46 47
    -   id: cpplint
        name: cpplint
        description: Check C++ code style using cpplint.
        entry: bash ./tools/pre-commit.hooks/.cpplint.hook
朔-望's avatar
朔-望 已提交
48
        language: system
朔-望's avatar
朔-望 已提交
49 50
        files: (src).*\.(c|cc|cxx|cpp|cu|h|hpp|hxx)$
        exclude: (?!.*third_party)^.*$ | (?!.*book)^.*$i | *\.pb\.cpp
51 52 53 54 55 56 57 58
#-   repo: local
#    hooks:
#    -   id: copyright_checker
#        name: copyright_checker
#        entry: python ./tools/pre-commit.hooks/.copyright.hook
#        language: system
#        files: (src).*\.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
#        exclude: (?!.*third_party)^.*$ | (?!.*book)^.*$