fix(guards): presenter 依赖表检查覆盖 [dependencies.slint] 子表写法(M89 复审 p2-1)
原判据要求表头是 `[dependencies]`,`[dependencies.slint]` / `[target.'cfg(windows)'.dependencies.slint]` 这类合法子表既不匹配、表头又被 next 吃掉,整段内容完全不查。配合「子表 + optional + 非默认 feature」可让依赖表与 cargo tree 两步同时绿。 - 表头正则加 `(\.[^]]*)?`,并把带子表后缀的表头本身纳入检查(表头携带包名)。 - 实测:基线绿;`[dependencies.slint]` 红;子表+optional+feature 红;target.* 变体红; `[dependencies.serde_json]` 不误报(仍绿)。
This commit is contained in:
1 parent
56bc52756b
commit
48061c3f31
1 file changed
+5
-1
@@ -62,9 +62,13 @@ jobs:
|
||||
# 与 core-no-ui 的整文件 grep 不同:本 crate 的 description 合法地写着
|
||||
# 「Slint 版与 iced 版共用」,整文件 grep 会把它当越线。所以先按表头切出依赖表
|
||||
# (含 target.*.dependencies 与 dev/build 表),再去掉注释行,只查键名。
|
||||
# 子表写法 `[dependencies.slint]` / `[target.'cfg(windows)'.dependencies.slint]`
|
||||
# 是合法的等长写法,且表头本身带着包名,所以表头也要一并落进检查范围——
|
||||
# 否则「子表 + optional + 非默认 feature」这种组合能同时骗过依赖表与 cargo tree。
|
||||
awk '
|
||||
/^[[:space:]]*\[/ {
|
||||
in_deps = ($0 ~ /^[[:space:]]*\[(target\..*\.)?(dependencies|dev-dependencies|build-dependencies)\][[:space:]]*$/)
|
||||
in_deps = ($0 ~ /^[[:space:]]*\[(target\..*\.)?(dependencies|dev-dependencies|build-dependencies)(\.[^]]*)?\][[:space:]]*$/)
|
||||
if (in_deps && $0 ~ /\.[^]]*\]/) printf "%d:%s\n", NR, $0
|
||||
next
|
||||
}
|
||||
in_deps && !/^[[:space:]]*#/ && !/^[[:space:]]*$/ { printf "%d:%s\n", NR, $0 }
|
||||
|
||||
Reference in new issue
Block a user