mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-30 16:36:56 +03:00
feat(validate): brief output by default, -Detailed for verbose
All 10 validation skills (meta, epf, skd, cf, cfe, form, mxl, role, subsystem, interface) now output a single summary line on success: === Validation OK: Type.Name (N checks) === Errors/warnings always shown. Full per-check [OK] output behind -Detailed flag. Removed all N/A check lines. Unified role-validate output format. Trimmed SKILL.md files from 42-119 to 51-67 lines. Version bumps: meta-validate v1.2, all others v1.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
93e4130ff2
commit
422e397381
@@ -1,4 +1,4 @@
|
||||
# skd-validate v1.0 — Validate 1C DCS structure (Python port)
|
||||
# skd-validate v1.1 — Validate 1C DCS structure (Python port)
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import os
|
||||
@@ -13,11 +13,13 @@ sys.stderr.reconfigure(encoding="utf-8")
|
||||
|
||||
parser = argparse.ArgumentParser(allow_abbrev=False)
|
||||
parser.add_argument("-TemplatePath", required=True)
|
||||
parser.add_argument("-Detailed", action="store_true")
|
||||
parser.add_argument("-MaxErrors", type=int, default=20)
|
||||
parser.add_argument("-OutFile", default="")
|
||||
args = parser.parse_args()
|
||||
|
||||
template_path = args.TemplatePath
|
||||
detailed = args.Detailed
|
||||
max_errors = args.MaxErrors
|
||||
out_file = args.OutFile
|
||||
|
||||
@@ -39,6 +41,7 @@ file_name = os.path.basename(resolved_path)
|
||||
|
||||
errors = 0
|
||||
warnings = 0
|
||||
ok_count = 0
|
||||
stopped = False
|
||||
output_lines = []
|
||||
|
||||
@@ -48,7 +51,10 @@ def out_line(msg):
|
||||
|
||||
|
||||
def report_ok(msg):
|
||||
out_line(f"[OK] {msg}")
|
||||
global ok_count
|
||||
ok_count += 1
|
||||
if detailed:
|
||||
out_line(f"[OK] {msg}")
|
||||
|
||||
|
||||
def report_error(msg):
|
||||
@@ -66,9 +72,13 @@ def report_warn(msg):
|
||||
|
||||
|
||||
def finalize():
|
||||
out_line("")
|
||||
out_line(f"=== Result: {errors} errors, {warnings} warnings ===")
|
||||
result = "\n".join(output_lines)
|
||||
checks = ok_count + errors + warnings
|
||||
if errors == 0 and warnings == 0 and not detailed:
|
||||
result = f"=== Validation OK: {file_name} ({checks} checks) ==="
|
||||
else:
|
||||
out_line("")
|
||||
out_line(f"=== Result: {errors} errors, {warnings} warnings ({checks} checks) ===")
|
||||
result = "\n".join(output_lines)
|
||||
print(result)
|
||||
if out_file:
|
||||
with open(out_file, "w", encoding="utf-8-sig") as f:
|
||||
|
||||
Reference in New Issue
Block a user