mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-06 11:40:20 +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,10 +1,11 @@
|
||||
# mxl-validate v1.0 — Validate 1C spreadsheet
|
||||
# mxl-validate v1.1 — Validate 1C spreadsheet
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$TemplatePath,
|
||||
[string]$ProcessorName,
|
||||
[string]$TemplateName,
|
||||
[string]$SrcDir = "src",
|
||||
[switch]$Detailed,
|
||||
[int]$MaxErrors = 20
|
||||
)
|
||||
|
||||
@@ -44,10 +45,12 @@ $root = $xmlDoc.DocumentElement
|
||||
$errors = 0
|
||||
$warnings = 0
|
||||
$stopped = $false
|
||||
$script:okCount = 0
|
||||
|
||||
function Report-OK {
|
||||
param([string]$msg)
|
||||
Write-Host "[OK] $msg"
|
||||
$script:okCount++
|
||||
if ($Detailed) { Write-Host "[OK] $msg" }
|
||||
}
|
||||
|
||||
function Report-Error {
|
||||
@@ -66,8 +69,10 @@ function Report-Warn {
|
||||
}
|
||||
|
||||
$templateName = [System.IO.Path]::GetFileName([System.IO.Path]::GetDirectoryName([System.IO.Path]::GetDirectoryName($TemplatePath)))
|
||||
Write-Host "=== Validation: $templateName ==="
|
||||
Write-Host ""
|
||||
if ($Detailed) {
|
||||
Write-Host "=== Validation: $templateName ==="
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# --- Collect palettes ---
|
||||
|
||||
@@ -376,18 +381,18 @@ foreach ($drawing in $root.SelectNodes("d:drawing", $nsMgr)) {
|
||||
|
||||
# --- Summary ---
|
||||
|
||||
# :finish label equivalent
|
||||
Write-Host ""
|
||||
Write-Host "---"
|
||||
$checks = $script:okCount + $errors + $warnings
|
||||
|
||||
if ($stopped) {
|
||||
Write-Host "Stopped after $MaxErrors errors. Fix and re-run."
|
||||
}
|
||||
|
||||
if ($errors -eq 0 -and $warnings -eq 0) {
|
||||
Write-Host "All checks passed."
|
||||
if ($errors -eq 0 -and $warnings -eq 0 -and -not $Detailed) {
|
||||
Write-Host "=== Validation OK: Template.$templateName ($checks checks) ==="
|
||||
} else {
|
||||
Write-Host "Errors: $errors, Warnings: $warnings"
|
||||
Write-Host ""
|
||||
|
||||
if ($stopped) {
|
||||
Write-Host "Stopped after $MaxErrors errors. Fix and re-run."
|
||||
}
|
||||
|
||||
Write-Host "=== Result: $errors errors, $warnings warnings ($checks checks) ==="
|
||||
}
|
||||
|
||||
if ($errors -gt 0) {
|
||||
|
||||
Reference in New Issue
Block a user