mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-28 21:15:54 +03:00
fix(meta-edit, epf-validate): у внешней обработки/отчёта нет команд объекта и модуля менеджера (#108)
Платформа выбрасывает Command из внешней обработки/отчёта при сборке («не является подчиненным»), а Ext/ManagerModule.bsl — вовсе без сообщения; epf-build при этом сообщает об успехе. Цепочка молча теряла написанное: meta-edit добавлял команду, epf-validate её пропускал. meta-edit: внешние типы внесены в таблицу допустимых детей — команду не добавляет, предупреждает. epf-validate: Command и ManagerModule.bsl — ошибки с пояснением. Refs #108 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
372510bbc4
commit
5d1b5cdf74
@@ -1,4 +1,4 @@
|
||||
# epf-validate v1.6 — Validate 1C external data processor / report structure
|
||||
# epf-validate v1.7 — Validate 1C external data processor / report structure
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
# Works for both EPF (ExternalDataProcessor) and ERF (ExternalReport) — auto-detects
|
||||
[CmdletBinding(PositionalBinding=$false)]
|
||||
@@ -135,7 +135,8 @@ $classIds = @{
|
||||
"ExternalReport" = "e41aff26-25cf-4bb6-b6c1-3f478a75f374"
|
||||
}
|
||||
|
||||
$allowedChildTypes = @("Attribute","TabularSection","Form","Template","Command")
|
||||
# Команд объекта у внешней обработки/отчёта нет: платформа выбрасывает их при сборке (#108).
|
||||
$allowedChildTypes = @("Attribute","TabularSection","Form","Template")
|
||||
|
||||
# Expected order of child types in ChildObjects
|
||||
$childTypeOrder = @{
|
||||
@@ -143,7 +144,6 @@ $childTypeOrder = @{
|
||||
"TabularSection" = 1
|
||||
"Form" = 2
|
||||
"Template" = 3
|
||||
"Command" = 4
|
||||
}
|
||||
|
||||
$validPropertyValues = @{
|
||||
@@ -410,6 +410,11 @@ if ($childObjNode) {
|
||||
if ($child.NodeType -ne 'Element') { continue }
|
||||
$childTag = $child.LocalName
|
||||
|
||||
if ($childTag -eq "Command") {
|
||||
Report-Error "4. ChildObjects: Command — у внешней обработки/отчёта команд объекта нет, платформа выбросит его при сборке"
|
||||
$check4Ok = $false
|
||||
continue
|
||||
}
|
||||
if ($allowedChildTypes -notcontains $childTag) {
|
||||
Report-Error "4. ChildObjects: disallowed element '$childTag'"
|
||||
$check4Ok = $false
|
||||
@@ -424,7 +429,7 @@ if ($childObjNode) {
|
||||
# Check ordering
|
||||
$thisOrder = $childTypeOrder[$childTag]
|
||||
if ($thisOrder -lt $lastOrder -and $orderOk) {
|
||||
Report-Warn "4. ChildObjects: '$childTag' appears after higher-order elements (expected: Attribute, TabularSection, Form, Template, Command)"
|
||||
Report-Warn "4. ChildObjects: '$childTag' appears after higher-order elements (expected: Attribute, TabularSection, Form, Template)"
|
||||
$orderOk = $false
|
||||
}
|
||||
$lastOrder = $thisOrder
|
||||
@@ -665,14 +670,13 @@ if ($script:stopped) { & $finalize; exit 1 }
|
||||
|
||||
$check8Ok = $true
|
||||
|
||||
# Collect all names: attributes + tabular sections + forms + templates + commands
|
||||
# Collect all names: attributes + tabular sections + forms + templates
|
||||
$allNames = @{}
|
||||
|
||||
if ($childObjNode) {
|
||||
$nameKinds = @(
|
||||
@{ XPath = "md:Attribute"; Kind = "Attribute" },
|
||||
@{ XPath = "md:TabularSection"; Kind = "TabularSection" },
|
||||
@{ XPath = "md:Command"; Kind = "Command" }
|
||||
@{ XPath = "md:TabularSection"; Kind = "TabularSection" }
|
||||
)
|
||||
|
||||
foreach ($nk in $nameKinds) {
|
||||
@@ -777,6 +781,13 @@ if (Test-Path $objModule) {
|
||||
$filesChecked++
|
||||
}
|
||||
|
||||
# Модуля менеджера у внешней обработки/отчёта нет: платформа выбрасывает файл без сообщения.
|
||||
$mgrModule = Join-Path (Join-Path $objDir "Ext") "ManagerModule.bsl"
|
||||
if (Test-Path $mgrModule) {
|
||||
Report-Error "9. Ext/ManagerModule.bsl — у внешней обработки/отчёта нет модуля менеджера, платформа выбросит его молча"
|
||||
$check9Ok = $false
|
||||
}
|
||||
|
||||
if ($check9Ok) {
|
||||
if ($filesChecked -gt 0) {
|
||||
Report-OK "9. File existence: $filesChecked files verified"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# epf-validate v1.6 — Validate 1C external data processor / report structure
|
||||
# epf-validate v1.7 — Validate 1C external data processor / report structure
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
# Works for both EPF (ExternalDataProcessor) and ERF (ExternalReport) — auto-detects
|
||||
|
||||
@@ -49,14 +49,14 @@ CLASS_IDS = {
|
||||
"ExternalReport": "e41aff26-25cf-4bb6-b6c1-3f478a75f374",
|
||||
}
|
||||
|
||||
ALLOWED_CHILD_TYPES = {"Attribute", "TabularSection", "Form", "Template", "Command"}
|
||||
# Команд объекта у внешней обработки/отчёта нет: платформа выбрасывает их при сборке (#108).
|
||||
ALLOWED_CHILD_TYPES = {"Attribute", "TabularSection", "Form", "Template"}
|
||||
|
||||
CHILD_TYPE_ORDER = {
|
||||
"Attribute": 0,
|
||||
"TabularSection": 1,
|
||||
"Form": 2,
|
||||
"Template": 3,
|
||||
"Command": 4,
|
||||
}
|
||||
|
||||
|
||||
@@ -381,6 +381,10 @@ def main():
|
||||
continue
|
||||
child_tag = localname(child)
|
||||
|
||||
if child_tag == "Command":
|
||||
report_error("4. ChildObjects: Command — у внешней обработки/отчёта команд объекта нет, платформа выбросит его при сборке")
|
||||
check4_ok = False
|
||||
continue
|
||||
if child_tag not in ALLOWED_CHILD_TYPES:
|
||||
report_error(f"4. ChildObjects: disallowed element '{child_tag}'")
|
||||
check4_ok = False
|
||||
@@ -390,7 +394,7 @@ def main():
|
||||
|
||||
this_order = CHILD_TYPE_ORDER.get(child_tag, -1)
|
||||
if this_order < last_order and order_ok:
|
||||
report_warn(f"4. ChildObjects: '{child_tag}' appears after higher-order elements (expected: Attribute, TabularSection, Form, Template, Command)")
|
||||
report_warn(f"4. ChildObjects: '{child_tag}' appears after higher-order elements (expected: Attribute, TabularSection, Form, Template)")
|
||||
order_ok = False
|
||||
last_order = this_order
|
||||
|
||||
@@ -597,7 +601,6 @@ def main():
|
||||
name_kinds = [
|
||||
("Attribute", f"{{{MD_NS}}}Attribute"),
|
||||
("TabularSection", f"{{{MD_NS}}}TabularSection"),
|
||||
("Command", f"{{{MD_NS}}}Command"),
|
||||
]
|
||||
|
||||
for kind, xpath in name_kinds:
|
||||
@@ -678,6 +681,12 @@ def main():
|
||||
if os.path.isfile(obj_module):
|
||||
files_checked += 1
|
||||
|
||||
# Модуля менеджера у внешней обработки/отчёта нет: платформа выбрасывает файл без сообщения.
|
||||
mgr_module = os.path.join(obj_dir, "Ext", "ManagerModule.bsl")
|
||||
if os.path.isfile(mgr_module):
|
||||
report_error("9. Ext/ManagerModule.bsl — у внешней обработки/отчёта нет модуля менеджера, платформа выбросит его молча")
|
||||
check9_ok = False
|
||||
|
||||
if check9_ok:
|
||||
if files_checked > 0:
|
||||
report_ok(f"9. File existence: {files_checked} files verified")
|
||||
|
||||
Reference in New Issue
Block a user