feat(skills): add mandatory linting gate before commits and PRs
- gitea-implementierung: lint gate (PHP/CSS/HTML) as first quality gate step - gitea-fix-refactoring: lint gate before every fix commit - gitea-merge-release: lint gate before PR creation - All gates abort on failure (exit code != 0)
This commit is contained in:
@@ -39,6 +39,18 @@ git checkout -b feature/issue-<number>-<short-description>
|
||||
- Branch-Naming: `feature/issue-<number>-<short-description>`
|
||||
- Repo klonen falls nötig: `git clone https://git.home.kies-media.de/<owner>/<repo>.git /tmp/<repo>`
|
||||
|
||||
### Main-Branch Rebase
|
||||
Bevor mit der Implementierung begonnen wird, prüfen ob sich `main` geändert hat:
|
||||
```bash
|
||||
git fetch origin
|
||||
git log --oneline HEAD..origin/main
|
||||
```
|
||||
Falls `main` neue Commits hat:
|
||||
```bash
|
||||
git rebase origin/main
|
||||
```
|
||||
Bei Konflikten: Auflösen, dann `git rebase --continue`. Bei komplexen Konflikten Martin informieren.
|
||||
|
||||
### Bestehenden Code erweitern
|
||||
- Bestehende Patterns und Konventionen beachten
|
||||
- Keine unnötigen Refactorings im gleichen PR
|
||||
@@ -84,6 +96,50 @@ git checkout -b feature/issue-<number>-<short-description>
|
||||
- Formatter nutzen (Prettier, Black, etc.)
|
||||
- Projekt-spezifische Konventionen respektieren
|
||||
|
||||
### Code-Quality-Gates (PFLICHT vor jedem Commit)
|
||||
|
||||
**Schritt 1: Projekt-Linting (PFLICHT – Abbruch bei Fehlern)**
|
||||
|
||||
Vor JEDEM Commit müssen ALLE konfigurierten Linter erfolgreich durchlaufen.
|
||||
Falls ein Linter fehlschlägt: **Commit abbrechen**, Fehler beheben, dann erneut versuchen.
|
||||
|
||||
```bash
|
||||
# PHP Syntax Check
|
||||
find . -name "*.php" -not -path "*/vendor/*" -exec php -l {} \; 2>&1 | grep -v "No syntax errors"
|
||||
|
||||
# CSS Lint (stylelint)
|
||||
npx stylelint "**/*.css" --config .stylelintrc.json --allow-empty-input
|
||||
|
||||
# HTML Lint (htmlhint) – nur .html Dateien, nicht .php
|
||||
npx htmlhint "**/*.html" --config .htmlhintrc --ignore "**/*.php"
|
||||
|
||||
# Projekt-spezifische Linter (falls vorhanden)
|
||||
npm run lint # oder: npx eslint .
|
||||
python -m flake8 .
|
||||
```
|
||||
**Jeder Linter muss Exit-Code 0 zurückgeben. Sonst: KEIN Commit.**
|
||||
|
||||
**Schritt 2: Dependency-Audit**
|
||||
```bash
|
||||
npm audit --audit-level=moderate # Node.js
|
||||
pip audit # Python
|
||||
```
|
||||
Bei Critical/High Vulnerabilities: nicht committen, Martin informieren.
|
||||
|
||||
**Schritt 3: Formatter ausführen**
|
||||
```bash
|
||||
npm run format # oder: npx prettier --write .
|
||||
```
|
||||
|
||||
**Schritt 4: Build prüfen (falls vorhanden)**
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
Build muss erfolgreich sein.
|
||||
|
||||
Diese Schritte sind **Pflicht** – kein Commit und kein PR ohne erfolgreichen Durchlauf.
|
||||
Ausnahme: Wenn das Projekt keine entsprechenden Tools konfiguriert hat, Martin informieren.
|
||||
|
||||
### Commits strukturieren
|
||||
- Kleine, atomare Commits
|
||||
- Conventional Commits Format: `type(scope): description`
|
||||
@@ -94,9 +150,11 @@ git checkout -b feature/issue-<number>-<short-description>
|
||||
- Implementierter Code auf Feature Branch
|
||||
- Alle Commits sauber strukturiert
|
||||
- Code bereit für Review
|
||||
- **Label `Implementing` gesetzt** (kumulativ)
|
||||
- ⏩ Übergabe an **Code-Review-Agent**
|
||||
|
||||
## Regeln
|
||||
- Keine Secrets/Credentials im Code
|
||||
- Keine TODOs zurücklassen (außer mit Issue-Referenz)
|
||||
- Bei Blockern sofort Martin informieren
|
||||
- API-Calls müssen HTTP-Status prüfen – bei Fehlern abbrechen und Martin informieren
|
||||
|
||||
Reference in New Issue
Block a user