Skip to content
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

CI: Site Variable Scanner #1461

Closed
wants to merge 7 commits into from

Conversation

AmosHuKe
Copy link
Member

@AmosHuKe AmosHuKe commented Jun 26, 2024

Important

该 CI 处于试验阶段

用于扫描指定的文档,检查是否存在可用站点变量替换的文本。

类似检查 PR flutter/website#9894 这样的内容

工具

YAML Variable Scanner:AmosHuKe/yaml_variable_scanner
工具的配置:/tool/config/yaml_variable_scanner.yaml

扫描检查本质上就是对纯文本的匹配,不存在语法渲染,
例如:不会渲染 Liquid 变量的使用(类似 {{ xxx }})。
只要文件(md、html...)内容存在 {{ xxx }} 变量使用方式的文本,就可以进行匹配。

运行

$ dart run flutter_site check-site-variable

该指令共有 4 个 --print-mode 模式:

$ dart run flutter_site check-site-variable --help

Scan multiple files for text that can use site variables.

Usage: flutter_site check-site-variable [arguments]
-h, --help                      Print this usage information.
    --print-mode                Configure the amount of information output.

          [detail] (default)    Detail to file lines and columns.
          [detailAndStats]      detail & stats.
          [none]                No content.
          [stats]               Total statistics.

检查效果

报错效果:cfug/flutter.cn/actions/runs/9679118603/job/26704397987?pr=1461#step:5:1
image

正确效果:cfug/flutter.cn/actions/runs/9679430838/job/26705403034?pr=1461#step:5:1
image

@AmosHuKe AmosHuKe requested a review from a team as a code owner June 26, 2024 11:40
@AmosHuKe AmosHuKe marked this pull request as draft June 26, 2024 11:40
@AmosHuKe AmosHuKe marked this pull request as ready for review June 26, 2024 12:46
@AmosHuKe AmosHuKe changed the title [🚧WIP] CI: Site Variable Scanner CI: Site Variable Scanner Jun 26, 2024
@AmosHuKe AmosHuKe force-pushed the ci-site-variable-scanner branch from fbd91f8 to a93cc8c Compare July 13, 2024 03:51
@AmosHuKe AmosHuKe closed this Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant