Skip to content

fix(pr): skip linguist-generated files before highlighting - #604

Open
floze-the-genius wants to merge 1 commit into
agavra:mainfrom
floze-the-genius:fix/588-linguist-generated
Open

fix(pr): skip linguist-generated files before highlighting#604
floze-the-genius wants to merge 1 commit into
agavra:mainfrom
floze-the-genius:fix/588-linguist-generated

Conversation

@floze-the-genius

Copy link
Copy Markdown

Fixes #588.

What changed

  • Resolve linguist-generated through Git's attribute matcher when a PR has a matching local checkout.
  • Exclude generated files in the unified-diff parser before their hunks are materialized or syntax highlighted.
  • Use the same filtered path for initial PR loading and commit-range reloads.
  • Document the local-checkout behavior and cover true, bare, false, and unspecified attribute values.

This is intentionally narrower than #525: that PR adds optional post-load collapsing and review-progress behavior. The change here addresses the #588 stall specifically by preventing generated files from reaching syntax highlighting at all.

Verification

  • Regression test failed before the fix (2 files loaded instead of 1) and passes after it; the retained Rust file still has highlighted spans.
  • cargo check
  • cargo fmt --all --check
  • cargo clippy -- -D warnings
  • cargo test (1473 passed, 0 failed, 2 ignored)
  • Dogfooded with cargo run -- --no-update-check against this branch's own six-file diff.

AI assistance

Implemented and reviewed with OpenAI Codex. I verified the behavior, tests, full diff, and final commit locally.

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.

Honor linguist-generated=true in .gitattributes

1 participant