Improve /scripts/* with libraries, testing tools, and documentation #13
@@ -225,10 +225,12 @@ Runs all validation scripts and provides a comprehensive report:
|
||||
- Executes all optional validation checks
|
||||
- Provides colored output with pass/fail indicators
|
||||
- Returns summary with counts
|
||||
- Supports verbose mode for detailed output
|
||||
|
||||
Usage:
|
||||
```bash
|
||||
./scripts/run/validate_all.sh
|
||||
./scripts/run/validate_all.sh # Standard mode
|
||||
./scripts/run/validate_all.sh -v # Verbose mode (shows all output)
|
||||
```
|
||||
|
||||
Example output:
|
||||
@@ -243,7 +245,7 @@ INFO: Running all validation checks...
|
||||
=== Optional Checks ===
|
||||
[SUCCESS] ✓ no_secrets
|
||||
[SUCCESS] ✓ php_syntax
|
||||
WARN: ✗ tabs (warnings/issues found)
|
||||
WARN: ✗ tabs (warnings/issues found - run with -v for details)
|
||||
|
||||
=== Validation Summary ===
|
||||
Required checks passed: 2/2
|
||||
|
||||
@@ -132,13 +132,19 @@ fi
|
||||
|
||||
# Update README.md version references
|
||||
if [ -f "README.md" ]; then
|
||||
# Look for version references in format VERSION: XX.XX.XX
|
||||
if grep -q 'VERSION: [0-9]' README.md; then
|
||||
# Convert to zero-padded format if needed
|
||||
PADDED_VERSION="$(printf '%s' "${VERSION}" | awk -F. '{printf "%02d.%02d.%02d", $1, $2, $3}')"
|
||||
sed_inplace "s|VERSION: [0-9]{2}\.[0-9]{2}\.[0-9]{2}|VERSION: ${PADDED_VERSION}|g" README.md
|
||||
log_info "✓ Updated README.md version references"
|
||||
fi
|
||||
# Look for version references in format VERSION: XX.XX.XX
|
||||
if grep -q 'VERSION: [0-9]' README.md; then
|
||||
# Validate version format has 3 components
|
||||
component_count=$(echo "${VERSION}" | awk -F. '{print NF}')
|
||||
if [ "${component_count}" -eq 3 ]; then
|
||||
# Convert to zero-padded format
|
||||
PADDED_VERSION="$(printf '%s' "${VERSION}" | awk -F. '{printf "%02d.%02d.%02d", $1, $2, $3}')"
|
||||
sed_inplace "s|VERSION: [0-9]{2}\.[0-9]{2}\.[0-9]{2}|VERSION: ${PADDED_VERSION}|g" README.md
|
||||
log_info "✓ Updated README.md version references"
|
||||
else
|
||||
log_warn "Version format invalid for padding, skipping README.md update"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
log_info "========================================="
|
||||
|
||||
@@ -43,6 +43,13 @@ SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
# Configuration
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
VERBOSE="${1:-}"
|
||||
if [ "${VERBOSE}" = "-v" ] || [ "${VERBOSE}" = "--verbose" ]; then
|
||||
VERBOSE="true"
|
||||
else
|
||||
VERBOSE="false"
|
||||
fi
|
||||
|
||||
REQUIRED_CHECKS=(
|
||||
"manifest"
|
||||
"xml_wellformed"
|
||||
@@ -83,13 +90,23 @@ for check in "${REQUIRED_CHECKS[@]}"; do
|
||||
fi
|
||||
|
||||
log_step "Running: ${check}"
|
||||
if "${script}" >/dev/null 2>&1; then
|
||||
if [ "${VERBOSE}" = "true" ]; then
|
||||
if "${script}"; then
|
||||
log_success "✓ ${check}"
|
||||
required_passed=$((required_passed + 1))
|
||||
else
|
||||
log_error "✗ ${check} (FAILED)"
|
||||
required_failed=$((required_failed + 1))
|
||||
fi
|
||||
else
|
||||
if "${script}" >/dev/null 2>&1; then
|
||||
log_success "✓ ${check}"
|
||||
required_passed=$((required_passed + 1))
|
||||
else
|
||||
log_error "✗ ${check} (FAILED - run with -v for details)"
|
||||
required_failed=$((required_failed + 1))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
@@ -104,13 +121,23 @@ for check in "${OPTIONAL_CHECKS[@]}"; do
|
||||
fi
|
||||
|
||||
log_step "Running: ${check}"
|
||||
if "${script}" >/dev/null 2>&1; then
|
||||
if [ "${VERBOSE}" = "true" ]; then
|
||||
if "${script}"; then
|
||||
log_success "✓ ${check}"
|
||||
optional_passed=$((optional_passed + 1))
|
||||
else
|
||||
log_warn "✗ ${check} (warnings/issues found)"
|
||||
optional_failed=$((optional_failed + 1))
|
||||
fi
|
||||
else
|
||||
if "${script}" >/dev/null 2>&1; then
|
||||
log_success "✓ ${check}"
|
||||
optional_passed=$((optional_passed + 1))
|
||||
else
|
||||
log_warn "✗ ${check} (warnings/issues found - run with -v for details)"
|
||||
optional_failed=$((optional_failed + 1))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user