mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-15 23:35:17 +03:00
fix(form-validate): add ExternalDataProcessorObject/ExternalReportObject to valid cfg prefixes
Check 12 was flagging cfg:ExternalDataProcessorObject.X as "unrecognized cfg prefix", but this is a valid XDTO type for external data processor (EPF) forms. Found via snapshot verification against epf-add-form snapshots. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-validate v1.2 — Validate 1C managed form
|
||||
# form-validate v1.3 — Validate 1C managed form
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import argparse
|
||||
@@ -43,6 +43,7 @@ VALID_CFG_PREFIXES = {
|
||||
'ChartOfCharacteristicTypesObject', 'ChartOfCharacteristicTypesRef',
|
||||
'ConstantsSet', 'DataProcessorObject', 'DocumentObject', 'DocumentRef',
|
||||
'DynamicList', 'EnumRef', 'ExchangePlanObject', 'ExchangePlanRef',
|
||||
'ExternalDataProcessorObject', 'ExternalReportObject',
|
||||
'InformationRegisterRecordManager', 'InformationRegisterRecordSet',
|
||||
'ReportObject', 'TaskObject', 'TaskRef',
|
||||
}
|
||||
@@ -103,6 +104,18 @@ def main():
|
||||
|
||||
root = tree.getroot()
|
||||
|
||||
# Detect context: config vs EPF/ERF
|
||||
is_config_context = False
|
||||
walk_dir = os.path.dirname(os.path.abspath(form_path))
|
||||
for _ in range(15):
|
||||
parent = os.path.dirname(walk_dir)
|
||||
if parent == walk_dir:
|
||||
break
|
||||
if os.path.isfile(os.path.join(walk_dir, 'Configuration.xml')):
|
||||
is_config_context = True
|
||||
break
|
||||
walk_dir = parent
|
||||
|
||||
errors = 0
|
||||
warnings = 0
|
||||
ok_count = 0
|
||||
@@ -645,7 +658,10 @@ def main():
|
||||
suffix = tv[4:] # after "cfg:"
|
||||
prefix = suffix.split(".")[0]
|
||||
if prefix in VALID_CFG_PREFIXES or suffix == "DynamicList":
|
||||
pass # OK
|
||||
# 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
|
||||
else:
|
||||
report_warn(f'12. Type "{tv}": unrecognized cfg prefix')
|
||||
type_warn_count += 1
|
||||
|
||||
Reference in New Issue
Block a user