mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 21:07:03 +01:00
github.com/kuhyx/phone-focus-mode The two halves go as one repo: focus_policy parses phone_focus_mode's config.sh into the typed policy that focus-owner consumes, and nothing else references it. 77 commits of history, plus the two Python suites from linux_configuration/tests/ and the six mutation fixtures from meta/scripts/fixtures/, all of which named phone_focus_mode paths. Running the suites -- not reading them -- turned up a real defect the extraction would otherwise have inherited. config.sh sources the untracked config_secrets.sh, and ctl_libs_harness.sh never pinned HOME_LAT/HOME_LON, so the distance assertions were checking against whatever real coordinates that file happened to hold. The suite passed on this machine and could not run anywhere else, and a real home location was load-bearing in a pass/fail condition. The harness now pins a pair 4300 m south of the coordinate its own case seeds, and config.sh sources the secrets file only when it exists. 136/136 pass with no secrets file present. Before making the repo public I scanned the whole history for the known home coordinates and for any committed config_secrets.sh: zero hits, and the file was never tracked. The new repo also gained a .gitignore, since none came across in the filter-repo pass. test_magisk_service.sh hangs. It hangs identically in the pre-extraction baseline worktree and appears in no CI list here, so the new repo's CI skips it with that reason rather than pretending it passes. check_python_location.sh loses its phone_focus_mode exception now that the directory is gone; every tracked .py still passes it. The .gitignore rules for config_secrets.sh and the keystore STAY -- the working copy is still on this machine and still holds a real location. Depth 262 -> 248. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp
48 lines
1.1 KiB
Bash
Executable File
48 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Check that all Python files are under python_pkg/.
|
|
# Exceptions: linux_configuration/, Bash/,
|
|
# and vendored/generated directories.
|
|
# Used as a pre-commit hook; receives staged file paths as arguments.
|
|
|
|
set -uo pipefail
|
|
|
|
errors=()
|
|
|
|
for file in "$@"; do
|
|
# Only check .py files
|
|
[[ "$file" != *.py ]] && continue
|
|
|
|
# Skip files already under python_pkg/
|
|
[[ "$file" == python_pkg/* ]] && continue
|
|
|
|
# Skip allowed directories (non-Python projects with some Python scripts)
|
|
case "$file" in
|
|
linux_configuration/* | scripts/* | meta/scripts/*) continue ;;
|
|
esac
|
|
|
|
# Skip vendored/generated directories
|
|
skip=0
|
|
for part in /.venv/ /venv/ /__pycache__/ /build/ /dist/ /node_modules/ /.git/; do
|
|
case "/$file" in
|
|
*"$part"*)
|
|
skip=1
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
[[ $skip -eq 1 ]] && continue
|
|
|
|
errors+=("$file")
|
|
done
|
|
|
|
if [[ ${#errors[@]} -gt 0 ]]; then
|
|
echo "ERROR: Python files must be under python_pkg/."
|
|
echo "The following files are in the wrong location:"
|
|
for err in "${errors[@]}"; do
|
|
echo " $err"
|
|
done
|
|
echo ""
|
|
echo "Move them with: git mv <file> python_pkg/<file>"
|
|
exit 1
|
|
fi
|