Skip to content

build(lint): allow snake_case directories under src - #10

Merged
furedea merged 1 commit into
mainfrom
build/allow-snake-case-module-dirs
Oct 21, 2026
Merged

furedea merged 1 commit into
mainfrom
build/allow-snake-case-module-dirs

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

概要

Rust のモジュールディレクトリは識別子なのでハイフンを含められない.しかし .ls-lint.yml の .dir ルールは kebab-case のみ許可しており,src/github_app のような src/ 配下のディレクトリが ls-lint で失敗する.

変更内容

  • src とその配下のディレクトリにだけ snake_case の .dir ルール(regex:[a-z0-9]+(_[a-z0-9]+)*)を適用する
  • tests/ を含むそれ以外の場所では kebab-case ルールを維持する(ハイフン付きディレクトリは #[path] で読み込める)
  • ls-lint v2 のネストしたブロックはルートのルールを継承せず置き換えるため,ファイル名ルールを YAML アンカー(&files)で共有し,src ブロックにマージする

検証

  • 現在のリポジトリで ls_lint が成功する(exit 0)
  • 一時的な src/good_dir が成功する(exit 0)
  • 一時的な src/bad-dir が src/bad-dir failed for .dir rules で失敗する(exit 1)
  • 別の一時ディレクトリで,src/good_dir/nested_mod が成功すること,tests/snake_dir が kebab-case ルールで失敗すること,src/Bad.rs と src/good_dir/Bad.rs が引き続きファイル名ルールで失敗することを確認した
  • 一時ディレクトリは検証後に削除した

関連

Refs furedea/dotfiles#247

🤖 Generated with Claude Code

Rust module directories are identifiers and cannot contain hyphens, so
the kebab-case .dir rule rejected any module directory such as
src/github_app. Scope a snake_case .dir rule to src and its
subdirectories, and keep kebab-case everywhere else, including tests.

A nested ls-lint block replaces the root rules instead of inheriting
them, so the file rules are shared through a YAML anchor and merged
into the src block.

Refs furedea/dotfiles#247

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@furedea
furedea merged commit 768d7ea into main Oct 21, 2026
10 checks passed
@furedea
furedea deleted the build/allow-snake-case-module-dirs branch October 21, 2026 04: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