Skip to content

Scope deps skips and scc exclusions - #141

Merged
andrew merged 1 commit into
mainfrom
issue-135-deps-scc
Aug 19, 2026
Merged

Scope deps skips and scc exclusions#141
andrew merged 1 commit into
mainfrom
issue-135-deps-scc

Conversation

@andrew

@andrew andrew commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sibling mix.exs and Git tracked-file presence.
  • Introduces sccArgs() to pass resolved default/user skip directories (and VCS dirs) to scc --exclude-dir.
  • Adds tests covering deps/ skip behavior and scc exclusion 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 computed rel (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. Compute rel and gate on rel != "." 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.

Comment thread detect/detect.go
Comment thread detect/detect.go
@andrew
andrew force-pushed the issue-135-deps-scc branch from befc9da to da15dc5 Compare August 19, 2026 15:11
@andrew
andrew force-pushed the issue-135-deps-scc branch 2 times, most recently from 45d52e3 to 6051592 Compare August 19, 2026 15:56
@andrew
andrew force-pushed the issue-135-deps-scc branch from 6051592 to a13e21a Compare August 19, 2026 16:00
Base automatically changed from issue-137-meson-python to main August 19, 2026 16:15
@andrew
andrew force-pushed the issue-135-deps-scc branch from a13e21a to 7fbc6e6 Compare August 19, 2026 16:15
@andrew
andrew merged commit 3fa1f74 into main Aug 19, 2026
15 checks passed
@andrew
andrew deleted the issue-135-deps-scc branch August 19, 2026 16:28
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.

deps/ in default skip list hides non-Elixir vendored code and disagrees with scc

2 participants