代码拉取完成,页面将自动刷新
同步操作将从 PaddlePaddle/Paddle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# Exclude all third-party libraries and auto-generated files globally
exclude: |
(?x)^(
patches/.+|
paddle/fluid/framework/fleet/heter_ps/cudf/.+|
paddle/fluid/distributed/ps/thirdparty/round_robin.h|
python/paddle/utils/gast/.+|
third_party/.+
)$
repos:
# Common hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: sort-simple-yaml
files: (ops|backward|op_[a-z_]+)\.yaml$
- id: trailing-whitespace
files: (.*\.(py|bzl|md|rst|c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps|cmake|yaml|yml|hook)|BUILD|.*\.BUILD|WORKSPACE|CMakeLists\.txt)$
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.5.1
hooks:
- id: remove-crlf
- id: remove-tabs
name: Tabs remover (C++)
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$
args: [--whitespaces-count, '2']
- id: remove-tabs
name: Tabs remover (Python)
files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
args: [--whitespaces-count, '4']
# Exclude some unit test files that require tabs.
exclude: |
(?x)^(
test/dygraph_to_static/test_legacy_error.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/.*|
paddle/cinn/utils/registry.h
)$
# For Python files
- repo: https://github.com/psf/black.git
rev: 23.3.0
hooks:
- id: black
files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args: ["--config=.flake8"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --no-cache]
# For C++ files
- repo: local
hooks:
- id: clang-format
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)$
- 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: \.(cc|cxx|cpp|cu|h|hpp|hxx)$
args:
- --extensions=cc,cxx,cpp,cu,cuh,h,hpp,hxx,kps
- --filter=-readability/fn_size,-build/include_what_you_use,-build/c++11,-whitespace/parens
- --quiet
# Exclude third-party libraries
exclude: |
(?x)^(
paddle/utils/flat_hash_map\.h
)$
- repo: local
hooks:
- id: clang-tidy
name: clang-tidy
description: Parallel clang-tidy runner.
entry: python ./tools/codestyle/clang-tidy.py
language: system
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$
args:
- -p=build/
- -extra-arg=-Wno-unknown-warning-option
- -extra-arg=-Wno-pessimizing-move
- -extra-arg=-Wno-braced-scalar-init
- -extra-arg=-Wno-dangling-gsl
- -extra-arg=-Wno-deprecated-copy
- -extra-arg=-Wno-final-dtor-non-final-class
- -extra-arg=-Wno-implicit-int-float-conversion
- -extra-arg=-Wno-inconsistent-missing-override
- -extra-arg=-Wno-infinite-recursion
- -extra-arg=-Wno-mismatched-tags
- -extra-arg=-Wno-self-assign
- -extra-arg=-Wno-sign-compare
- -extra-arg=-Wno-sometimes-uninitialized
- -extra-arg=-Wno-tautological-overlap-compare
- -extra-arg=-Wno-unused-const-variable
- -extra-arg=-Wno-unused-lambda-capture
- -extra-arg=-Wno-unused-private-field
- -extra-arg=-Wno-unused-value
- -extra-arg=-Wno-unused-variable
- -extra-arg=-Wno-overloaded-virtual
- -extra-arg=-Wno-defaulted-function-deleted
- -extra-arg=-Wno-delete-non-abstract-non-virtual-dtor
- -extra-arg=-Wno-return-type-c-linkage
# For CMake files
- repo: local
hooks:
- id: auto-generate-cmakelists
name: auto-generate-cmakelists
entry: bash ./tools/gen_ut_cmakelists.hook
language: system
files: testslist.csv$
- 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/PFCCLab/cmake-lint-paddle
rev: v1.5.1
hooks:
- id: cmakelint
args: [--config=./tools/codestyle/.cmakelintrc]
# Others
- repo: local
hooks:
- id: sort-txt-file
name: sort-txt-file
description: Sorts each line string in a text file
entry: python ./tools/codestyle/sort_txt_file.py
language: python
files: test/white_list/pir_op_test_white_list
args: []
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。