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

Abierto
#6 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
56/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
1
Forks
4
Merge medio
12 d 21 h
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de alphacrack/python-maithili-dsl

Todos los issues de alphacrack/python-maithili-dsl

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.