[BUG] Linter is_snake_case only matches ASCII — always fails for Devanagari identifiers

Aperta
#6 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python

Direzione di ricerca

The naming rule is is_snake_case in maithili_dsl/transpiler/linter.py, and its ASCII-only regex is the cause. Check where enforce_snake_case in LINT_CONFIG is read, and run 'नाम'.isidentifier() to confirm the identifier is valid. Done when Devanagari names pass the check, Latin snake_case is still enforced, and new cases in tests/test_linter.py cover both. The issue leaves the script-detection approach open, so confirm it with a maintainer before choosing one.

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

Descrizione

area:linter bug P2

File: maithili_dsl/transpiler/linter.py:11

def is_snake_case(name):
    return bool(re.match(r'^[a-z_][a-z0-9_]*$', name))

The regex only matches ASCII lowercase, so every Devanagari variable name (e.g. नाम, गिनती) fails the check. Devanagari identifiers are valid Python 3 identifiers ('नाम'.isidentifier() is True), so the naming rule should accept them.

Currently mitigated because enforce_snake_case defaults to False in LINT_CONFIG, but any user who enables it gets a false positive on every line.

Fix: make the naming check script-aware — e.g. accept identifiers composed of Devanagari characters (and underscores/digits), and only apply the ASCII snake_case rule to Latin-script names. Add cases to tests/test_linter.py.

From BACKLOG.md item 10.

Lingua principale
Python
Stelle
1
Fork
4
Merge medio
12g 21h
PR unite (30g)
1

Preparare l'ambiente

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.

Altre issue di alphacrack/python-maithili-dsl

Tutte le issue di alphacrack/python-maithili-dsl

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.