Skip to content

chore: add canonical .gitattributes#2

Merged
KooshaPari merged 1 commit intomainfrom
chore/add-gitattributes
Apr 24, 2026
Merged

chore: add canonical .gitattributes#2
KooshaPari merged 1 commit intomainfrom
chore/add-gitattributes

Conversation

@KooshaPari
Copy link
Copy Markdown
Owner

@KooshaPari KooshaPari commented Apr 24, 2026

User description

Adds Phenotype-org canonical .gitattributes for LF normalization, binary handling, lockfile conflict mitigation, and export-ignore. Sister to #226 .editorconfig bootstrap. Harmless for file types not present in repo.


Note

Low Risk
Low risk: adds repository Git attribute rules only; the main impact is potential line-ending normalization and diff behavior on future checkouts/commits.

Overview
Adds a new canonical .gitattributes to enforce LF normalization for text files (with CRLF preserved for Windows scripts), mark common asset formats as binary, and disable diffs for lockfiles.

Also sets export-ignore for dev-only directories (e.g., .github/, .vscode/, tests/) when generating release archives.

Reviewed by Cursor Bugbot for commit b2dd740. Bugbot is set up for automated code reviews on this repo. Configure here.


CodeAnt-AI Description

Add repository file rules for line endings, binary files, lockfiles, and release archives

What Changed

  • Text files are now normalized to LF on commit, while Windows script files keep CRLF when checked out on Windows
  • Common image, archive, font, and PDF files are treated as binary so they are not reformatted
  • Lockfiles are handled to avoid noisy diffs and merge conflicts
  • Release archives now exclude dev-only folders like .github/, .vscode/, and tests/

Impact

✅ Cleaner commits from line-ending normalization
✅ Fewer lockfile merge conflicts
✅ Smaller release archives

🔄 Retrigger CodeAnt AI Review

Details

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@KooshaPari KooshaPari merged commit b85ec2d into main Apr 24, 2026
1 of 2 checks passed
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Apr 24, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@KooshaPari KooshaPari deleted the chore/add-gitattributes branch April 24, 2026 22:00
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Warning

Rate limit exceeded

@KooshaPari has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 33 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 34 minutes and 33 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cfc01aeb-8fdf-44f0-bd47-e5a27e3a42e2

📥 Commits

Reviewing files that changed from the base of the PR and between f348043 and b2dd740.

📒 Files selected for processing (1)
  • .gitattributes
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-gitattributes
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/add-gitattributes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Apr 24, 2026
Comment thread .gitattributes
Comment on lines +39 to +44
Cargo.lock -diff
package-lock.json -diff
bun.lockb binary
yarn.lock -diff
pnpm-lock.yaml -diff
uv.lock -diff
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The lockfile rules only disable diffs but do not disable text normalization, so these files are still subject to * text=auto eol=lf (and *.json text eol=lf for package-lock.json). That means bytes can still be rewritten on checkout/commit, which contradicts the intended "preserve exact bytes" behavior. Add -text (and optionally binary) to lockfile entries that must remain byte-for-byte stable. [logic error]

Severity Level: Major ⚠️
- ⚠️ Future lockfiles will have line endings normalized by Git.
- ⚠️ Cross-platform clones may see spurious lockfile churn.
- ⚠️ Behavior contradicts documented intent to preserve exact bytes.
Steps of Reproduction ✅
1. Open `.gitattributes` at the repo root and observe the global rule `* text=auto eol=lf`
on line 3, which enables text normalization for all files by default.

2. In the same file, observe the lockfile entries on lines 39–44 (`Cargo.lock`,
`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `uv.lock`) which specify only `-diff`
(and no `-text` or `binary`), meaning they do not override the global `text=auto eol=lf`
attribute.

3. Note via a repository search (no `*lock*` files currently found under
`/workspace/TestingKit`) that there are currently no lockfiles present, so this is a
latent configuration issue that will apply as soon as a matching lockfile (e.g.,
`package-lock.json`) is added to the repo.

4. Once a matching lockfile is added in the future, Git will apply both the global `*
text=auto eol=lf` rule and the per-file `-diff` rule: diffs will be disabled, but line
endings for the lockfile will still be normalized according to `eol=lf` (and converted on
checkout on platforms with native CRLF), contradicting the stated comment on line 38 that
lockfiles should "preserve exact bytes"; adding `-text` (or `binary`) to these lockfile
entries would align behavior with the comment by disabling normalization for them.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** .gitattributes
**Line:** 39:44
**Comment:**
	*Logic Error: The lockfile rules only disable diffs but do not disable text normalization, so these files are still subject to `* text=auto eol=lf` (and `*.json text eol=lf` for `package-lock.json`). That means bytes can still be rewritten on checkout/commit, which contradicts the intended "preserve exact bytes" behavior. Add `-text` (and optionally `binary`) to lockfile entries that must remain byte-for-byte stable.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Apr 24, 2026

CodeAnt AI finished reviewing your PR.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit b2dd740. Configure here.

Comment thread .gitattributes
# Release archives exclude dev-only dirs
.github/ export-ignore
.vscode/ export-ignore
tests/ export-ignore
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Trailing slashes break export-ignore directory patterns

High Severity

The export-ignore patterns for .github/, .vscode/, and tests/ use trailing slashes. Git's export-ignore patterns with trailing slashes do not recursively exclude directory contents. As a result, git archive will still include these directories, contrary to the intent of excluding dev-only files from release archives.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b2dd740. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant