Skip to content

[CI] refine check_api_label_cn #7256

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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

ooooo-create
Copy link
Collaborator

@ooooo-create ooooo-create commented Apr 12, 2025

  • use Path to deal with file path
  • add precompile regex patterns
  • api_label 引用的检查新增存量的 api 目录,避免删除 api 时,遗漏引用
  • 先收集错误,再集中报错

Copy link

paddle-bot bot commented Apr 12, 2025

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7256.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • ci_scripts/check_api_label_cn.sh: Language not supported

@ooooo-create ooooo-create requested a review from Copilot April 12, 2025 14:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • ci_scripts/check_api_label_cn.sh: Language not supported

@PaddlePaddle PaddlePaddle deleted a comment from Copilot AI Apr 12, 2025
@PaddlePaddle PaddlePaddle deleted a comment from Copilot AI Apr 12, 2025
@ooooo-create ooooo-create requested a review from Copilot April 12, 2025 14:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • ci_scripts/check_api_label_cn.sh: Language not supported
Comments suppressed due to low confidence (1)

ci_scripts/check_api_label_cn.py:170

  • [nitpick] The variable name 'API' is ambiguous; consider renaming it to a more descriptive name such as 'relative_api_path' to clarify its purpose.
API = args.doc_root.removesuffix(args.api_root)

@ooooo-create ooooo-create requested a review from Copilot April 12, 2025 14:15
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • ci_scripts/check_api_label_cn.sh: Language not supported
Comments suppressed due to low confidence (2)

ci_scripts/check_api_label_cn.py:170

  • [nitpick] The variable 'API' is not self-explanatory; consider renaming it to something more descriptive, such as 'api_subpath', to clarify its purpose.
API = args.doc_root.removesuffix(args.api_root)

ci_scripts/check_api_label_cn.py:56

  • [nitpick] Consider using a consistent type for 'file_path' (either Path or str) to reduce type handling complexity and improve clarity.
def find_api_labels_in_file(file_path: Path | str) -> list[str]:

@ooooo-create ooooo-create changed the title refine check_api_label_cn [CI] refine check_api_label_cn Apr 12, 2025
@ooooo-create ooooo-create requested a review from Copilot April 12, 2025 15:14
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • ci_scripts/check_api_label_cn.sh: Language not supported

@ooooo-create ooooo-create requested a review from Copilot April 13, 2025 06:04
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • ci_scripts/check_api_label_cn.sh: Language not supported
Comments suppressed due to low confidence (1)

ci_scripts/check_api_label_cn.py:86

  • [nitpick] Consider renaming the loop variable 'file' to a more descriptive name (e.g., 'doc_file') to avoid shadowing the built-in 'file' identifier.
for file in files:

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants