Improve Joomla development workflows and convert scripts to Python #31

Merged
Copilot merged 8 commits from copilot/improve-joomla-development-workflow into main 2026-01-04 05:34:19 +00:00
4 changed files with 9 additions and 7 deletions
Showing only changes of commit 15205433c9 - Show all commits

View File

@@ -36,7 +36,7 @@ env:
# Scripts governance policy
# Note: directories listed without a trailing slash.
SCRIPTS_REQUIRED_DIRS:
SCRIPTS_ALLOWED_DIRS: scripts,scripts/fix,scripts/lib,scripts/release,scripts/run,scripts/validate
SCRIPTS_ALLOWED_DIRS: scripts,scripts/fix,scripts/git,scripts/lib,scripts/release,scripts/run,scripts/validate
# Repo health policy
# Files are listed as-is; directories must end with a trailing slash.

View File

@@ -348,5 +348,5 @@ make help # Show all commands
---
**Document Version:** 1.0.0
**Last Updated:** 2026-01-04
**Last Updated:** 2025-01-04
**Get Started:** Run `make dev-setup` now!

View File

@@ -468,5 +468,5 @@ phpcs --standard=phpcs.xml --report=source src/
---
**Document Version:** 1.0.0
**Last Updated:** 2026-01-04
**Last Updated:** 2025-01-04
**Maintained by:** Moko Consulting Engineering

View File

@@ -133,11 +133,12 @@ YAML_FILES=$(echo "$STAGED_FILES" | grep -E '\.(yml|yaml)$' || true)
if [ -n "$YAML_FILES" ]; then
while IFS= read -r file; do
if [ -f "$file" ]; then
if python3 -c "import yaml; yaml.safe_load(open('$file'))" 2>/dev/null; then
# Use printf to safely pass the file path, avoiding injection
if python3 -c "import sys, yaml; yaml.safe_load(open(sys.argv[1]))" "$file" 2>/dev/null; then
log_success "YAML valid: $file"
else
log_error "YAML invalid: $file"
python3 -c "import yaml; yaml.safe_load(open('$file'))" || true
python3 -c "import sys, yaml; yaml.safe_load(open(sys.argv[1]))" "$file" || true
FAILURES=$((FAILURES + 1))
fi
fi
@@ -210,11 +211,12 @@ if [ "$SKIP_QUALITY" = false ] && command -v phpcs >/dev/null 2>&1; then
PHP_FILES=$(echo "$STAGED_FILES" | grep '\.php$' || true)
if [ -n "$PHP_FILES" ]; then
if echo "$PHP_FILES" | xargs phpcs --standard=phpcs.xml -q 2>/dev/null; then
# Use process substitution to avoid issues with filenames containing spaces
if echo "$PHP_FILES" | tr '\n' '\0' | xargs -0 phpcs --standard=phpcs.xml -q 2>/dev/null; then
log_success "PHPCS passed"
else
log_warning "PHPCS found issues (non-blocking)"
echo "$PHP_FILES" | xargs phpcs --standard=phpcs.xml --report=summary || true
echo "$PHP_FILES" | tr '\n' '\0' | xargs -0 phpcs --standard=phpcs.xml --report=summary || true
fi
else
echo " No PHP files to check"