Scope deps skips and scc exclusions - #141
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts directory-skipping behavior so deps/ is only skipped for Mix projects (or when Git indicates it contains no tracked files) and aligns scc line counting exclusions with the detector’s resolved skip directory set, addressing the deps/ mismatch described in #135.
Changes:
- Replaces unconditional
deps/skipping with scoped logic based on siblingmix.exsand Git tracked-file presence. - Introduces
sccArgs()to pass resolved default/user skip directories (and VCS dirs) toscc --exclude-dir. - Adds tests covering
deps/skip behavior andsccexclusion argument construction.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| detect/detect.go | Scopes deps/ skipping and passes resolved skip dirs through to scc for consistent reporting. |
| detect/detect_test.go | Adds coverage for deps/ scoping logic and scc exclusion arguments. |
Suppressed comments (3)
detect/detect.go:204
- This cache uses a regular map without synchronization, but Engine.Run() executes multiple detections concurrently. depsDirHasTrackedFiles can be called from multiple goroutines and will race on trackedDeps reads/writes.
if e.trackedDeps == nil {
e.trackedDeps = make(map[string]bool)
}
if hasTracked, ok := e.trackedDeps[rel]; ok {
return hasTracked
detect/detect.go:658
- Similar to recursiveGlob:
d.Name()for the walk root is the base of e.Root, not ".". This can cause the entire scan to be skipped when e.Root’s base name is in the skip list. Use the computedrel(empty for the walk root) instead.
if d.IsDir() {
name := d.Name()
if name != "." && e.shouldSkipDirPath(path) {
return filepath.SkipDir
detect/detect.go:1538
name != "."does not reliably identify the walk root for absolute/non-dot roots, which can cause inferStyle to skip the entire project if the root directory name matches a skip dir. Computereland gate onrel != "."so the walk root is never skipped.
if d.IsDir() {
name := d.Name()
if name != "." && e.shouldSkipDirPath(path) {
return filepath.SkipDir
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
andrew
force-pushed
the
issue-135-deps-scc
branch
from
August 19, 2026 15:11
befc9da to
da15dc5
Compare
andrew
force-pushed
the
issue-135-deps-scc
branch
2 times, most recently
from
August 19, 2026 15:56
45d52e3 to
6051592
Compare
andrew
force-pushed
the
issue-135-deps-scc
branch
from
August 19, 2026 16:00
6051592 to
a13e21a
Compare
andrew
force-pushed
the
issue-135-deps-scc
branch
from
August 19, 2026 16:15
a13e21a to
7fbc6e6
Compare
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.
Skips a deps directory only for a sibling mix.exs or when Git reports no tracked files below it. Passes the resolved default and user skip directories to scc so language detection and line counts use the same exclusions. Closes #135.