laywill / laywill/github-template

MegaLinter FILTER_REGEX_EXCLUDE excludes the whole .github/ tree via unanchored .git substring match

Offen Anfängerfreundlich
#9 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Keine Sprachdaten
Sterne
2
Forks
0
Ø Merge
2 T. 3 Std.
Gemergte PRs (30 T.)
3

Beschreibung

`FILTER_REGEX_EXCLUDE` in `.mega-linter.yml` is unanchored:

FILTER_REGEX_EXCLUDE: (\.git|\.venv|\.pytest_cache|\.vscode|__pycache__)

MegaLinter matches this regex against each file's full relative path. The `.git` alternative matches any path containing the substring `.git`, which also matches everything under `.github/` (e.g. `.github/workflows/mega-linter.yml`, `.github/labels.yml`, `.github/codeql.yml`). As a result the whole `.github/` tree is silently excluded from every linter — actionlint, yamllint, markdownlint, editorconfig-checker, etc. never see workflow files, label config, dependabot config, or issue templates.

Since this repo is the template other repos are scaffolded from, the bug propagates to every repo created from it.

Fix: anchor each alternative to real directory boundaries:

FILTER_REGEX_EXCLUDE: (^|/)(\.git|\.venv|\.pytest_cache|\.vscode|__pycache__)/

This keeps `.git/`, `.venv/`, `pycache/`, etc. excluded while no longer matching `.github/` as a false positive.

See laywill/laywill.github.io#48 and its fix in laywill/laywill.github.io#50 for the original writeup and verification approach (ran actionlint/yamllint/markdownlint-cli2/editorconfig-checker locally against `.github/**` via Docker to confirm no new findings before merging).

Note: fixing this may turn linters loose on `.github/**` files that have never been linted before in downstream repos — expect the fix PR to also need to clean up whatever those linters newly report.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in .mega-linter.yml und prüfe, wie FILTER_REGEX_EXCLUDE auf relative Pfade angewendet wird. Aktualisiere das Ausschlussmuster und führe anschließend actionlint, yamllint, markdownlint-cli2 und editorconfig-checker wie im Issue beschrieben über Docker für .github/** aus. Als abgeschlossen gilt die Aufgabe, wenn .github/** ohne neue Befunde gelintet wird und alle gemeldeten Probleme behoben sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
yaml
Bereich
ci-cd, tooling
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
78/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.