Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
681d6b14
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
681d6b14
编写于
9月 27, 2022
作者:
N
Nyakku Shigure
提交者:
GitHub
9月 27, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CodeStyle] add pre-commit hook `remove-tabs` for python files (#46290)
上级
30387006
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
29 addition
and
8 deletion
+29
-8
.flake8
.flake8
+15
-7
.pre-commit-config.yaml
.pre-commit-config.yaml
+14
-1
未找到文件。
.flake8
浏览文件 @
681d6b14
[flake8]
[flake8]
select = C,E,F,W
select = C,E,F,W
exclude = ./build
exclude =
./build,
# A trick to exclude fluid/ but keep fluid/tests/, see more at
# https://github.com/PaddlePaddle/Paddle/pull/46290#discussion_r976392010
./python/paddle/fluid/[!t]**,
./python/paddle/fluid/tra**
ignore =
ignore =
# E, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
# E, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
E1
01,E121,E122,E123,E124
,E125,E126,E127,E128,E129,E131,
E1
21,E122,E123
,E125,E126,E127,E128,E129,E131,
E201,E202,E203,E22
1,E225,E226,E228,E231,E241,E251,E261,E262,E265,E266,E271,E272,E275
,
E201,E202,E203,E22
5,E226,E228,E231,E241,E251,E261,E262,E265,E266,E271,E272
,
E301,E302,E303,E305,E306,
E301,E302,E303,E305,E306,
E401,E402,
E401,E402,
E501,E502,
E501,E502,
E701,E711,E712,E713,E714,E721,E722,E731,E741,
E701,E711,E712,E713,E714,E721,E722,E731,E741,
# F, see https://flake8.pycqa.org/en/latest/user/error-codes.html
# F, see https://flake8.pycqa.org/en/latest/user/error-codes.html
F401,F402,F403,F40
4,F40
5,
F401,F402,F403,F405,
F522,F52
3,F52
4,F541,
F522,F524,F541,
F601,F631,F632,
F601,F631,F632,
F811,F821,F8
23,F8
41,
F811,F821,F841,
# W, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
# W, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
W191,
W503,W504
W503,W504
W601,W605
W601,W605
per-file-ignores =
# These files need tabs for testing.
python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py:E101,W191
python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs1.py:E101,W191
.pre-commit-config.yaml
浏览文件 @
681d6b14
# Exclude all third-party libraries globally
exclude
:
|
exclude
:
|
(?x)^(
(?x)^(
patches/.+|
patches/.+|
paddle/fluid/framework/fleet/heter_ps/cudf/.+|
paddle/fluid/framework/fleet/heter_ps/cudf/.+|
paddle/fluid/distributed/ps/thirdparty/round_robin.h
paddle/fluid/distributed/ps/thirdparty/round_robin.h|
python/paddle/utils/gast/.+
)$
)$
repos
:
repos
:
-
repo
:
https://github.com/Lucas-C/pre-commit-hooks.git
-
repo
:
https://github.com/Lucas-C/pre-commit-hooks.git
...
@@ -12,6 +14,17 @@ repos:
...
@@ -12,6 +14,17 @@ repos:
-
id
:
remove-tabs
-
id
:
remove-tabs
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$
args
:
[
--whitespaces-count
,
'
2'
]
args
:
[
--whitespaces-count
,
'
2'
]
-
id
:
remove-tabs
files
:
(.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
args
:
[
--whitespaces-count
,
'
4'
]
# Exclude the fluid directory but keep the fluid/tests directory.
# And exclude some unit test files that require tabs.
exclude
:
|
(?x)^(
python/paddle/fluid/(?!tests).+|
python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs1.py|
python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py
)$
-
repo
:
https://github.com/google/yapf
-
repo
:
https://github.com/google/yapf
rev
:
v0.32.0
rev
:
v0.32.0
hooks
:
hooks
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录