mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-21 12:11:02 +03:00
fix(subsystem): normalize content refs — plural/Russian to singular English
subsystem-compile and subsystem-edit now auto-normalize content type prefixes (Catalogs→Catalog, Справочник→Catalog, Справочники→Catalog). subsystem-validate detects plural forms as errors in check #6. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
ffc34904c5
commit
9620c3846a
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# subsystem-validate v1.1 — Validate 1C subsystem XML structure
|
||||
# subsystem-validate v1.2 — Validate 1C subsystem XML structure
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
"""Validates subsystem XML file structure, properties, content items, child objects."""
|
||||
import sys, os, argparse, re
|
||||
@@ -20,6 +20,18 @@ IDENT_PATTERN = re.compile(
|
||||
r'[A-Za-z0-9\u0410-\u042F\u0401\u0430-\u044F\u0451_]*$'
|
||||
)
|
||||
|
||||
KNOWN_PLURAL_TYPES = {
|
||||
'Catalogs', 'Documents', 'Enums', 'Constants', 'Reports', 'DataProcessors',
|
||||
'InformationRegisters', 'AccumulationRegisters', 'AccountingRegisters', 'CalculationRegisters',
|
||||
'ChartsOfAccounts', 'ChartsOfCharacteristicTypes', 'ChartsOfCalculationTypes',
|
||||
'BusinessProcesses', 'Tasks', 'ExchangePlans', 'DocumentJournals',
|
||||
'CommonModules', 'CommonCommands', 'CommonForms', 'CommonPictures', 'CommonTemplates',
|
||||
'CommonAttributes', 'CommandGroups', 'Roles', 'SessionParameters', 'FilterCriteria',
|
||||
'XDTOPackages', 'WebServices', 'HTTPServices', 'WSReferences', 'EventSubscriptions',
|
||||
'ScheduledJobs', 'SettingsStorages', 'FunctionalOptions', 'FunctionalOptionsParameters',
|
||||
'DefinedTypes', 'DocumentNumerators', 'Sequences', 'Subsystems', 'StyleItems', 'IntegrationServices',
|
||||
}
|
||||
|
||||
|
||||
class Reporter:
|
||||
def __init__(self, max_errors, detailed=False):
|
||||
@@ -234,6 +246,10 @@ def main():
|
||||
if not re.match(r'^[A-Za-z]+\..+$', text) and not GUID_PATTERN.match(text):
|
||||
r.error(f'6. Content item "{text}": invalid format (expected Type.Name or UUID)')
|
||||
content_ok = False
|
||||
m = re.match(r'^([A-Za-z]+)\.', text)
|
||||
if m and m.group(1) in KNOWN_PLURAL_TYPES:
|
||||
r.error(f'6. Content item "{text}": uses plural form "{m.group(1)}" (platform requires singular, e.g. Catalog not Catalogs)')
|
||||
content_ok = False
|
||||
if content_ok:
|
||||
r.ok(f'6. Content: {len(xr_items)} items, all valid MDObjectRef format')
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user