Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
664758fa
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
664758fa
编写于
6月 01, 2022
作者:
S
Sing_chan
提交者:
GitHub
6月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code format check upgrade step1: pre-commit, remove-ctrlf, pylint (#43103)
上级
f59bcb1c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
2 deletion
+12
-2
.pre-commit-config.yaml
.pre-commit-config.yaml
+1
-1
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+4
-0
tools/codestyle/pylint_pre_commit.hook
tools/codestyle/pylint_pre_commit.hook
+7
-1
未找到文件。
.pre-commit-config.yaml
浏览文件 @
664758fa
repos
:
repos
:
-
repo
:
https://github.com/Lucas-C/pre-commit-hooks.git
-
repo
:
https://github.com/Lucas-C/pre-commit-hooks.git
sha
:
v1.0.1
rev
:
v1.1.14
hooks
:
hooks
:
-
id
:
remove-crlf
-
id
:
remove-crlf
files
:
(?!.*third_party)^.*$ | (?!.*book)^.*$
files
:
(?!.*third_party)^.*$ | (?!.*book)^.*$
...
...
paddle/scripts/paddle_build.sh
浏览文件 @
664758fa
...
@@ -360,6 +360,10 @@ function check_style() {
...
@@ -360,6 +360,10 @@ function check_style() {
# pre-commit use python3.8.0
# pre-commit use python3.8.0
OLD_PATH
=
$PATH
OLD_PATH
=
$PATH
export
PATH
=
/usr/local/python3.8.0/bin:/usr/local/python3.8.0/include:/usr/local/bin:
${
PATH
}
export
PATH
=
/usr/local/python3.8.0/bin:/usr/local/python3.8.0/include:/usr/local/bin:
${
PATH
}
if
!
[[
$(
pre-commit
--version
)
==
*
"2.17.0"
*
]]
;
then
pip
install
pre-commit
==
2.17.0
fi
pre-commit
install
pre-commit
install
clang-format
--version
clang-format
--version
...
...
tools/codestyle/pylint_pre_commit.hook
浏览文件 @
664758fa
...
@@ -6,6 +6,13 @@ TOTAL_ERRORS=0
...
@@ -6,6 +6,13 @@ TOTAL_ERRORS=0
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
export
PYTHONPATH
=
$DIR
:
$PYTHONPATH
export
PYTHONPATH
=
$DIR
:
$PYTHONPATH
readonly
VERSION
=
"2.12.0"
version
=
$(
pylint
--version
|
grep
'pylint'
)
if
!
[[
$version
==
*
"
$VERSION
"
*
]]
;
then
pip
install
pylint
==
2.12.0 1>nul
fi
# The trick to remove deleted files: https://stackoverflow.com/a/2413151
# The trick to remove deleted files: https://stackoverflow.com/a/2413151
for
file
in
$(
git diff
--name-status
|
awk
'$1 != "D" {print $2}'
)
;
do
for
file
in
$(
git diff
--name-status
|
awk
'$1 != "D" {print $2}'
)
;
do
pylint
--disable
=
all
--load-plugins
=
docstring_checker
\
pylint
--disable
=
all
--load-plugins
=
docstring_checker
\
...
@@ -16,4 +23,3 @@ done
...
@@ -16,4 +23,3 @@ done
exit
$TOTAL_ERRORS
exit
$TOTAL_ERRORS
#For now, just warning:
#For now, just warning:
#exit 0
#exit 0
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录