Skip to content

Rework comment subcommand to the English-first / [Ja] marker format#4

Merged
shimbaco merged 1 commit into
mainfrom
update
Jun 15, 2026
Merged

Rework comment subcommand to the English-first / [Ja] marker format#4
shimbaco merged 1 commit into
mainfrom
update

Conversation

@shimbaco

Copy link
Copy Markdown
Member

No description provided.

Replace the old "[Ja] marker correctness" model (conditions 1-4) with the
English-first / Japanese-marker rule set (conditions 1-8): a Japanese block
must be Japanese (1), the English block must not be Japanese (2), an inline
Japanese marker preceded by Japanese (3), a Japanese block needs an English
block above it (4), the inline end-of-line form is banned (5), the [Ja] marker
must be unique (6), the [En] marker is obsolete (7), and a blank line must
separate the two blocks (8).

Full mode reports only the near-zero-false-positive conditions (1, 2, 3, 7)
tree-wide via isFullModeCond; the rest are diff-only. Inline markers are
detected only after a sentence end so prose mentions are ignored. The
line-classification machinery (classifyLine, isEnglishText, the lineKind
kinds, reLatin, reURLOnly) is replaced by commentBody, markerKind, and the
inline-marker helpers, and the tests are rewritten to cover every condition.

[Ja] comment サブコマンドを「英語先頭 / [Ja] マーカー」形式に作り直す

旧来の「[Ja] マーカーの正しさ」モデル (条件 1-4) を、英語先頭 / 日本語マーカーの
規則 (条件 1-8) に置き換える: 日本語ブロックは日本語 (1)、英語ブロックは日本語を
含まない (2)、前に日本語があるインライン日本語マーカー (3)、日本語ブロックの上に
英語ブロックが必要 (4)、インライン (行末) 形式は禁止 (5)、[Ja] マーカーは一意 (6)、
[En] マーカーは廃止 (7)、2 つのブロックの間に空行が必要 (8)。

全体モードは誤検出がほぼ無い条件 (1, 2, 3, 7) のみを isFullModeCond でツリー全体に
報告し、残りは差分モード限定。インラインマーカーは文末の後だけ検出し、地の文中の
言及は無視する。行分類の仕組み (classifyLine・isEnglishText・lineKind の各種別・
reLatin・reURLOnly) を commentBody・markerKind とインラインマーカー補助関数に置き
換え、テストも全条件を網羅するよう書き直した。
@shimbaco shimbaco marked this pull request as ready for review June 15, 2026 15:25
@shimbaco shimbaco merged commit 7f2a1e9 into main Jun 15, 2026
4 checks passed
@shimbaco shimbaco deleted the update branch June 15, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant