Improve Joomla development workflows and convert scripts to Python #31
2
.github/workflows/repo_health.yml
vendored
2
.github/workflows/repo_health.yml
vendored
@@ -36,7 +36,7 @@ env:
|
|||||||
# Scripts governance policy
|
# Scripts governance policy
|
||||||
# Note: directories listed without a trailing slash.
|
# Note: directories listed without a trailing slash.
|
||||||
SCRIPTS_REQUIRED_DIRS:
|
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
|
# Repo health policy
|
||||||
# Files are listed as-is; directories must end with a trailing slash.
|
# Files are listed as-is; directories must end with a trailing slash.
|
||||||
|
|||||||
@@ -348,5 +348,5 @@ make help # Show all commands
|
|||||||
---
|
---
|
||||||
|
|
||||||
**Document Version:** 1.0.0
|
**Document Version:** 1.0.0
|
||||||
**Last Updated:** 2026-01-04
|
**Last Updated:** 2025-01-04
|
||||||
**Get Started:** Run `make dev-setup` now!
|
**Get Started:** Run `make dev-setup` now!
|
||||||
|
|||||||
@@ -468,5 +468,5 @@ phpcs --standard=phpcs.xml --report=source src/
|
|||||||
---
|
---
|
||||||
|
|
||||||
**Document Version:** 1.0.0
|
**Document Version:** 1.0.0
|
||||||
**Last Updated:** 2026-01-04
|
**Last Updated:** 2025-01-04
|
||||||
**Maintained by:** Moko Consulting Engineering
|
**Maintained by:** Moko Consulting Engineering
|
||||||
|
|||||||
@@ -133,11 +133,12 @@ YAML_FILES=$(echo "$STAGED_FILES" | grep -E '\.(yml|yaml)$' || true)
|
|||||||
if [ -n "$YAML_FILES" ]; then
|
if [ -n "$YAML_FILES" ]; then
|
||||||
while IFS= read -r file; do
|
while IFS= read -r file; do
|
||||||
if [ -f "$file" ]; then
|
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"
|
log_success "YAML valid: $file"
|
||||||
else
|
else
|
||||||
log_error "YAML invalid: $file"
|
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))
|
FAILURES=$((FAILURES + 1))
|
||||||
fi
|
fi
|
||||||
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)
|
PHP_FILES=$(echo "$STAGED_FILES" | grep '\.php$' || true)
|
||||||
|
|
||||||
if [ -n "$PHP_FILES" ]; then
|
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"
|
log_success "PHPCS passed"
|
||||||
else
|
else
|
||||||
log_warning "PHPCS found issues (non-blocking)"
|
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
|
fi
|
||||||
else
|
else
|
||||||
echo " No PHP files to check"
|
echo " No PHP files to check"
|
||||||
|
|||||||
Reference in New Issue
Block a user