Fehlenden Commit-Hook sichtbar machen
- gen_codemap.py --check nennt bei veralteter Map, dass der Hook auf diesem Clone nicht aktiv ist, und die Einrichtungszeile. - AGENTS.md: Hook-Status vor dem ersten Code-Commit pruefen und fehlende Aktivierung melden, statt sie vorauszusetzen.
This commit is contained in:
parent
200668c51b
commit
4ec373070d
3 changed files with 20 additions and 2 deletions
|
|
@ -27,6 +27,10 @@
|
|||
sie exakt mit dem Arbeitsstand. Mit aktivem Hook (`git config core.hooksPath .githooks`)
|
||||
passiert das beim Commit automatisch; sonst nach Strukturänderungen selbst ausführen.
|
||||
Zweck-Texte im `PURPOSE`-Dict pflegen, nicht die Map.
|
||||
- **Hook-Status vor dem ersten Code-Commit prüfen:** `git config core.hooksPath` muss
|
||||
`.githooks` ausgeben. Ist die Ausgabe leer (frischer Clone – die Einstellung wird
|
||||
nicht mitgeklont), einmalig `git config core.hooksPath .githooks` setzen und dem
|
||||
Nutzer mitteilen. Solange der Hook fehlt, die Map vor dem Commit selbst erzeugen.
|
||||
- **`docs/legacy/` ist per `.ignore` ausgeblendet** (alter Laravel-Stand, nur Referenz).
|
||||
Bei Bedarf gezielt mit Pfadangabe durchsuchen.
|
||||
- **Gezielt statt breit lesen:** erst `wc -l`/`grep -n`, dann `read` mit `offset`/`limit`.
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Diese Datei ersetzt die Erkundung. Erst hier nachschlagen, dann gezielt mit
|
|||
Abschnitt zu lesen. `docs/legacy/` ist absichtlich ausgeblendet (siehe
|
||||
`.ignore`); dort liegt der alte Laravel-Stand.
|
||||
|
||||
Umfang: 11239 Zeilen in 66 Dateien.
|
||||
Umfang: 11253 Zeilen in 66 Dateien.
|
||||
|
||||
## Einstiegspunkte
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ ohne View.
|
|||
| `tools/deploy_live.py` | 745 | Deploy per FTP; --db-sync/--db-only nur nach Bestätigung | — |
|
||||
| `tools/dump_tippspiel.py` | 220 | Live-DB nach tools/dumps sichern (14 Dumps werden behalten) | — |
|
||||
| `tools/fetch_logos.py` | 299 | Vereinslogos (Wikipedia) und Flaggen (flagcdn) laden | — |
|
||||
| `tools/gen_codemap.py` | 433 | Erzeugt docs/code-map.md: eine kompakte Landkarte der Codebase. | — |
|
||||
| `tools/gen_codemap.py` | 447 | Erzeugt docs/code-map.md: eine kompakte Landkarte der Codebase. | — |
|
||||
| `tools/generate_vapid_keys.py` | 125 | VAPID-Schlüssel für Web-Push erzeugen | — |
|
||||
|
||||
## Wo finde ich was?
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ Dateien/ Methoden einfach neu erzeugen.
|
|||
"""
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
|
@ -297,6 +298,16 @@ def collect_routes(index_text: str) -> list[dict]:
|
|||
return rows
|
||||
|
||||
|
||||
def hooks_active() -> bool:
|
||||
"""True, wenn core.hooksPath auf .githooks zeigt (lokale Einstellung, nicht geklont)."""
|
||||
try:
|
||||
out = subprocess.run(["git", "config", "core.hooksPath"], cwd=ROOT,
|
||||
capture_output=True, text=True)
|
||||
return out.returncode == 0 and out.stdout.strip().rstrip("/") == ".githooks"
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
def md_table(headers: list[str], rows: list[list[str]]) -> str:
|
||||
widths = [len(h) for h in headers]
|
||||
for row in rows:
|
||||
|
|
@ -419,6 +430,9 @@ def main() -> int:
|
|||
current = ""
|
||||
if current != content:
|
||||
print(f"{rel(OUT)} ist veraltet. Bitte tools/gen_codemap.py ausführen.")
|
||||
if not hooks_active():
|
||||
print("Hinweis: Der Commit-Hook ist auf diesem Clone nicht aktiv. "
|
||||
"Einmalig: git config core.hooksPath .githooks")
|
||||
return 1
|
||||
print(f"{rel(OUT)} ist aktuell.")
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue