Skip to content

fix: tighten looksLikeFilePath to avoid Go import path false positives#349

Merged
claude[bot] merged 1 commit intomainfrom
claude/issue-346-20260301-0627
Mar 1, 2026
Merged

fix: tighten looksLikeFilePath to avoid Go import path false positives#349
claude[bot] merged 1 commit intomainfrom
claude/issue-346-20260301-0627

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 1, 2026

Summary

  • Rewrites the looksLikeFilePath heuristic in cmd/precompact.go to eliminate false positives from Go import paths, module paths, domain names, and version strings.
  • Paths starting with /, ./, or ../ are accepted immediately (absolute/relative local paths).
  • Bare paths (no leading slash/dot) are only accepted when the final path segment carries a recognised source-file extension (.go, .py, .ts, .js, .rs, .md, .json, .yaml, etc.).
  • github.com/foo/bar and similar import paths no longer pollute the "Files in Focus" snapshot.

Fixes #346

Generated with Claude Code

Require that a bare path (no leading / or ./) has a recognised
source-file extension on its final segment. Paths that start with /,
./, or ../ are still accepted immediately. This prevents Go import
paths (github.com/foo/bar), domain names, and version strings from
appearing in the Files in Focus snapshot.

Fixes #346

Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@claude claude bot merged commit a9136d2 into main Mar 1, 2026
1 check passed
@claude claude bot deleted the claude/issue-346-20260301-0627 branch March 1, 2026 06:47
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.

bug: looksLikeFilePath false positives — Go import paths pollute Files in Focus snapshot

0 participants