laywill / laywill/github-template

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

Aperta Adatta ai principianti
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Nessun dato sulla lingua
Stelle
2
Fork
0
Merge medio
2g 3h
PR unite (30g)
3

Descrizione

`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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia in .mega-linter.yml e verifica come viene applicato FILTER_REGEX_EXCLUDE ai percorsi relativi. Aggiorna il pattern di esclusione, quindi esegui actionlint, yamllint, markdownlint-cli2 ed editorconfig-checker su .github/** tramite Docker, come descritto nell'issue. Il lavoro è completato quando .github/** viene sottoposto al lint senza nuove segnalazioni e tutti i problemi segnalati vengono risolti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
yaml
Ambito
ci-cd, tooling
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
78/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.