-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use yapf to format python code, add style config file #422
Conversation
@QiJune 能像https://github.com/baidu/Paddle/blob/develop/cmake/cpplint.cmake 这样做到在make的时候自动检测么? |
@backyes |
@QiJune 多谢解答。 |
是说编译完了,也就自动格式化了么?如果只是在提交前进行格式化处理,会不会出现冲突 |
1 一般的提交pr的流程如下: 2 yapf只是格式化python代码,保证风格统一,与编译过程没有关系,只是在每一次commit之前格式化一下,保证提交上去的python代码风格是一致的 |
@QiJune 能否做成make的时候自动格式化呢? 现在毕竟还是需要用户自己添加git hook。 |
@QiJune 如果可以,也可以单独一个PR再实现make时候自动格式化,确保这个能快速ci,符合今天的会议精神. :-) 。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有一些问题,我再看一下yapf的配置
@@ -0,0 +1,5 @@ | |||
[style] | |||
based_on_style = google |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里还是最好base on pep8吧。
相对于C++来说,python有官方推荐的style,即pep8
* fix opfusion in cuda backends fix typo fix bugs * fix bugs
…addlePaddle#422) * fix pruned model save and load, fix bugs of pruning depthwise conv * add unit test of pruned model save and load * temp delete * add unit test
V100是16G和32G显存,没有40G显存 --------- Co-authored-by: wangguanzhong <[email protected]> Co-authored-by: LokeZhou <[email protected]>
1 use yapf ( https://github.com/google/yapf) to format python code, and add .style.yapf config file #254
2 contributors can add a git hooks to auto-format changed python code just like this