fix(skd-info): убрать лишний пробел в 'Templates: N defined ( bindings)'

При схеме без field- и group-привязок строка вывода Templates выглядела
как 'Templates: 4 defined ( bindings)' — пустой блок с одиноким пробелом
перед 'bindings)'. Теперь, когда привязок нет, скобки опускаются:
'Templates: 4 defined'.

Версия v1.3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-04-25 18:32:47 +03:00
parent 576f6dda8a
commit a932841418
2 changed files with 11 additions and 4 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
# skd-info v1.2 — Analyze 1C DCS structure
# skd-info v1.3 — Analyze 1C DCS structure
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[Parameter(Mandatory=$true)]
@@ -446,7 +446,11 @@ function Show-Overview {
if ($fieldTpls.Count -gt 0) { $parts += "$($fieldTpls.Count) field" }
$grpCount = $groupTpls.Count + $groupHeaderTpls.Count + $groupFooterTpls.Count
if ($grpCount -gt 0) { $parts += "$grpCount group" }
$lines.Add("Templates: $($tplDefs.Count) defined ($($parts -join ', ') bindings)")
if ($parts.Count -gt 0) {
$lines.Add("Templates: $($tplDefs.Count) defined ($($parts -join ', ') bindings)")
} else {
$lines.Add("Templates: $($tplDefs.Count) defined")
}
}
# Parameters — split visible/hidden
+5 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# skd-info v1.2 — Analyze 1C DCS structure
# skd-info v1.3 — Analyze 1C DCS structure
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
@@ -453,7 +453,10 @@ def main():
grp_count = len(group_tpls) + len(group_header_tpls) + len(group_footer_tpls)
if grp_count > 0:
parts.append(f"{grp_count} group")
lines.append(f"Templates: {len(tpl_defs)} defined ({', '.join(parts)} bindings)")
if parts:
lines.append(f"Templates: {len(tpl_defs)} defined ({', '.join(parts)} bindings)")
else:
lines.append(f"Templates: {len(tpl_defs)} defined")
# Parameters -- split visible/hidden
params = root.findall("s:parameter", NSMAP)