mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 14:43:01 +02:00
- Add pre-commit hook (check_polling_antipatterns.sh) to detect fork-storm anti-patterns - Update .pre-commit-config.yaml with no-polling-antipatterns hook registration - Add comprehensive documentation (6 guides, 1000+ lines total) Detects and blocks: * while true + sleep patterns (suggests event-driven I/O) * $(date +...) subprocess forks (suggests /proc/uptime or bash printf) * pgrep/xdotool in polling functions (expensive fork overhead) * aggressive polling (sleep < 1s causing fork storms) * heavy piped commands (| awk | grep | tr with multiple forks) Documentation included: - SHELL_SCRIPT_QUALITY_GUIDELINES.md: 3-layer guide for developers/reviewers - SHELL_QUALITY_IMPLEMENTATION_SUMMARY.md: Technical implementation reference - COMPLETE_IMPLEMENTATION_SUMMARY.md: Full overview and integration guide - QUICK_REFERENCE_SHELL_QUALITY.md: Visual checklist and quick lookup - DELIVERABLES_INDEX.md: Index of all deliverables and next steps - shell.instructions.md: R1-R8 polling optimization rules (in ~/.copilot/instructions/) System impact: - Prevents new scripts from introducing fork-storm regressions - Already active optimizations: network_monitor.sh zero-fork, battery 1s->5s, music adaptive sleep - Expected daily savings: ~1-2 CPU-hours from eliminated fork overhead Related: Resolves previous fork-storm issue identified on May 3 causing 728k CPU-seconds |
||
|---|---|---|
| .. | ||
| run_all | ||
| check_c_cpp_build_files.sh | ||
| check_no_binaries.sh | ||
| check_no_secrets.sh | ||
| check_polling_antipatterns.sh | ||
| check_python_location.sh | ||
| disk_cleanup_check.sh | ||
| makepkg-manual-dlagent.sh | ||
| optimize_vscode.py | ||
| pytest_changed_packages.py | ||