From db0ca7a58c6b27c556d948163d6953952e085775 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Wed, 21 Sep 2022 11:16:47 +0800 Subject: [PATCH] [CodeStyle] add pre-commit hook `remove-tabs` for cpp files (#46232) * [CodeStyle] add pre-commit hook `remove-tabs` for cpp files * empty commit, test=document_fix --- .pre-commit-config.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c27c1fa0a3b..c97d38d3040 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,17 @@ exclude: | (?x)^( - patches/.+ + patches/.+| + paddle/fluid/framework/fleet/heter_ps/cudf/.+| + paddle/fluid/distributed/ps/thirdparty/round_robin.h )$ repos: - repo: https://github.com/Lucas-C/pre-commit-hooks.git rev: v1.1.14 hooks: - id: remove-crlf + - id: remove-tabs + files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$ + args: [--whitespaces-count, '2'] - repo: https://github.com/google/yapf rev: v0.32.0 hooks: @@ -37,10 +42,6 @@ repos: 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 -- GitLab