Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[CodeStyle] add more information when codestyle check failed #47116

Merged

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Oct 18, 2022

PR types

Others

PR changes

Others

Describe

详情见 #46808 (comment)

为 codestyle check 失败时添加更多的提示信息,包括:

  • 如何安装 pre-commit 并注册 hook
  • 如何在本地检查整个 PR 出现的问题(同 CI 行为一致)
  • Codestyle check guide 文档链接

除去 tools/codestyle/pre_commit.sh 的改动都是用来测试的,将会在之后恢复

@paddle-bot
Copy link

paddle-bot bot commented Oct 18, 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 Oct 18, 2022
echo "Then, run pre-commit to check codestyle issues in your PR:"
echo ""
echo " pre-commit run --files" $(echo ${diff_files[*]} | tr "\n" " ")
echo ""
Copy link
Member Author

@SigureMo SigureMo Oct 18, 2022

Choose a reason for hiding this comment

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

仅仅提示安装命令只能保证新的 commit 可以通过,而不能保证 PR 里之前的 commit 通过,因此这里命令用于提示如何复现这个 PR 里的全部问题

image

这里提示的命令与 37 行一致,以保证本地可以复现/自动修复 CI 上的相关问题

为避免一些较大的 PR(如一些全量替换)时这里命令长度过长导致难以注意到有效的信息,仅仅会在修改文件数量小于等于 100 时提示本信息

Copy link
Member Author

Choose a reason for hiding this comment

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

其余两个文件目前只是用于触发 pre-commit 测试效果,如果没有问题就可以直接恢复了

@SigureMo SigureMo changed the title [WIP][CodeStyle] add more information when codestyle check failed [CodeStyle] add more information when codestyle check failed Oct 18, 2022
luotao1
luotao1 previously approved these changes Oct 19, 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 可以恢复两个修改文件

@SigureMo
Copy link
Member Author

LGTM 可以恢复两个修改文件

已恢复~

@luotao1 luotao1 merged commit 065608d into PaddlePaddle:develop Oct 19, 2022
@SigureMo SigureMo deleted the pre-commit/ci/add-more-info-when-failed branch October 19, 2022 06:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants