repos: - repo: https://github.com/Lucas-C/pre-commit-hooks.git rev: v1.1.14 hooks: - id: remove-crlf files: (?!.*third_party)^.*$ | (?!.*book)^.*$ - repo: https://github.com/google/yapf rev: v0.32.0 hooks: - id: yapf files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$ exclude: | (?x)^( python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py| python/paddle/fluid/tests/unittests/dygraph_to_static/test_origin_info.py )$ - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.1.0 hooks: - id: check-added-large-files - id: check-merge-conflict - id: check-symlinks - id: detect-private-key files: (?!.*third_party)^.*$ | (?!.*book)^.*$ - id: end-of-file-fixer - id: sort-simple-yaml files: (api|backward)\.yaml$ - repo: local hooks: - id: clang-format-with-version-check name: clang-format description: Format files with ClangFormat. entry: bash ./tools/codestyle/clang_format.hook -i language: system files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$ exclude: | (?x)^( paddle/fluid/distributed/ps/thirdparty/round_robin.h )$ - 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)$ - 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)$ - 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|xpu|kps|py|sh)$ exclude: | (?x)^( paddle/utils/.* )$ - 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 )$ - repo: https://github.com/cmake-lint/cmake-lint rev: 1.4.2 hooks: - id: cmakelint args: [--config=./tools/codestyle/.cmakelintrc] # exclude files which need to be fixed exclude: | (?x)^( CMakeLists.txt| python/paddle/fluid/tests/unittests/CMakeLists.txt| paddle/fluid/inference/tests/infer_ut/CMakeLists.txt| cmake/configure.cmake| paddle/fluid/inference/api/demo_ci/CMakeLists.txt| cmake/flags.cmake| cmake/inference_lib.cmake| cmake/external/protobuf.cmake| paddle/fluid/framework/fleet/CMakeLists.txt| paddle/fluid/inference/CMakeLists.txt| paddle/fluid/inference/tests/api/CMakeLists.txt| paddle/fluid/operators/CMakeLists.txt| cmake/external/lite.cmake| cmake/external/poplar.cmake| cmake/python_module.cmake| python/paddle/fluid/tests/unittests/asp/CMakeLists.txt| cmake/cuda.cmake| cmake/FindNumPy.cmake| cmake/coveralls.cmake| cmake/external/glog.cmake| cmake/external/onnxruntime.cmake| cmake/external/openblas.cmake| cmake/external/xpu.cmake| cmake/hip.cmake| paddle/fluid/inference/analysis/ir_passes/CMakeLists.txt| paddle/fluid/inference/api/CMakeLists.txt| paddle/fluid/operators/controlflow/CMakeLists.txt| python/paddle/fluid/tests/unittests/distributed_passes/CMakeLists.txt| cmake/operators.cmake| cmake/tensorrt.cmake| paddle/fluid/inference/api/details/CMakeLists.txt| python/paddle/fluid/tests/unittests/xpu/CMakeLists.txt| cmake/external/arm_brpc.cmake| cmake/external/concurrentqueue.cmake| cmake/external/eigen.cmake| cmake/external/mklml.cmake| cmake/external/paddle2onnx.cmake| cmake/miopen.cmake| cmake/nccl.cmake| cmake/simd.cmake| paddle/fluid/inference/analysis/CMakeLists.txt| paddle/fluid/inference/tests/infer_ut/external-cmake/gtest-cpp.cmake| paddle/fluid/memory/allocation/CMakeLists.txt| paddle/fluid/memory/CMakeLists.txt| paddle/fluid/operators/cinn/CMakeLists.txt| paddle/infrt/external_kernels/CMakeLists.txt| paddle/infrt/kernel/phi/CMakeLists.txt| python/paddle/fluid/contrib/slim/tests/CMakeLists.txt| python/paddle/fluid/tests/unittests/autograd/CMakeLists.txt| python/paddle/fluid/tests/unittests/distribution/CMakeLists.txt| python/paddle/fluid/tests/unittests/dygraph_to_static/CMakeLists.txt| python/paddle/fluid/tests/unittests/fft/CMakeLists.txt| python/paddle/fluid/tests/unittests/ipu/CMakeLists.txt| python/paddle/fluid/tests/unittests/mkldnn/CMakeLists.txt| python/paddle/fluid/tests/unittests/npu/CMakeLists.txt| python/paddle/fluid/tests/unittests/ps/CMakeLists.txt| python/paddle/fluid/tests/unittests/rnn/CMakeLists.txt| python/paddle/fluid/tests/unittests/sequence/CMakeLists.txt )$