Description
CodjiFlo should respect the .gitattributes linguist-generated attribute to identify and handle auto-generated files in pull request diffs. GitHub uses this convention to mark files like lock files, compiled assets, and generated code that are typically collapsed in their PR diff view.
Motivation
Generated files often clutter the code review experience:
- Lock files (
package-lock.json, yarn.lock, etc.)
- Compiled/minified output (
.min.js, compiled CSS, etc.)
- Generated code (protobuf files, API client code, etc.)
- Build artifacts
By honoring linguist-generated, CodjiFlo can reduce cognitive load during code reviews by de-emphasizing these files, matching GitHub's UX behavior and improving the focus on actual code changes.
Proposed Solution
- Parse
.gitattributes: Read and parse the .gitattributes file from the PR's base commit to identify files marked with linguist-generated=true
- Mark Generated Files: Add metadata to identified generated files in the file list
- Display Treatment:
- Collapse generated files by default in the file explorer
- Visually de-emphasize them (e.g., reduced opacity, italic styling, or distinct badge)
- Optionally exclude from diff statistics (insertion/deletion counts)
- User Control: Allow users to toggle visibility/expansion of generated files if needed
Use Case
When reviewing a PR that updates dependencies, the lock file changes dominate the diff. With this feature:
- Generated file is collapsed by default
- Real code changes are immediately visible
- User can expand if they need to review the generated file
Acceptance Criteria
Description
CodjiFlo should respect the
.gitattributeslinguist-generatedattribute to identify and handle auto-generated files in pull request diffs. GitHub uses this convention to mark files like lock files, compiled assets, and generated code that are typically collapsed in their PR diff view.Motivation
Generated files often clutter the code review experience:
package-lock.json,yarn.lock, etc.).min.js, compiled CSS, etc.)By honoring
linguist-generated, CodjiFlo can reduce cognitive load during code reviews by de-emphasizing these files, matching GitHub's UX behavior and improving the focus on actual code changes.Proposed Solution
.gitattributes: Read and parse the.gitattributesfile from the PR's base commit to identify files marked withlinguist-generated=trueUse Case
When reviewing a PR that updates dependencies, the lock file changes dominate the diff. With this feature:
Acceptance Criteria
.gitattributesfile is read and parsedlinguist-generatedpatterns are identified.gitattributes.gitattributesdata