Add enterprise-grade standards to scripts

- Add copyright headers to all validation scripts
- Add usage/help functions to user-facing scripts
- Enhance common.sh with dependency checking and timestamps
- Add ENTERPRISE.md with comprehensive standards documentation
- Update scripts/README.md with enterprise features section
- Improve error messages and exit code handling

Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-03 23:08:55 +00:00
parent 0f15207d49
commit f2b8bc9003
16 changed files with 1063 additions and 6 deletions

View File

@@ -35,11 +35,41 @@
set -euo pipefail
# ----------------------------------------------------------------------------
# Usage
# ----------------------------------------------------------------------------
usage() {
cat <<-USAGE
Usage: $0 [OPTIONS]
Run basic smoke tests to verify repository structure and manifest validity.
Options:
-h, --help Show this help message
Examples:
$0 # Run all smoke tests
$0 --help # Show usage information
USAGE
exit 0
}
# Parse arguments
if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
usage
fi
# Source common utilities
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
. "${SCRIPT_DIR}/lib/common.sh"
# Check dependencies
check_dependencies python3
log_info "Running smoke tests for Moko-Cassiopeia repository"
log_info "Start time: $(log_timestamp)"
# ----------------------------------------------------------------------------
# Test: Repository structure
@@ -143,4 +173,5 @@ log_info "Smoke tests completed successfully"
log_info "Extension: ${NAME}"
log_info "Version: ${VERSION}"
log_info "Type: ${TYPE}"
log_info "End time: $(log_timestamp)"
log_info "========================================="

View File

@@ -39,16 +39,63 @@ SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
. "${SCRIPT_DIR}/lib/common.sh"
. "${SCRIPT_DIR}/lib/logging.sh"
# ----------------------------------------------------------------------------
# Usage
# ----------------------------------------------------------------------------
usage() {
cat <<-USAGE
Usage: $0 [OPTIONS]
Run all validation scripts and report results.
Options:
-v, --verbose Show detailed output from validation scripts
-h, --help Show this help message
Examples:
$0 # Run all validations in quiet mode
$0 -v # Run with verbose output
$0 --help # Show usage information
Exit codes:
0 - All required checks passed
1 - One or more required checks failed
2 - Invalid arguments
USAGE
exit 0
}
# ----------------------------------------------------------------------------
# Configuration
# ----------------------------------------------------------------------------
VERBOSE="${1:-}"
if [ "${VERBOSE}" = "-v" ] || [ "${VERBOSE}" = "--verbose" ]; then
VERBOSE="true"
else
VERBOSE="false"
fi
# Parse arguments
case "${VERBOSE}" in
-h|--help)
usage
;;
-v|--verbose)
VERBOSE="true"
;;
"")
VERBOSE="false"
;;
*)
log_error "Invalid argument: ${VERBOSE}"
echo ""
usage
exit 2
;;
esac
# Check dependencies
check_dependencies python3
log_info "Start time: $(log_timestamp)"
REQUIRED_CHECKS=(
"manifest"
@@ -156,6 +203,8 @@ log_kv "Optional checks with issues" "${optional_failed}"
log_separator
log_info "End time: $(log_timestamp)"
if [ "${required_failed}" -gt 0 ]; then
log_error "FAILED: ${required_failed} required check(s) failed"
exit 1