fix(cfe-validate): remove false DataPath/TitleDataPath check from Check 11

Configurator stores DataPath inside <BaseForm> as original form snapshot —
this is normal behavior, not an error. Removes false WARN on
Configurator-exported extensions like JR2433.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-10 21:00:20 +03:00
parent e7e6c885c7
commit 8584021446
3 changed files with 1 additions and 20 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ powershell.exe -NoProfile -File .claude/skills/cfe-validate/scripts/cfe-validate
| 8 | Каталоги объектов существуют | WARN |
| 9 | Заимствованные объекты: ObjectBelonging=Adopted, ExtendedConfigurationObject UUID | ERROR/WARN |
| 10 | Sub-items: Attribute, TabularSection (InternalInfo + вложенные), EnumValue, Form-ссылки | ERROR |
| 11 | Заимствованные формы: метаданные, Form.xml, Module.bsl, BaseForm (DataPath, TitleDataPath) | ERROR/WARN |
| 11 | Заимствованные формы: метаданные, Form.xml, Module.bsl, BaseForm version | ERROR/WARN |
| 12 | Зависимости форм: CommonPicture, StyleItem (с whitelist платформенных), Enum DesignTimeRef | WARN |
| 13 | TypeLink: human-readable Items.* DataPath (должны быть удалены) | WARN |
@@ -801,17 +801,6 @@ foreach ($fi in $script:formList) {
if ($formRawText -notmatch '<BaseForm[^>]+version=') {
Report-Warn "11. ${ctx}: <BaseForm> missing version attribute"
}
# Extract BaseForm content for DataPath/TitleDataPath checks (only inside BaseForm, not in extension elements)
$bfMatch = [regex]::Match($formRawText, '(?s)<BaseForm[^>]*>(.+)</BaseForm>')
if ($bfMatch.Success) {
$bfContent = $bfMatch.Groups[1].Value
if ($bfContent -match '<DataPath>[^<]+</DataPath>') {
Report-Warn "11. ${ctx}: <DataPath> found in BaseForm (should be stripped for borrowed forms)"
}
if ($bfContent -match '<TitleDataPath>[^<]+</TitleDataPath>') {
Report-Warn "11. ${ctx}: <TitleDataPath> found in BaseForm (should be stripped)"
}
}
$script:borrowedFormsWithTree += @{
Path = $formXmlFile; RawText = $formRawText; Context = $ctx
@@ -764,14 +764,6 @@ def main():
if '<BaseForm' in form_raw_text:
if not re.search(r'<BaseForm[^>]+version=', form_raw_text):
r.warn(f'11. {ctx}: <BaseForm> missing version attribute')
# Check DataPath/TitleDataPath only inside BaseForm (not in extension-added elements)
bf_match = re.search(r'(?s)<BaseForm[^>]*>(.+)</BaseForm>', form_raw_text)
if bf_match:
bf_content = bf_match.group(1)
if re.search(r'<DataPath>[^<]+</DataPath>', bf_content):
r.warn(f'11. {ctx}: <DataPath> found in BaseForm (should be stripped for borrowed forms)')
if re.search(r'<TitleDataPath>[^<]+</TitleDataPath>', bf_content):
r.warn(f'11. {ctx}: <TitleDataPath> found in BaseForm (should be stripped)')
borrowed_forms_with_tree.append({
'Path': form_xml_file, 'RawText': form_raw_text, 'Context': ctx,
})