mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-26 14:41:02 +03:00
fix: resolve FINDINGS — synonyms, path resolution, exit codes
Skill fixes (all ps1+py, version bumped to v1.1): - role-compile: accept "rights" as synonym for "objects" - subsystem-compile: accept "objects" as synonym for "content" - form-add: resolve directory path to .xml (like meta-validate) - form-info: resolve directory path to Ext/Form.xml (like form-validate) - mxl-compile: support absolute OutputPath (IsPathRooted check) - meta-remove: exit 1 when object not found; v1.1 - cfe-patch-method: accept plural type names (Catalogs → Catalog) Test fixes: - basic-role.json: use canonical "objects" key - basic.json (subsystem): use canonical "content" key - catalog-form.json: fix outdated DSL format - New synonym test cases for role-compile and subsystem-compile - error-not-found.json: expect error (exit 1) 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
4551525718
commit
250978c2fd
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# meta-remove v1.0 — Remove metadata object from 1C configuration dump
|
||||
# meta-remove v1.1 — Remove metadata object from 1C configuration dump
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import argparse
|
||||
@@ -163,6 +163,19 @@ def main():
|
||||
has_dir = os.path.isdir(obj_dir)
|
||||
|
||||
if not has_xml and not has_dir:
|
||||
# Check if registered in Configuration.xml before proceeding
|
||||
cfg_check_tree = etree.parse(config_xml, etree.XMLParser(remove_blank_text=False))
|
||||
cfg_check_root = cfg_check_tree.getroot()
|
||||
child_objects = cfg_check_root.find(f"{{{MD_NS}}}Configuration/{{{MD_NS}}}ChildObjects")
|
||||
registered_in_cfg = False
|
||||
if child_objects is not None:
|
||||
for child in child_objects:
|
||||
if isinstance(child.tag, str) and etree.QName(child.tag).localname == obj_type and (child.text or "").strip() == obj_name:
|
||||
registered_in_cfg = True
|
||||
break
|
||||
if not registered_in_cfg:
|
||||
print(f"[ERROR] Object not found: {type_plural}/{obj_name}.xml and not registered in Configuration.xml")
|
||||
sys.exit(1)
|
||||
print(f"[WARN] Object files not found: {type_plural}/{obj_name}.xml")
|
||||
print(" Proceeding with deregistration only...")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user