.pre-commit-config.yaml 1.9 KB
Newer Older
朔-望's avatar
朔-望 已提交
1 2 3 4 5
repos:
-   repo: https://github.com/Lucas-C/pre-commit-hooks.git
    sha: v1.0.1
    hooks:
    -   id: remove-crlf
Y
Yan Chunwei 已提交
6 7 8 9 10 11
        files: (?!.*third_party)^.*$ | (?!.*book)^.*$ ^mobile/ ^metal/ ^web/
#-   repo: https://github.com/PaddlePaddle/mirrors-yapf.git
    #sha: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
    #hooks:
    #-   id: yapf
        #files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
朔-望's avatar
朔-望 已提交
12 13 14 15 16 17 18
-   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
Y
Yan Chunwei 已提交
19
        files: (?!.*third_party)^.*$ | (?!.*book)^.*$
朔-望's avatar
朔-望 已提交
20
    -   id: end-of-file-fixer
朔-望's avatar
朔-望 已提交
21 22
-   repo: local
    hooks:
Y
Yan Chunwei 已提交
23
    -   id: clang-format-with-version-check
朔-望's avatar
朔-望 已提交
24 25
        name: clang-format
        description: Format files with ClangFormat.
Y
Yan Chunwei 已提交
26
        entry: bash ./tools/codestyle/clang_format.hook -i
朔-望's avatar
朔-望 已提交
27
        language: system
Y
Yan Chunwei 已提交
28
        files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto)$ ^mobile/ ^metal/ ^web/
朔-望's avatar
朔-望 已提交
29 30
-   repo: local
    hooks:
Y
Yan Chunwei 已提交
31
    -   id: cpplint-cpp-source
朔-望's avatar
朔-望 已提交
32
        name: cpplint
Y
Yan Chunwei 已提交
33 34
        description: Check C++ code style using cpplint.py.
        entry: bash ./tools/codestyle/cpplint_pre_commit.hook
朔-望's avatar
朔-望 已提交
35
        language: system
Y
Yan Chunwei 已提交
36
        files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$ ^mobile/ ^metal/ ^web/
37
#-   repo: local
Y
Yan Chunwei 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
    #hooks:
    #-   id: pylint-doc-string
        #name: pylint
        #description: Check python docstring style using docstring_checker.
        #entry: bash ./tools/codestyle/pylint_pre_commit.hook
        #language: system
        #files: \.(py)$
-   repo: local
    hooks:
    -   id: copyright_checker
        name: copyright_checker
        entry: python ./tools/codestyle/copyright.hook
        language: system
        files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$ ^mobile/ ^metal/ ^web/
        exclude: (?!.*third_party)^.*$ | (?!.*book)^.*$