Address code review feedback
- Add version component validation in versions.sh - Add verbose mode to validate_all.sh for debugging - Update documentation with verbose mode usage - Improve error messages with hints to use verbose mode Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
@@ -225,10 +225,12 @@ Runs all validation scripts and provides a comprehensive report:
|
|||||||
- Executes all optional validation checks
|
- Executes all optional validation checks
|
||||||
- Provides colored output with pass/fail indicators
|
- Provides colored output with pass/fail indicators
|
||||||
- Returns summary with counts
|
- Returns summary with counts
|
||||||
|
- Supports verbose mode for detailed output
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
```bash
|
```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:
|
Example output:
|
||||||
@@ -243,7 +245,7 @@ INFO: Running all validation checks...
|
|||||||
=== Optional Checks ===
|
=== Optional Checks ===
|
||||||
[SUCCESS] ✓ no_secrets
|
[SUCCESS] ✓ no_secrets
|
||||||
[SUCCESS] ✓ php_syntax
|
[SUCCESS] ✓ php_syntax
|
||||||
WARN: ✗ tabs (warnings/issues found)
|
WARN: ✗ tabs (warnings/issues found - run with -v for details)
|
||||||
|
|
||||||
=== Validation Summary ===
|
=== Validation Summary ===
|
||||||
Required checks passed: 2/2
|
Required checks passed: 2/2
|
||||||
|
|||||||
@@ -134,10 +134,16 @@ fi
|
|||||||
if [ -f "README.md" ]; then
|
if [ -f "README.md" ]; then
|
||||||
# Look for version references in format VERSION: XX.XX.XX
|
# Look for version references in format VERSION: XX.XX.XX
|
||||||
if grep -q 'VERSION: [0-9]' README.md; then
|
if grep -q 'VERSION: [0-9]' README.md; then
|
||||||
# Convert to zero-padded format if needed
|
# 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}')"
|
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
|
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"
|
log_info "✓ Updated README.md version references"
|
||||||
|
else
|
||||||
|
log_warn "Version format invalid for padding, skipping README.md update"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,13 @@ SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|||||||
# Configuration
|
# Configuration
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
VERBOSE="${1:-}"
|
||||||
|
if [ "${VERBOSE}" = "-v" ] || [ "${VERBOSE}" = "--verbose" ]; then
|
||||||
|
VERBOSE="true"
|
||||||
|
else
|
||||||
|
VERBOSE="false"
|
||||||
|
fi
|
||||||
|
|
||||||
REQUIRED_CHECKS=(
|
REQUIRED_CHECKS=(
|
||||||
"manifest"
|
"manifest"
|
||||||
"xml_wellformed"
|
"xml_wellformed"
|
||||||
@@ -83,13 +90,23 @@ for check in "${REQUIRED_CHECKS[@]}"; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log_step "Running: ${check}"
|
log_step "Running: ${check}"
|
||||||
if "${script}" >/dev/null 2>&1; then
|
if [ "${VERBOSE}" = "true" ]; then
|
||||||
|
if "${script}"; then
|
||||||
log_success "✓ ${check}"
|
log_success "✓ ${check}"
|
||||||
required_passed=$((required_passed + 1))
|
required_passed=$((required_passed + 1))
|
||||||
else
|
else
|
||||||
log_error "✗ ${check} (FAILED)"
|
log_error "✗ ${check} (FAILED)"
|
||||||
required_failed=$((required_failed + 1))
|
required_failed=$((required_failed + 1))
|
||||||
fi
|
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
|
done
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -104,13 +121,23 @@ for check in "${OPTIONAL_CHECKS[@]}"; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log_step "Running: ${check}"
|
log_step "Running: ${check}"
|
||||||
if "${script}" >/dev/null 2>&1; then
|
if [ "${VERBOSE}" = "true" ]; then
|
||||||
|
if "${script}"; then
|
||||||
log_success "✓ ${check}"
|
log_success "✓ ${check}"
|
||||||
optional_passed=$((optional_passed + 1))
|
optional_passed=$((optional_passed + 1))
|
||||||
else
|
else
|
||||||
log_warn "✗ ${check} (warnings/issues found)"
|
log_warn "✗ ${check} (warnings/issues found)"
|
||||||
optional_failed=$((optional_failed + 1))
|
optional_failed=$((optional_failed + 1))
|
||||||
fi
|
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
|
done
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user