Skip to content

Commit c85892a

Browse files
authored
[CodeStyle] upgrade pre-commit/pre-commit-hooks in .pre-commit-config.yaml (PaddlePaddle#6239)
1 parent 765ed12 commit c85892a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+241
-257
lines changed

.github/ISSUE_TEMPLATE/1_documentation-issue.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: >
99
#### 请确认反馈的问题来自PaddlePaddle官网文档:https://www.paddlepaddle.org.cn/ 。
10-
10+
1111
#### Before submitting a Documentation Issue, Please make sure that issue is related to https://www.paddlepaddle.org.cn/.
1212
1313
- type: textarea
@@ -28,16 +28,11 @@ body:
2828
description: |
2929
请告诉我们,你希望如何改进这个文档。
3030
Please tell us how you would like to improve this document.
31-
31+
3232
validations:
3333
required: false
34-
34+
3535
- type: markdown
3636
attributes:
3737
value: >
3838
感谢你的贡献 🎉!Thanks for your contribution 🎉!
39-
40-
41-
42-
43-

.github/ISSUE_TEMPLATE/2_eval-issue.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
value: >
99
#### 此模板用于文档评估工作小组成员向飞桨团队反馈文档问题,如非工作小组成员,请使用「📚 文档」模板,感谢配合~
10-
10+
1111
#### This template is used by members of the document evaluation working group to report documentation issues to the Paddle Team. If you are not a member of the working group, please use the "📚 Documentation Issue" template, thank you for your cooperation~
1212
1313
- type: textarea
@@ -38,11 +38,11 @@ body:
3838
description: |
3939
请评估本篇文档,是否按API文档推荐的结构书写,并且没有遗漏(无需写的部分可以省略)?
4040
如有结构问题,请在以下文本框中说明。
41-
41+
4242
API文档推荐的书写结构:API名称、API功能描述、API参数、API返回、API代码示例、API属性(class)、API方法(methods)
4343
validations:
4444
required: false
45-
45+
4646
- type: textarea
4747
id: eval3
4848
attributes:
@@ -56,7 +56,7 @@ body:
5656
- 没有死链、错字、错误标点等低级错误。
5757
validations:
5858
required: false
59-
59+
6060
- type: textarea
6161
id: eval4
6262
attributes:
@@ -79,10 +79,8 @@ body:
7979
如你已经发现了文档的错误并且判断其容易被修复,欢迎你为[Paddle](https://github.com/PaddlePaddle/Paddle/pulls)与[docs](https://github.com/PaddlePaddle/docs/pulls)提PR,直接修复此文档,并将PR链接贴在以下文本框中~
8080
validations:
8181
required: true
82-
82+
8383
- type: markdown
8484
attributes:
8585
value: >
8686
感谢你的贡献 🎉!Thanks for your contribution 🎉!
87-
88-

.github/ISSUE_TEMPLATE/3_eval_distributed_DataParallel_docs-issue.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ body:
3333
- 其他
3434
validations:
3535
required: true
36-
36+
3737
- type: markdown
3838
attributes:
3939
value: >
@@ -54,7 +54,7 @@ body:
5454
attributes:
5555
value: >
5656
## 任务一体验评测
57-
57+
5858
- type: textarea
5959
id: distributed_dp_eval1
6060
attributes:
@@ -111,7 +111,7 @@ body:
111111
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
112112
validations:
113113
required: true
114-
114+
115115
- type: textarea
116116
id: distributed_dp_eval5
117117
attributes:
@@ -125,7 +125,7 @@ body:
125125
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
126126
validations:
127127
required: true
128-
128+
129129
- type: textarea
130130
id: distributed_dp_eval6
131131
attributes:
@@ -191,7 +191,7 @@ body:
191191
attributes:
192192
value: >
193193
## 任务二体验评测
194-
194+
195195
- type: textarea
196196
id: distributed_dp_eval11
197197
attributes:
@@ -248,7 +248,7 @@ body:
248248
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
249249
validations:
250250
required: true
251-
251+
252252
- type: textarea
253253
id: distributed_dp_eval15
254254
attributes:
@@ -262,7 +262,7 @@ body:
262262
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
263263
validations:
264264
required: true
265-
265+
266266
- type: textarea
267267
id: distributed_dp_eval16
268268
attributes:
@@ -290,7 +290,7 @@ body:
290290
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
291291
validations:
292292
required: false
293-
293+
294294
- type: textarea
295295
id: distributed_dp_eval18
296296
attributes:
@@ -314,4 +314,3 @@ body:
314314
attributes:
315315
value: >
316316
感谢你的贡献 🎉!Thanks for your contribution 🎉!
317-

.github/ISSUE_TEMPLATE/4_eval_distributed_PS_docs-issue.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ body:
4343
attributes:
4444
value: >
4545
## 任务一体验评测
46-
46+
4747
- type: textarea
4848
id: distributed_ps_eval1
4949
attributes:
@@ -100,7 +100,7 @@ body:
100100
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
101101
validations:
102102
required: true
103-
103+
104104
- type: textarea
105105
id: distributed_ps_eval5
106106
attributes:
@@ -114,7 +114,7 @@ body:
114114
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
115115
validations:
116116
required: true
117-
117+
118118
- type: textarea
119119
id: distributed_ps_eval6
120120
attributes:
@@ -128,7 +128,7 @@ body:
128128
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
129129
validations:
130130
required: true
131-
131+
132132
- type: textarea
133133
id: distributed_ps_eval7
134134
attributes:
@@ -167,7 +167,7 @@ body:
167167
attributes:
168168
value: >
169169
## 任务二体验评测
170-
170+
171171
- type: textarea
172172
id: distributed_ps_eval11
173173
attributes:
@@ -224,7 +224,7 @@ body:
224224
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
225225
validations:
226226
required: true
227-
227+
228228
- type: textarea
229229
id: distributed_ps_eval15
230230
attributes:
@@ -238,7 +238,7 @@ body:
238238
- 对应文档是否描述清晰(如不清晰,需注明问题并提供文档链接):
239239
validations:
240240
required: true
241-
241+
242242
- type: textarea
243243
id: distributed_ps_eval16
244244
attributes:
@@ -276,4 +276,3 @@ body:
276276
attributes:
277277
value: >
278278
感谢你的贡献 🎉!Thanks for your contribution 🎉!
279-

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ build
77
.vscode
88
venv/
99

10-
*.pyc
10+
*.pyc

.pre-commit-config.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ repos:
55
- id: black
66
files: \.py$
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.1.0
8+
rev: v4.4.0
99
hooks:
1010
- id: check-merge-conflict
1111
- id: check-symlinks
1212
- id: detect-private-key
1313
files: (?!.*paddle)^.*$
1414
- id: end-of-file-fixer
15-
files: \.md$|\.rst$
15+
types: [text]
1616
- id: trailing-whitespace
17-
files: \.md$|\.rst$
17+
types: [text]
1818
- repo: https://github.com/Lucas-C/pre-commit-hooks
1919
rev: v1.5.1
2020
hooks:
@@ -43,4 +43,3 @@ repos:
4343
entry: python .pre-commit-hooks/convert_markdown_into_html.py
4444
language: system
4545
files: .+README(\.cn)?\.md$
46-

.pre-commit-hooks/convert_markdown_into_ipynb.sh

-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ for file in $@ ; do
66
exit 1
77
fi
88
done
9-

ci_scripts/CAPItools/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
robotpy-cppheaderparser==5.1.0
2-
# paddle
2+
# paddle

ci_scripts/api_white_list.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ paddle/utils/cpp_extension/setup_cn.rst
2121
paddle/utils/cpp_extension/CppExtension_cn.rst
2222
paddle/utils/cpp_extension/CUDAExtension_cn.rst
2323
paddle/hub/Overview_cn.rst
24-
paddle/incubate/autograd/Overview_cn.rst
24+
paddle/incubate/autograd/Overview_cn.rst

ci_scripts/check_api_cn.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ function filter_cn_api_files() {
1616
local need_check_files=""
1717
for file in `echo $git_files`;do
1818
grep 'code-block:: python' ../docs/$file > /dev/null
19-
if [ $? -eq 0 ] ;then
19+
if [ $? -eq 0 ] ;then
2020
api_file=`echo $file | sed 's#api/##g'`
2121
grep -w "${api_file}" ${DIR_PATH}/api_white_list.txt > /dev/null
2222
if [ $? -ne 0 ];then
2323
need_check_files="${need_check_files} $file"
24-
fi
24+
fi
2525
fi
2626
done
2727
if [[ "$__resultvar" ]] ; then
@@ -40,4 +40,4 @@ python check_copy_from_parsed_into_sample_code.py "${OUTPUTDIR}/zh/${VERSIONSTR}
4040
if [ $? -ne 0 ];then
4141
echo "ERROR: Exist COPY-FROM has not been parsed into sample code, please check COPY-FROM in the above files"
4242
exit 1
43-
fi
43+
fi

ci_scripts/check_api_docs_en.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jsonfn=$1
1818
output_path=$2
1919
need_check_api_py_files="${3}"
2020
echo "RUN System Message MARNING/ERROR Check"
21-
check_system_message $jsonfn $output_path "${need_check_api_py_files}"
21+
check_system_message $jsonfn $output_path "${need_check_api_py_files}"

ci_scripts/check_api_label_cn.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ python check_api_label_cn.py ${DOCROOT} ${APIROOT} $all_git_files
2121
if [ $? -ne 0 ];then
2222
echo "ERROR: api_label is not correct, please check api_label in the above files"
2323
exit 1
24-
fi
24+
fi

ci_scripts/check_api_parameters.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function filter_cn_api_files() {
1212
local need_check_files=""
1313
for file in `echo $git_files`;do
1414
echo "$file" | grep '.*\.rst$' > /dev/null
15-
if [ $? -eq 0 ] ;then
15+
if [ $? -eq 0 ] ;then
1616
need_check_files="${need_check_files} $file"
1717
fi
1818
done

ci_scripts/checkapproval.sh

-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ for API_FILE in ${API_FILES[*]}; do
2525
exit 1
2626
fi
2727
done
28-

ci_scripts/ci_start.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fi
3636
export PADDLE_WHL
3737
echo "PADDLE_WHL=${PADDLE_WHL}"
3838
set -x
39-
39+
4040
# 2 build all the Chinese and English docs, and upload them. Controlled with Env BUILD_DOC and UPLOAD_DOC
4141
PREVIEW_URL_PROMPT="ipipe_log_param_preview_url: None"
4242
if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
@@ -46,7 +46,7 @@ if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
4646
if [ $? -ne 0 ];then
4747
exit 1
4848
fi
49-
49+
5050
is_shell_attribute_set x
5151
xdebug_setted=$?
5252
if [ $xdebug_setted ] ; then

ci_scripts/ci_start_en.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ echo "PADDLE_WHL=${PADDLE_WHL}"
4242
# 2 build all the Chinese and English docs, and upload them. Controlled with Env BUILD_DOC and UPLOAD_DOC
4343
PREVIEW_URL_PROMPT="ipipe_log_param_preview_url: None"
4444
if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
45-
apt update
46-
apt install -y libpython3.7
45+
apt update
46+
apt install -y libpython3.7
4747
apt --fix-broken install -y libssl1.0
4848
/bin/bash -x ${DIR_PATH}/gendoc.sh
4949
if [ $? -ne 0 ] ; then
5050
exit 1
5151
fi
52-
52+
5353
is_shell_attribute_set x
5454
xdebug_setted=$?
5555
if [ $xdebug_setted ] ; then
@@ -67,7 +67,7 @@ if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
6767
if [ $xdebug_setted ] ; then
6868
set -x
6969
fi
70-
70+
7171
# https://cloud.baidu.com/doc/XLY/s/qjwvy89pc#%E7%B3%BB%E7%BB%9F%E5%8F%82%E6%95%B0%E5%A6%82%E4%B8%8B
7272
# ${AGILE_PIPELINE_ID}-${AGILE_PIPELINE_BUILD_ID}"
7373
if [ "${UPLOAD_DOC}" = "true" ] ; then
@@ -124,7 +124,7 @@ fi
124124
if [ "${need_check_api_py_files}" = "" ] ; then
125125
echo "api python file list is empty, skip check system message in docs"
126126
else
127-
echo 'need check api pyhon file: ', $need_check_api_py_files
127+
echo 'need check api pyhon file: ', $need_check_api_py_files
128128
/bin/bash ${DIR_PATH}/check_api_docs_en.sh ${jsonfn} ${OUTPUTDIR}/en/${VERSIONSTR}/api/ "${need_check_api_py_files}"
129129
if [ $? -ne 0 ]; then
130130
echo 'Docs Style Check is failed, please check the style in the above docs'

ci_scripts/gendoc.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ rm $tmp_fifofile # 清空管道内容
3939

4040
# for循环 往 fifo管道文件中写入$thread个空行
4141
for ((i=0;i<$thread;i++));do
42-
echo
42+
echo
4343
done >&6
4444

4545

@@ -54,7 +54,7 @@ for lang in en zh ; do
5454
if [ "${lang}" = "zh" ] ; then
5555
INDEXFILE="${OUTPUTDIR}/${lang}/${VERSIONSTR}/index_cn.html"
5656
fi
57-
if [ ! -f ${INDEXFILE} ] ; then
57+
if [ ! -f ${INDEXFILE} ] ; then
5858
/usr/local/bin/sphinx-build -b ${OUTPUTFORMAT} -j ${sphinx_thread} -d /var/doctrees -c ${CONFIGDIR}/${lang} ${DOCROOT} ${OUTPUTDIR}/${lang}/${VERSIONSTR}
5959
fi
6060

ci_scripts/hooks/post-doc-compile.sh

-2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ VERSIONSTR=${2}
1919
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
2020

2121
python ${SCRIPT_DIR}/post_filter_htmls.py ${OUTPUTDIR}/en/${VERSIONSTR}/api/
22-
23-

0 commit comments

Comments
 (0)