.pre-commit-config.yaml 2.2 KB
Newer Older
Y
Yi Wang 已提交
1
repos:
Y
Yu Yang 已提交
2
-   repo: https://github.com/Lucas-C/pre-commit-hooks.git
3
    rev: v1.1.14
Y
Yu Yang 已提交
4 5
    hooks:
    -   id: remove-crlf
L
liaogang 已提交
6
        files: (?!.*third_party)^.*$ | (?!.*book)^.*$
Y
Yu Yang 已提交
7 8
-   repo: https://github.com/PaddlePaddle/mirrors-yapf.git
    sha: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
Y
Yu Yang 已提交
9
    hooks:
Y
Yi Wang 已提交
10 11
    -   id: yapf
        files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
Y
Yu Yang 已提交
12
-   repo: https://github.com/pre-commit/pre-commit-hooks
13
    rev: v4.1.0
Y
Yu Yang 已提交
14 15 16 17 18
    hooks:
    -   id: check-added-large-files
    -   id: check-merge-conflict
    -   id: check-symlinks
    -   id: detect-private-key
L
liaogang 已提交
19
        files: (?!.*third_party)^.*$ | (?!.*book)^.*$
Y
Yu Yang 已提交
20
    -   id: end-of-file-fixer
21 22
    -   id: sort-simple-yaml
        files: (api|backward)\.yaml$
L
test  
liaogang 已提交
23
-   repo: local
Y
Yu Yang 已提交
24
    hooks:
25
    -   id: clang-format-with-version-check
L
test  
liaogang 已提交
26 27
        name: clang-format
        description: Format files with ClangFormat.
28
        entry: bash ./tools/codestyle/clang_format.hook -i
L
test  
liaogang 已提交
29
        language: system
30
        files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|xpu|kps)$
Y
Yi Wang 已提交
31 32 33 34 35 36 37 38
-   repo: local
    hooks:
    -   id: cpplint-cpp-source
        name: cpplint
        description: Check C++ code style using cpplint.py.
        entry: bash ./tools/codestyle/cpplint_pre_commit.hook
        language: system
        files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$
G
gongweibao 已提交
39 40 41 42 43 44 45 46
-   repo: local
    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)$
D
dzhwinter 已提交
47 48 49 50
-   repo: local
    hooks:
    -   id: copyright_checker
        name: copyright_checker
51
        entry: python ./tools/codestyle/copyright.hook
D
dzhwinter 已提交
52
        language: system
53
        files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|xpu|kps|py|sh)$
54 55 56 57
        exclude: |
            (?x)^(
                paddle/utils/.*
            )$
58 59 60 61 62 63 64 65 66 67
-   repo: https://github.com/cheshirekow/cmake-format-precommit
    rev: v0.6.13
    hooks:
    -   id: cmake-format
        # exclude paddle/fluid/operators/CMakeLists.txt, see the comment
        # https://github.com/PaddlePaddle/Paddle/pull/43057#pullrequestreview-993471860
        exclude: |
            (?x)^(
                paddle/fluid/operators/CMakeLists.txt
            )$