Files
Jonathan Miller 1799401db5
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
feat: add standard file headers to all 57 files missing them
- Add Copyright + FILE INFORMATION headers to 11 PHP enterprise classes
- Add FILE INFORMATION blocks to 9 PHP files with incomplete headers
- Add headers to 2 test files
- Add markdown comment headers to 27 index/README files
- Add headers to 5 root markdown files
- Add FILE INFORMATION to 4 files with existing but incomplete headers

All files now conform to moko-platform file header standard.

Authored-by: Moko Consulting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-11 17:10:19 -05:00

3.4 KiB

Script Templates

This directory contains template scripts for common repository operations including validation, fixes, and release automation.

Directory Structure

  • validate/ - Validation scripts for CI pipelines
  • fix/ - Automated fix scripts for common issues
  • release/ - Release automation scripts
  • lib/ - Shared library functions

Validation Scripts

validate/tabs.sh

Validates that no literal tab characters exist in source files.

validate/paths.sh

Validates that path separators use forward slashes.

validate/changelog.sh

Validates CHANGELOG.md structure and format.

validate/xml_wellformed.sh

Validates XML files are well-formed.

validate/license_headers.sh

Validates license headers in source files.

validate/no_secrets.sh

Checks for potential secrets in committed files.

validate/php_syntax.sh

Validates PHP syntax (Joomla projects).

validate/version_alignment.sh

Validates version alignment across manifest files.

validate/manifest.sh

Validates Joomla manifest structure (Joomla projects).

validate/language_structure.sh

Validates language file structure (Joomla projects).

Fix Scripts

fix/line_endings.sh

Fixes line endings to LF.

fix/permissions.sh

Fixes file permissions (644 for files, 755 for directories and scripts).

Release Scripts

release/package.sh

Creates release package with proper structure.

Library Scripts

lib/common.sh

Common utility functions for scripts including logging, command checks, and git utilities.

Usage

In CI Workflows

Add validation scripts to your CI workflow:

- name: Required validations
  run: |
    set -e
    scripts/validate/manifest.sh
    scripts/validate/xml_wellformed.sh

Manual Execution

Make scripts executable and run:

chmod +x scripts/validate/*.sh
./scripts/validate/tabs.sh

With Library Functions

Source the common library in your scripts:

#!/usr/bin/env bash
source "$(dirname "$0")/../lib/common.sh"

log_info "Starting validation..."
require_command "xmllint"

Customization

These are template scripts. Adapt them to your project's specific needs:

  1. Copy relevant scripts to your project's scripts/ directory
  2. Modify validation rules to match your standards
  3. Update file patterns and paths as needed
  4. Add project-specific validation logic

Standards Compliance

All scripts follow MokoStandards requirements:

  • SPDX license headers
  • GPL-3.0-or-later license
  • Proper error handling with set -euo pipefail
  • Informative logging output
  • Exit code conventions (0 = success, 1 = failure)

Integration with repo_health.yml

The repo_health.yml workflow enforces script governance:

  • Allowed directories: scripts/, scripts/validate/, scripts/fix/, scripts/release/, scripts/lib/
  • ShellCheck validation (advisory)
  • Script structure validation

Notes

  • Scripts in validate/ should exit with code 1 on failure
  • Scripts in fix/ should be idempotent
  • Scripts in release/ should be safe to run multiple times
  • Always test scripts locally before committing