Skip to content

chore(cspell): checkin をプロジェクトの辞書に登録する - #93

Merged
reiroop merged 1 commit into
mainfrom
chore/cspell-project-dictionary
Sep 20, 2026
Merged

reiroop merged 1 commit into
mainfrom
chore/cspell-project-dictionary

Conversation

@reiroop

@reiroop reiroop commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

コミットの構成

1 本。chore(cspell): checkin をプロジェクトの辞書に登録する。

置き場所を cspell.json にした根拠、.vscode/settings.json に cSpell.words を置く案を
退けた実測、version を置いた理由は、コミットメッセージにある。ここには書かない。

レビューで何を見れば足りるか

新規 1 ファイル、4 行。既存のファイルは 1 つも変えていない。機械生成の部分はない。全文が次である。

{
  "version": "0.2",
  "words": ["checkin"]
}

差分は次で出る。

git diff origin/main...HEAD

レビューする人にお願いしたい確認

VS Code の Code Spell Checker 拡張機能そのものが、この cspell.json を読むことは確かめていない。
この作業環境で VS Code を動かせないためである。根拠は拡張機能の README が述べる設定の優先順位の一覧と、
cspell コマンドでの実測だけで、どちらもコミットメッセージに引いてある。
つまりこの PR は、cspell コマンドについては実測で裏づけられているが、
拡張機能については README の記述だけを根拠にしている。

VS Code でこのリポジトリを開ける人に、次の 2 つの確認をお願いしたい。

  • このブランチを開いた状態で、checkin を含む語に綴りの警告が出ないこと
  • main を開いた状態では、同じ語に警告が出ること

2 つ目を並べているのは、警告が出ないことと、拡張機能が何も検査していないこととを区別するためである。
main でも出ないなら、拡張機能が入っていないか、別の設定で既に抑えられている。その場合、
この PR の拡張機能側の根拠は README の記述だけのままになるので、その旨をコメントでお知らせいただきたい。

マージした後に残ること

cspell はこのリポジトリの検査に入らない

package.json のスクリプトにも .github/workflows/ci.yml にも cspell を足していない。

git grep -n cspell -- package.json .github/   # 1 行も返らない

マージしても CI の挙動は変わらない。綴りが検査されるのは、拡張機能を入れた人のエディタの中と、
cspell コマンドを手で叩いたときだけである。検査に足すかどうかはまだ決めていない。
辞書を cspell.json に置いてあるので、後から足すときに移し替える作業は要らない。

登録したのは checkin の 1 語だけ

language・flagWords・ignorePaths などの他の設定は置いていない。
次に未知語が出たときは、同じファイルの words に足すことになる。
このファイルが増えていくことを、以後この語を足す人が引き受ける。

🤖 Generated with Claude Code

スペルチェッカーは `checkin` を知らない。cspell 10.3.3 に
`The checkin page is ready.` を読ませると `Unknown word (checkin)` が出る
(2026-09-20 に、設定を何も置いていない使い捨てのディレクトリをそのまま作業
ディレクトリにして `npx cspell@10.3.3 --no-progress --no-summary doc.txt` を
実行して確認。同じ文書に入れた `project` は報告されず、でたらめな綴りは
報告されたので、何でも報告しているわけではない)。`checkin` はこのリポジトリ
の名前で、追跡されているファイルの中に多数現れる。数え方は
`git ls-files | grep -v pnpm-lock.yaml | xargs grep -oIE '[Cc]heckin' | wc -l`
である。

置き場所はリポジトリ直下の `cspell.json` にした。Code Spell Checker 拡張機能
4.9.3 の README が、プロジェクト単位の辞書はここに置くものだと書いている。

> To add a dictionary at the project level should be defined in a
> `cspell.json` file so it can be used with the `cspell` command line tool.
> This file can be either at the project root or in the .vscode directory.

同じ README は、設定の優先順位の 1 番目に作業フォルダの `cspell.json` を挙げ、
`cspell.json` の設定が VS Code の `settings.json` の同等の設定を上書きすると
書いている。

> Order of precedence:
> 1. Workspace Folder `cspell.json`
> 1. Workspace Folder `.vscode/cspell.json`
> 1. Config Folder `.config/cspell.json`
> 1. VS Code Preferences `cSpell` section.

> Words added to the dictionary are placed in the `cspell.json` file in the
> _workspace_ folder. Note, the settings in `cspell.json` will override the
> equivalent cSpell settings in VS Code's `settings.json`.

## 退けた候補: .vscode/settings.json に cSpell.words を置く

`cspell` コマンドがこれを読まないので退けた。同じ文書に対して、置く設定だけを
変えて測った(2026-09-20、cspell 10.3.3。ケースごとに専用のディレクトリを作り、
そのディレクトリを作業ディレクトリにして、相対パスで
`npx cspell@10.3.3 --no-progress --no-summary doc.txt` を実行した)。

- 設定を置かない: `checkin` とでたらめな綴りの両方が報告される
- `.vscode/settings.json` に `cSpell.words`: 設定を置かない場合と同じ結果
- リポジトリ直下の `cspell.json` に `words`: `checkin` は報告されず、でたらめ
  な綴りだけが報告される
- `.vscode/cspell.json` に `words`: 直下に置いた場合と同じ結果

どの場合にもでたらめな綴りを文書に残したのは、`checkin` が報告されないことと、
cspell が何も検査していないこととを区別するためである。

## version について

`cspell` コマンドは `version` が無くても上と同じ結果になる(同じ手順で測った)。
README の例が `Version of the setting file.  Always 0.2` という注釈付きで
`"version": "0.2"` を置いているので、その形に合わせた。

## 確かめていないこと

拡張機能そのものがこの `cspell.json` を読むことは確かめていない。この環境で
VS Code を動かせないためである。根拠は上に引いた README の優先順位の一覧と、
`cspell` コマンドでの実測だけである。

## 解かないこと

- cspell をこのリポジトリの検査に足さない。`package.json` のスクリプトにも
  CI にも加えない。足すかどうかをまだ決めていないためである。`cspell.json` に
  置けば `cspell` コマンドから読めることは上で測ってあるので、後から足すとき
  に辞書を移し替える作業は要らない。
- `checkin` 以外の語は登録しない。
- `language`・`flagWords`・`ignorePaths` などの他の設定は置かない。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@reiroop reiroop added the enhancement New feature or request label Sep 20, 2026
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0494565d-160e-40c5-bd6d-b7207f082a6f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@reiroop
reiroop merged commit 7bf329e into main Sep 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant