Repository navigation
build(lint): allow snake_case directories under src - #10
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
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]で読み込める)&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