11repos :
2- - repo : https://github.com/Lucas-C/pre-commit-hooks.git
3- sha : v1.0.1
4- hooks :
5- - id : remove-crlf
6- files : (?!.*third_party)^.*$ | (?!.*book)^.*$
7- - repo : https://github.com/PaddlePaddle/mirrors-yapf.git
8- sha : 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
9- hooks :
10- - id : yapf
11- files : (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
2+ # Common hooks
123- repo : https://github.com/pre-commit/pre-commit-hooks
13- sha : 5bf6c09bfa1297d3692cadd621ef95f1284e33c0
4+ rev : v4.1.0
145 hooks :
156 - id : check-added-large-files
167 - id : check-merge-conflict
178 - id : check-symlinks
189 - id : detect-private-key
19- files : (?!.*third_party)^.*$ | (?!.*book)^.*$
2010 - id : end-of-file-fixer
11+ - id : trailing-whitespace
12+ files : (.*\.(py|bzl|md|rst|c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps|cmake|yaml|yml|hook)|BUILD|.*\.BUILD|WORKSPACE|CMakeLists\.txt)$
13+ - repo : https://github.com/Lucas-C/pre-commit-hooks.git
14+ rev : v1.1.14
15+ hooks :
16+ - id : remove-crlf
17+ - id : remove-tabs
18+ name : Tabs remover (C++)
19+ files : \.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$
20+ args : [--whitespaces-count, '2']
21+ - id : remove-tabs
22+ name : Tabs remover (Python)
23+ files : (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
24+ args : [--whitespaces-count, '4']
25+ - repo : local
26+ hooks :
27+ - id : copyright_checker
28+ name : copyright_checker
29+ entry : python ./tools/codestyle/copyright.hook
30+ language : system
31+ files : \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|xpu|kps|py|sh)$
32+ # For Python files
33+ - repo : https://github.com/psf/black.git
34+ rev : 22.8.0
35+ hooks :
36+ - id : black
37+ files : (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
38+ - repo : https://github.com/pycqa/isort
39+ rev : 5.10.1
40+ hooks :
41+ - id : isort
42+ - repo : https://github.com/PyCQA/flake8
43+ rev : 4.0.1
44+ hooks :
45+ - id : flake8
46+ - repo : https://github.com/PyCQA/autoflake
47+ rev : v1.7.7
48+ hooks :
49+ - id : autoflake
50+ args :
51+ - --in-place
52+ - --remove-all-unused-imports
53+ - --ignore-pass-after-docstring
54+ - --ignore-init-module-imports
55+ - --exclude=python/paddle/fluid/[!t]**,python/paddle/fluid/tra**
2156- repo : local
2257 hooks :
23- - id : clang-format-with-version-check
58+ - id : pylint-doc-string
59+ name : pylint
60+ description : Check python docstring style using docstring_checker.
61+ entry : bash ./tools/codestyle/pylint_pre_commit.hook
62+ language : system
63+ files : \.(py)$
64+ # For C++ files
65+ - repo : local
66+ hooks :
67+ - id : clang-format
2468 name : clang-format
2569 description : Format files with ClangFormat.
2670 entry : bash ./tools/codestyle/clang_format.hook -i
2771 language : system
28- files : \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto| xpu|kps)$
72+ files : \.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$
2973- repo : local
3074 hooks :
3175 - id : cpplint-cpp-source
@@ -34,18 +78,24 @@ repos:
3478 entry : bash ./tools/codestyle/cpplint_pre_commit.hook
3579 language : system
3680 files : \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$
81+ args :
82+ - --extensions=c,cc,cxx,cpp,cu,cuh,h,hpp,hxx,kps
83+ - --filter=-readability/fn_size,-build/include_what_you_use,-build/c++11,-whitespace/parens
84+ - --quiet
85+ # For CMake files
3786- repo : local
3887 hooks :
39- - id : pylint-doc-string
40- name : pylint
41- description : Check python docstring style using docstring_checker.
42- entry : bash ./tools/codestyle/pylint_pre_commit.hook
88+ - id : auto-generate-cmakelists
89+ name : auto-generate-cmakelists
90+ entry : bash ./tools/gen_ut_cmakelists.hook
4391 language : system
44- files : \.(py)$
45- - repo : local
92+ files : testslist.csv$
93+ - repo : https://github.com/cheshirekow/cmake-format-precommit
94+ rev : v0.6.13
4695 hooks :
47- - id : copyright_checker
48- name : copyright_checker
49- entry : python ./tools/codestyle/copyright.hook
50- language : system
51- files : \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|xpu|kps|py|sh)$
96+ - id : cmake-format
97+ - repo : https://github.com/cmake-lint/cmake-lint
98+ rev : 1.4.2
99+ hooks :
100+ - id : cmakelint
101+ args : [--config=./tools/codestyle/.cmakelintrc]
0 commit comments