Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
2f3f75f5
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
2f3f75f5
编写于
8月 23, 2019
作者:
S
sangoly
提交者:
GitHub
8月 23, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Pre-Commit] fix pre-commit hooks bug (#1844)
上级
9388dace
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
107 addition
and
102 deletion
+107
-102
.pre-commit-config.yaml
.pre-commit-config.yaml
+10
-6
.travis.yml
.travis.yml
+9
-10
.travis/pre-commit-job.sh
.travis/pre-commit-job.sh
+2
-0
lite/demo/java/android/PaddlePredictor/gradlew.bat
lite/demo/java/android/PaddlePredictor/gradlew.bat
+84
-84
lite/tools/debug/debug_utils.h
lite/tools/debug/debug_utils.h
+1
-1
lite/utils/io.h
lite/utils/io.h
+1
-1
未找到文件。
.pre-commit-config.yaml
浏览文件 @
2f3f75f5
...
...
@@ -3,7 +3,8 @@ repos:
sha
:
v1.0.1
hooks
:
-
id
:
remove-crlf
files
:
(?!.*third_party)^.*$ | (?!.*book)^.*$ ^mobile/ ^metal/ ^web/
files
:
(?!.*third_party)^.*$|(?!.*book)^.*$
exclude
:
^(mobile/|metal/|web/)
#- repo: https://github.com/PaddlePaddle/mirrors-yapf.git
#sha: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
#hooks:
...
...
@@ -16,7 +17,7 @@ repos:
-
id
:
check-merge-conflict
-
id
:
check-symlinks
-
id
:
detect-private-key
files
:
(?!.*third_party)^.*$
|
(?!.*book)^.*$
files
:
(?!.*third_party)^.*$
|
(?!.*book)^.*$
-
id
:
end-of-file-fixer
-
repo
:
local
hooks
:
...
...
@@ -25,7 +26,8 @@ repos:
description
:
Format files with ClangFormat.
entry
:
bash ./tools/codestyle/clang_format.hook -i
language
:
system
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto)$ ^mobile/ ^metal/ ^web/
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto)$
exclude
:
^(mobile/|metal/|web/)
-
repo
:
local
hooks
:
-
id
:
cpplint-cpp-source
...
...
@@ -33,7 +35,8 @@ repos:
description
:
Check C++ code style using cpplint.py.
entry
:
bash ./tools/codestyle/cpplint_pre_commit.hook
language
:
system
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx)$ ^mobile/ ^metal/ ^web/
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx)$
exclude
:
^(mobile/|metal/|web/)
#- repo: local
#hooks:
#- id: pylint-doc-string
...
...
@@ -48,5 +51,6 @@ repos:
name
:
copyright_checker
entry
:
python ./tools/codestyle/copyright.hook
language
:
system
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$ ^mobile/ ^metal/ ^web/
exclude
:
(?!.*third_party)^.*$ | (?!.*book)^.*$
files
:
\.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
exclude
:
(?!.*third_party)^.*$|(?!.*book)^.*$
exclude
:
^(mobile/|metal/|web/)
.travis.yml
浏览文件 @
2f3f75f5
...
...
@@ -9,18 +9,17 @@ os:
addons
:
apt
:
packages
:
-
git
-
python
-
python-pip
-
python2.7-dev
-
libc6-i386
-
curl
compiler
:
-
clang
# - git
# - python
# - python-pip
# - python2.7-dev
# - libc6-i386
# - curl
-
clang-format-3.8
before_install
:
-
sudo pip install -U virtualenv pre-commit pip
-
sudo pip install cpplint pre-commit
-
sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format
# Download and install recent cmake
script
:
...
...
.travis/pre-commit-job.sh
浏览文件 @
2f3f75f5
...
...
@@ -11,6 +11,8 @@ cd `dirname $0`
cd
..
export
PATH
=
/usr/bin:
$PATH
pre-commit
install
which clang-format
clang-format
--version
if
!
pre-commit run
-a
;
then
ls
-lh
...
...
lite/demo/java/android/PaddlePredictor/gradlew.bat
浏览文件 @
2f3f75f5
@if
"
%DEBUG%
"
==
""
@echo
off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if
"
%OS%
"
==
"Windows_NT"
setlocal
set
DIRNAME
=
%~dp0
if
"
%DIRNAME%
"
==
""
set
DIRNAME
=
.
set
APP_BASE_NAME
=
%~n0
set
APP_HOME
=
%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set
DEFAULT_JVM_OPTS
=
@rem Find java.exe
if
defined
JAVA_HOME
goto
findJavaFromJavaHome
set
JAVA_EXE
=
java
.exe
%JAVA_EXE%
-version
>
NUL
2
>&
1
if
"
%ERRORLEVEL%
"
==
"0"
goto
init
echo
.
echo
ERROR
:
JAVA_HOME
is
not
set
and
no
'java'
command
could
be
found
in
your
PATH
.
echo
.
echo
Please
set
the
JAVA_HOME
variable
in
your
environment
to
match
the
echo
location
of
your
Java
installation
.
goto
fail
:findJavaFromJavaHome
set
JAVA_HOME
=
%JAVA
_HOME:
"=
%
set JAVA_EXE=
%JAVA_HOME%
/bin/java.exe
if exist "
%JAVA_EXE%
" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory:
%JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "
%OS%
" == "
Windows_NT
" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "
x
%
~
1
" == "
x
" goto execute
set CMD_LINE_ARGS=
%
*
:execute
@rem Setup the command line
set CLASSPATH=
%APP_HOME%
\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"
%JAVA_EXE%
"
%DEFAULT_JVM_OPTS%
%JAVA_OPTS%
%GRADLE_OPTS%
"
-Dorg
.gradle.appname
=
%APP_BASE_NAME%
" -classpath "
%CLASSPATH%
" org.gradle.wrapper.GradleWrapperMain
%CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "
%ERRORLEVEL%
"=="
0
" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code
!
if not "" == "
%GRADLE_EXIT_CONSOLE%
" exit 1
exit /b 1
:mainEnd
if "
%OS%
"=="
Windows_NT
" endlocal
:omega
@if
"
%DEBUG%
"
==
""
@echo
off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if
"
%OS%
"
==
"Windows_NT"
setlocal
set
DIRNAME
=
%~dp0
if
"
%DIRNAME%
"
==
""
set
DIRNAME
=
.
set
APP_BASE_NAME
=
%~n0
set
APP_HOME
=
%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set
DEFAULT_JVM_OPTS
=
@rem Find java.exe
if
defined
JAVA_HOME
goto
findJavaFromJavaHome
set
JAVA_EXE
=
java
.exe
%JAVA_EXE%
-version
>
NUL
2
>&
1
if
"
%ERRORLEVEL%
"
==
"0"
goto
init
echo
.
echo
ERROR
:
JAVA_HOME
is
not
set
and
no
'java'
command
could
be
found
in
your
PATH
.
echo
.
echo
Please
set
the
JAVA_HOME
variable
in
your
environment
to
match
the
echo
location
of
your
Java
installation
.
goto
fail
:findJavaFromJavaHome
set
JAVA_HOME
=
%JAVA
_HOME:
"=
%
set JAVA_EXE=
%JAVA_HOME%
/bin/java.exe
if exist "
%JAVA_EXE%
" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory:
%JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "
%OS%
" == "
Windows_NT
" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "
x
%
~
1
" == "
x
" goto execute
set CMD_LINE_ARGS=
%
*
:execute
@rem Setup the command line
set CLASSPATH=
%APP_HOME%
\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"
%JAVA_EXE%
"
%DEFAULT_JVM_OPTS%
%JAVA_OPTS%
%GRADLE_OPTS%
"
-Dorg
.gradle.appname
=
%APP_BASE_NAME%
" -classpath "
%CLASSPATH%
" org.gradle.wrapper.GradleWrapperMain
%CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "
%ERRORLEVEL%
"=="
0
" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code
!
if not "" == "
%GRADLE_EXIT_CONSOLE%
" exit 1
exit /b 1
:mainEnd
if "
%OS%
"=="
Windows_NT
" endlocal
:omega
lite/tools/debug/debug_utils.h
浏览文件 @
2f3f75f5
...
...
@@ -115,7 +115,7 @@ void FillTensorData(lite::Tensor* tensor, const DebugConfig& conf, int col) {
data
[
i
]
=
input_data
[
i
];
}
}
else
{
LOG
(
INFO
)
<<
"------------> Use all-ones input"
;
LOG
(
INFO
)
<<
"------------
-
> Use all-ones input"
;
for
(
int
i
=
0
;
i
<
dim_size
;
i
++
)
{
data
[
i
]
=
1
;
}
...
...
lite/utils/io.h
浏览文件 @
2f3f75f5
...
...
@@ -35,7 +35,7 @@ static bool IsFileExists(const std::string& path) {
// ARM mobile not support mkdir in C++
static
void
MkDirRecur
(
const
std
::
string
&
path
)
{
#ifndef LITE_WITH_ARM
if
(
system
(
string_format
(
"mkdir -p %s"
,
path
.
c_str
()).
c_str
())
!=
0
)
{
if
(
system
(
string_format
(
"mkdir -p %s"
,
path
.
c_str
()).
c_str
())
!=
0
)
{
LOG
(
ERROR
)
<<
"Cann't mkdir "
<<
path
;
}
#else // On ARM
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录