Logo
Explore Help
Sign In
Timmy_Foundation/hermes-agent
15
0
Fork 0
You've already forked hermes-agent
Code Issues 277 Pull Requests 89 Actions Packages Projects Releases Wiki Activity
Files
85a654348a8f10826377d70080bea39fbf7dbb61
hermes-agent/scripts/pre-commit-hardcoded-paths.sh

8 lines
291 B
Bash
Raw Normal View History

feat: poka-yoke — prevent hardcoded ~/.hermes paths (closes #835) scripts/lint_hardcoded_paths.py (new): - Scans Python files for hardcoded home-directory paths - Detects: Path.home()/.hermes without env fallback, /Users/<name>/, /home/<name>/ - Excludes: comments, docstrings, test files, skills, plugins, docs - Excludes correct patterns: profiles_parent, current_default, native_home - Supports --staged (git pre-commit), --fix (suggestions), --json output scripts/pre-commit-hardcoded-paths.sh (new): - Pre-commit hook that runs lint_hardcoded_paths.py --staged - Blocks commits containing hardcoded path violations tools/confirmation_daemon.py (fixed): - Replaced Path.home() / '.hermes' / 'approval_whitelist.json' with get_hermes_home() / 'approval_whitelist.json' - Added import of get_hermes_home from hermes_constants tests/test_hardcoded_paths.py (new): - 11 tests: detection, exclusion, fallback patterns, clean files
2026-04-15 22:56:32 -04:00
#!/usr/bin/sh
# Pre-commit hook: block commits with hardcoded home-directory paths
# Install: cp scripts/pre-commit-hardcoded-paths.sh .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
# Or: git config core.hooksPath .githooks
python3 scripts/lint_hardcoded_paths.py --staged
exit $?
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.4 Page: 448ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API