Skip to content

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Sep 22, 2022

PR types

Others

PR changes

Others

Describe

对错误的 yapf: disable 进行调整

yapf 会停止单行 # yapf: disable 到单行 # yapf: enable 之间的格式化,一些文件使用了这种方式但却没有重新 enable,因此很多没必要 disable 的都被 disable 了

此外,yapf 支持行内使用 # yapf: disable 来禁用某一个字面量的格式化,可以通过这种方式避免大面积被 disable 掉

参考:https://github.com/google/yapf#why-does-yapf-destroy-my-awesome-formatting

@paddle-bot
Copy link

paddle-bot bot commented Sep 22, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Sep 22, 2022
@@ -653,10 +652,19 @@ def to_safe_name(s):
('test_2d_input2', rand_x(2, np.float64, shape=[8, 150]), 50, 15, -1),
('test_3d_input1', rand_x(3, np.float64, shape=[150, 4, 2]), 50, 15, 0),
('test_3d_input2', rand_x(3, np.float64, shape=[4, 2, 150]), 50, 15, -1),
])
]) # yapf: disable
Copy link
Member Author

@SigureMo SigureMo Sep 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件使用第二种方式,仅在 test case 参数部分取消格式化,避免格式化后的参数看起来非常凌乱的问题

@SigureMo SigureMo changed the title [CodeStyle] adjust yapf: disable [CodeStyle] remove some yapf: disable Sep 22, 2022
@luotao1 luotao1 self-assigned this Sep 22, 2022
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit 842325d into PaddlePaddle:develop Sep 23, 2022
@SigureMo SigureMo deleted the yapf/fix/disabled branch September 23, 2022 09:44
umiswing pushed a commit to umiswing/Paddle that referenced this pull request Sep 28, 2022
* remove `yapf: disable` from math.py

* disable test case only

* remove useless disable

* remove useless disable

* revert no_grad_set_white_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants