Skip to content

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

Merged
luotao1 merged 17 commits into
PaddlePaddle:developfrom
cattidea:pre-commit/ci/add-more-info-when-failed
Oct 19, 2022
Merged

luotao1 merged 17 commits into
PaddlePaddle:developfrom
cattidea:pre-commit/ci/add-more-info-when-failed

Conversation

@SigureMo

@SigureMo SigureMo commented Oct 18, 2022 •

Copy link
Copy Markdown
Collaborator

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

paddle-bot Bot commented Oct 18, 2022

Copy link
Copy Markdown

你的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 ""

@SigureMo SigureMo Oct 18, 2022 •

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
Collaborator 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

@luotao1 luotao1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 可以恢复两个修改文件

@SigureMo

Copy link
Copy Markdown
Collaborator 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
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