Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
6e362444
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6e362444
编写于
2月 27, 2019
作者:
T
Tao Luo
提交者:
GitHub
2月 27, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15939 from luotao1/pre_commit2
enable cpplint, remove go_fmt
上级
454f4f21
436dfbb3
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
6435 deletion
+16
-6435
.pre-commit-config.yaml
.pre-commit-config.yaml
+0
-6
paddle/scripts/cpplint.py
paddle/scripts/cpplint.py
+0
-6425
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+1
-0
tools/codestyle/cpplint_pre_commit.hook
tools/codestyle/cpplint_pre_commit.hook
+15
-4
未找到文件。
.pre-commit-config.yaml
浏览文件 @
6e362444
...
@@ -42,12 +42,6 @@ repos:
...
@@ -42,12 +42,6 @@ repos:
entry
:
bash ./tools/codestyle/pylint_pre_commit.hook
entry
:
bash ./tools/codestyle/pylint_pre_commit.hook
language
:
system
language
:
system
files
:
\.(py)$
files
:
\.(py)$
-
repo
:
https://github.com/PaddlePaddle/pre-commit-golang
sha
:
8337620115c25ff8333f1b1a493bd031049bd7c0
hooks
:
-
id
:
go-fmt
types
:
-
go
-
repo
:
local
-
repo
:
local
hooks
:
hooks
:
-
id
:
copyright_checker
-
id
:
copyright_checker
...
...
paddle/scripts/cpplint.py
已删除
100644 → 0
浏览文件 @
454f4f21
此差异已折叠。
点击以展开。
paddle/scripts/paddle_build.sh
浏览文件 @
6e362444
...
@@ -259,6 +259,7 @@ function check_style() {
...
@@ -259,6 +259,7 @@ function check_style() {
eval
"
$(
GIMME_GO_VERSION
=
1.8.3 gimme
)
"
eval
"
$(
GIMME_GO_VERSION
=
1.8.3 gimme
)
"
fi
fi
pip
install
cpplint
# set up go environment for running gometalinter
# set up go environment for running gometalinter
mkdir
-p
$GOPATH
/src/github.com/PaddlePaddle/
mkdir
-p
$GOPATH
/src/github.com/PaddlePaddle/
ln
-sf
${
PADDLE_ROOT
}
$GOPATH
/src/github.com/PaddlePaddle/Paddle
ln
-sf
${
PADDLE_ROOT
}
$GOPATH
/src/github.com/PaddlePaddle/Paddle
...
...
tools/codestyle/cpplint_pre_commit.hook
浏览文件 @
6e362444
#!/bin/bash
#!/bin/bash
TOTAL_ERRORS
=
0
TOTAL_ERRORS
=
0
if
[[
!
$TRAVIS_BRANCH
]]
;
then
# install cpplint on local machine.
if
[[
!
$(
which cpplint
)
]]
;
then
pip
install
cpplint
fi
# diff files on local machine.
files
=
$(
git diff
--cached
--name-status
|
awk
'$1 != "D" {print $2}'
)
else
# diff files between PR and latest commit on Travis CI.
branch_ref
=
$(
git rev-parse
"
$TRAVIS_BRANCH
"
)
head_ref
=
$(
git rev-parse HEAD
)
files
=
$(
git diff
--name-status
$branch_ref
$head_ref
|
awk
'$1 != "D" {print $2}'
)
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
--cached
--name-status
|
awk
'$1 != "D" {print $2}'
)
;
do
for
file
in
$
files
;
do
if
[[
$file
=
~ ^
(
pa
ddle/legacy/api/.
*
|paddle/legacy/capi/.
*
|paddle/contrib/.
*
|paddle/legacy/cuda/.
*
|paddle/legacy/function/.
*
|paddle/legacy/gserver/.
*
|paddle/legacy/math/.
*
|paddle/legacy/optimizer/.
*
|paddle/legacy/parameter/.
*
|paddle/legacy/pserver/.
*
|paddle/legacy/trainer/.
*
|paddle/legacy/utils/.
*
|paddle/testing/TestUtil.
*
|pa
tches/grpc/.
*
)
]]
;
then
if
[[
$file
=
~ ^
(
patches/grpc/.
*
)
]]
;
then
continue
;
continue
;
else
else
cpplint
--filter
=
-readability
/fn_size
$file
;
cpplint
--filter
=
-readability
/fn_size
$file
;
...
@@ -13,4 +25,3 @@ for file in $(git diff --cached --name-status | awk '$1 != "D" {print $2}'); do
...
@@ -13,4 +25,3 @@ for file in $(git diff --cached --name-status | awk '$1 != "D" {print $2}'); do
done
done
exit
$TOTAL_ERRORS
exit
$TOTAL_ERRORS
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录