Skip to content

Pre-commit: Em-Dash-Guard (—) einführen #2

Description

@atraining

Problem

Em-Dashes (—, U+2014) sind ein bekannter Indikator für LLM-generierten Text. Nach dem Sweep in 528bb1c ist das Repo aktuell frei davon — aber nichts hindert zukünftige Commits daran, sie wieder einzuschleusen.

Vorschlag

Einfacher Pre-commit-Hook, der staged files auf prüft und den Commit blockiert:

#!/usr/bin/env bash
if git diff --cached --name-only -z | xargs -0 grep -lP '' 2>/dev/null; then
  echo "Em-Dash (—) gefunden. Bitte umformulieren."
  exit 1
fi

Kann als Standalone-Script in .githooks/ liegen oder ins pre-commit-Framework (siehe #2) integriert werden.

Scope

  • Nur auf Textdateien (.md, .py, .txt, .yml)
  • Ignoriert LICENSE und Binär-Dateien

Nice-to-have

Analoge Checks für andere KI-Marker: curly quotes (" ""), non-breaking spaces, redundante Oxford commas im Deutschen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions