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

オープン
#6 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
1
フォーク
4
平均マージ
12日 21時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

alphacrack/python-maithili-dsl のほかの issue

alphacrack/python-maithili-dsl の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。