Files
MokoCassiopeia/scripts/validate/tabs.sh
copilot-swe-agent[bot] ef039cf91f Implement core script improvements
- Add joomla_manifest.sh library with manifest parsing functions
- Add smoke_test.sh for repository validation
- Add versions.sh for version management
- Add JSON utilities to common.sh
- Fix logging.sh with proper enhanced logging functions
- Make all scripts executable

Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
2026-01-03 21:33:31 +00:00

29 lines
580 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Detect TAB characters in source files tracked by Git. Uses careful
# handling of filenames and avoids heredoc pitfalls.
# Limit file globs as appropriate for the repo
files=$(git ls-files '*.php' '*.js' '*.py' || true)
if [ -z "${files}" ]; then
echo "No files to check"
exit 0
fi
bad=0
while IFS= read -r f; do
if grep -n $'\t' -- "$f" >/dev/null 2>&1; then
echo "TAB found in $f"
bad=1
fi
done <<< "${files}"
if [ "${bad}" -ne 0 ]; then
echo "ERROR: Tabs found in repository files" >&2
exit 2
fi
echo "tabs: ok"