Skip to content

fix: exclude symlinks from tracked files list - #146

Merged
dclong merged 1 commit into
mainfrom
push-npnrrquplkqy
Sep 28, 2026
Merged

dclong merged 1 commit into
mainfrom
push-npnrrquplkqy

Conversation

@dclong

@dclong dclong commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fix(lint_repo): exclude symlinks from tracked files list

Changed files

Modified

  • github_rest_api/scripts/lint_repo.py (+12/-1)
  • tests/test_lint_repo.py (+10/-0)

Commits

  • 1bb9245 fix(lint_repo): exclude symlinks from tracked files list

@dclong

dclong commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

Claude finished @dclong's task in 1m 41s —— View job


Code Review: exclude symlinks from tracked files list

Tasks

  • Gather context (PR diff, changed files, CLAUDE.md)
  • Run code review on the PR
  • Post review findings and merge decision

Summary

The change to list_tracked_files() in github_rest_api/scripts/lint_repo.py filters out symlink entries from the git index using stat.S_ISLNK(entry.mode), so a tracked symlink (e.g. CLAUDE.md → AGENTS.md) is no longer linted separately from its target. This avoids double-linting / conflicting lint options on the same content, as explained in the new docstring.

Findings

  • Correctness: Verified against dulwich's Index/IndexEntry API (dulwich 1.1.0, per uv.lock). Index.items() yields (path, entry) pairs; IndexEntry.mode is a plain int with the symlink bit at 0o120000, so stat.S_ISLNK(entry.mode) correctly detects tracked symlinks. The isinstance(entry, IndexEntry) guard safely keeps non-standard entries (e.g. mid-merge conflict entries, which dulwich represents differently and have no single mode) rather than risking an AttributeError or mis-filtering them — this matches the added inline comment.
  • Test coverage: tests/test_lint_repo.py:61-68 adds a focused test that creates a real symlink, confirms it is present in the raw git index (so the test would fail if git itself stopped tracking it), and then asserts list_tracked_files excludes it while keeping the target. This is a good regression test.
  • Scope: list_tracked_files has a single call site (lint_repo.py:662), so there's no other consumer that might have relied on symlinks being included.
  • Style/docs: The updated docstring clearly explains the why (avoiding double/conflicting lint runs), consistent with the file's existing documentation conventions.

No bugs, regressions, or missing edge cases were found. This is a small, well-scoped, well-tested fix.
· Branch

AUTO_MERGE_APPROVED

@dclong
dclong merged commit 57d066a into main Sep 28, 2026
13 checks passed
@dclong
dclong deleted the push-npnrrquplkqy branch September 29, 2026 16:24
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.

1 participant