You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Observe .gitignore when globbing markdown files. #2
Recommendation: replace the hand-rolled walk with the ignore crate
This came up in review on #1. The directory walk in src/glob/walk.rs is written by hand, and pattern matching already uses globset. The ignore crate comes from ripgrep, like globset, and is its directory walker. Switching to it is how this issue should be done.
It reads .gitignore, .ignore, .git/info/exclude and the global git excludes, with the same semantics as git. That includes nested .gitignore files and negations.
It already does what walk.rs does by hand: not following symlinks, skipping .git, and giving a clear error for a directory it cannot read.
WalkBuilder has a switch for each filter (git_ignore, hidden, parents and so on). Whether deslag honours .gitignore can then be a config option if one is ever needed.
It can walk in parallel (build_parallel), which will matter on large repos.
Several of its dependencies, globset included, are already in the tree.
Alternatives considered:
walkdir: smaller, but it does not read .gitignore, so this issue would still need ignore or a hand-written gitignore parser.
The glob crate: its pattern syntax differs from the globset patterns the config uses, and it cannot prune directories while walking.
The change should be confined to walk.rs: build a WalkBuilder over the root, keep the RepoFile output and the sorting, and add unit tests for an ignored file, a nested .gitignore, and a negation. The /deslag-build-doctrine skill governs adding the dependency.
Deferred from #1 to keep that PR's scope as it is.
Activity
webern commentedon Sep 23, 2026
Recommendation: replace the hand-rolled walk with the
ignorecrateThis came up in review on #1. The directory walk in
src/glob/walk.rsis written by hand, and pattern matching already usesglobset. Theignorecrate comes from ripgrep, likeglobset, and is its directory walker. Switching to it is how this issue should be done..gitignore,.ignore,.git/info/excludeand the global git excludes, with the same semantics as git. That includes nested.gitignorefiles and negations.walk.rsdoes by hand: not following symlinks, skipping.git, and giving a clear error for a directory it cannot read.WalkBuilderhas a switch for each filter (git_ignore,hidden,parentsand so on). Whether deslag honours.gitignorecan then be a config option if one is ever needed.build_parallel), which will matter on large repos.globsetincluded, are already in the tree.Alternatives considered:
walkdir: smaller, but it does not read.gitignore, so this issue would still needignoreor a hand-written gitignore parser.globcrate: its pattern syntax differs from theglobsetpatterns the config uses, and it cannot prune directories while walking.The change should be confined to
walk.rs: build aWalkBuilderover the root, keep theRepoFileoutput and the sorting, and add unit tests for an ignored file, a nested.gitignore, and a negation. The/deslag-build-doctrineskill governs adding the dependency.Deferred from #1 to keep that PR's scope as it is.
Generated by Claude Code
feat: fail Markdown files that are over their byte budget (#1)
feat: skip files git ignores when walking the repo
feat: skip files git ignores when walking the repo