chore(audit): refine docs-scripts detector and lock in via pre-commit
Two detector bugs fixed: 1. grep_includes missed *.lua, *.ini, *.desktop, *.json — so callers in elephant providers (lua), mako on-button-* hooks (ini), and any future MimeType-registered URL handlers (.desktop) were invisible. Adding them reclassifies nomarchy-notification-dismiss and nomarchy-theme-bg-set from `unused?` to `kept` (true callers in mako/core.ini and the elephant background_selector lua). 2. The all_refs regex `nomarchy-[a-z0-9][a-z0-9-]+` greedily captured trailing dashes, producing junk missing-tokens like `nomarchy-pkg-`, `nomarchy-cmd-`, `nomarchy-restart-`, etc. from glob references like `for c in nomarchy-pkg-*`. Tightened to require an alphanumeric end character. Also restricted to grep_includes so the binary tmpfile path `nomarchy-menu-rows` no longer leaks in. New .githooks/pre-commit re-runs the generator and stages docs/SCRIPTS.md whenever a nomarchy-* script changes. Enable per clone with `git config core.hooksPath .githooks` (now mentioned in docs/AGENT.md). Net audit shift after regen: unused? scripts 31→29, missing tokens 30→28, no false-positive prefix tokens remain.
This commit is contained in:
@@ -127,6 +127,10 @@ Steps you should follow for any non-trivial change:
|
||||
nix --extra-experimental-features 'nix-command flakes' flake check --no-build
|
||||
bash -n installer/install.sh # if you touched it
|
||||
```
|
||||
First clone? Enable the repo's pre-commit hook so `docs/SCRIPTS.md` regenerates whenever you add/modify/remove a `nomarchy-*` script:
|
||||
```bash
|
||||
git config core.hooksPath .githooks
|
||||
```
|
||||
For installer changes, also do a dry-run end-to-end:
|
||||
```bash
|
||||
sudo /etc/install.sh --dry-run # in the live ISO or VM
|
||||
|
||||
Reference in New Issue
Block a user