mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-11 21:26:44 +00:00
Twenty-three PHP and twenty Ruby files reached the applications unchecked, which is where the provisioning scripts live. php -l and ruby -c cover what is reachable here; PHPStan and RuboCop would need the target project's classes, since these scripts run inside Moodle, Snipe-IT or GitLab. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
20 lines
568 B
Bash
Executable File
20 lines
568 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck shell=bash
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)"
|
|
|
|
cd "${REPO_ROOT}"
|
|
|
|
mapfile -t ruby_files < <(find . -type f -name '*.rb' 2>/dev/null | sed 's|^\./||' | sort)
|
|
if [[ "${#ruby_files[@]}" -eq 0 ]]; then
|
|
printf 'No Ruby files found.\n'
|
|
exit 0
|
|
fi
|
|
|
|
printf 'Checking %d Ruby file(s) with ruby -c.\n' "${#ruby_files[@]}"
|
|
printf '%s\0' "${ruby_files[@]}" | xargs -0 -n1 ruby -c >/dev/null
|
|
printf 'ruby -c OK (%d file(s))\n' "${#ruby_files[@]}"
|