From d5aacc9e6036fa7f0a4a9c65aa69972eb2079c98 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 5 Apr 2026 20:01:24 +0300 Subject: [PATCH] =?UTF-8?q?fix(form-validate):=20context-aware=20Check=201?= =?UTF-8?q?2=20=E2=80=94=20ExternalDataProcessorObject=20is=20error=20in?= =?UTF-8?q?=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detect config vs EPF context by walking up from FormPath looking for Configuration.xml. ExternalDataProcessorObject/ExternalReportObject are valid in EPF/ERF but cause XDTO exception in configuration context. - EPF forms: no warning (ExternalDataProcessorObject is correct) - Config forms: ERROR with hint to use DataProcessorObject/ReportObject - Fix test DSLs: compiled-form, table-form used wrong External* type Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude/skills/form-validate/scripts/form-validate.ps1 | 4 ++-- .claude/skills/form-validate/scripts/form-validate.py | 4 ++-- tests/skills/cases/form-validate/compiled-form.json | 2 +- .../DataProcessors/Валидация/Forms/Форма/Ext/Form.xml | 2 +- .../DataProcessors/ВалТабл/Forms/Форма/Ext/Form.xml | 2 +- tests/skills/cases/form-validate/table-form.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.claude/skills/form-validate/scripts/form-validate.ps1 b/.claude/skills/form-validate/scripts/form-validate.ps1 index d66ffcfc..c53a60ae 100644 --- a/.claude/skills/form-validate/scripts/form-validate.ps1 +++ b/.claude/skills/form-validate/scripts/form-validate.ps1 @@ -738,8 +738,8 @@ if (-not $stopped) { if ($pfx -in $validCfgPrefixes) { # ExternalDataProcessorObject/ExternalReportObject valid only for EPF/ERF, not config if ($script:isConfigContext -and ($pfx -eq "ExternalDataProcessorObject" -or $pfx -eq "ExternalReportObject")) { - Report-Warn "12. Type '$tv': External* type in configuration context (use DataProcessorObject/ReportObject instead)" - $typeOk = $false + Report-Error "12. Type '$tv': External* type in configuration context (use DataProcessorObject/ReportObject instead)" + $typeOk = $false; $typeInvalid++ } continue } diff --git a/.claude/skills/form-validate/scripts/form-validate.py b/.claude/skills/form-validate/scripts/form-validate.py index 0234ed30..91dac95b 100644 --- a/.claude/skills/form-validate/scripts/form-validate.py +++ b/.claude/skills/form-validate/scripts/form-validate.py @@ -660,8 +660,8 @@ def main(): if prefix in VALID_CFG_PREFIXES or suffix == "DynamicList": # ExternalDataProcessorObject/ExternalReportObject valid only in EPF/ERF context if is_config_context and prefix in ('ExternalDataProcessorObject', 'ExternalReportObject'): - report_warn(f'12. Type "{tv}": External* type in configuration context (use DataProcessorObject/ReportObject instead)') - type_warn_count += 1 + report_error(f'12. Type "{tv}": External* type in configuration context (use DataProcessorObject/ReportObject instead)') + type_invalid += 1 else: report_warn(f'12. Type "{tv}": unrecognized cfg prefix') type_warn_count += 1 diff --git a/tests/skills/cases/form-validate/compiled-form.json b/tests/skills/cases/form-validate/compiled-form.json index 6748d142..ab8faa7e 100644 --- a/tests/skills/cases/form-validate/compiled-form.json +++ b/tests/skills/cases/form-validate/compiled-form.json @@ -23,7 +23,7 @@ { "button": "Выполнить", "command": "Выполнить" } ], "attributes": [ - { "name": "Объект", "type": "ExternalDataProcessorObject.Валидация", "main": true }, + { "name": "Объект", "type": "DataProcessorObject.Валидация", "main": true }, { "name": "Поле1", "type": "string" }, { "name": "Поле2", "type": "decimal(15,2)" }, { "name": "Флаг", "type": "boolean" } diff --git a/tests/skills/cases/form-validate/snapshots/compiled-form/DataProcessors/Валидация/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-validate/snapshots/compiled-form/DataProcessors/Валидация/Forms/Форма/Ext/Form.xml index 703d3d86..c9f03296 100644 --- a/tests/skills/cases/form-validate/snapshots/compiled-form/DataProcessors/Валидация/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-validate/snapshots/compiled-form/DataProcessors/Валидация/Forms/Форма/Ext/Form.xml @@ -40,7 +40,7 @@ - cfg:ExternalDataProcessorObject.Валидация + cfg:DataProcessorObject.Валидация true diff --git a/tests/skills/cases/form-validate/snapshots/table-form/DataProcessors/ВалТабл/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-validate/snapshots/table-form/DataProcessors/ВалТабл/Forms/Форма/Ext/Form.xml index 0cd33ce3..573e505f 100644 --- a/tests/skills/cases/form-validate/snapshots/table-form/DataProcessors/ВалТабл/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-validate/snapshots/table-form/DataProcessors/ВалТабл/Forms/Форма/Ext/Form.xml @@ -35,7 +35,7 @@ - cfg:ExternalDataProcessorObject.ВалТабл + cfg:DataProcessorObject.ВалТабл true diff --git a/tests/skills/cases/form-validate/table-form.json b/tests/skills/cases/form-validate/table-form.json index e650e9c8..ef0655de 100644 --- a/tests/skills/cases/form-validate/table-form.json +++ b/tests/skills/cases/form-validate/table-form.json @@ -21,7 +21,7 @@ ]} ], "attributes": [ - { "name": "Объект", "type": "ExternalDataProcessorObject.ВалТабл", "main": true }, + { "name": "Объект", "type": "DataProcessorObject.ВалТабл", "main": true }, { "name": "Данные", "type": "ValueTable", "columns": [ { "name": "Наименование", "type": "string(150)" }, { "name": "Количество", "type": "decimal(10,3)" }