Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add .gitattributes file #806

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

xsahil03x
Copy link
Member

This pull request includes a change to the .gitattributes file to improve the handling of generated files in diffs. The most important change is the addition of rules to skip generated files from showing up in diffs.

Changes to .gitattributes:

  • Added rules to mark various types of generated Dart files (.g.dart, .freezed.dart, .pb.dart, .pbenum.dart, .pbjson.dart, .pbserver.dart, .pbtwirp.dart) as linguist-generated, so they are excluded from diffs.

@xsahil03x xsahil03x requested a review from a team as a code owner December 10, 2024 11:33
@xsahil03x xsahil03x requested a review from Brazol December 10, 2024 11:33
@xsahil03x
Copy link
Member Author

@Brazol , do you think we should also add the coordinator client too in this list?

# Skip generated files from showing up in diffs.
**/*.g.dart linguist-generated=true
**/*.freezed.dart linguist-generated=true
**/*.pb.dart linguist-generated=true
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about pb files. They don't change often - only when regenerated and then we do want to see them in diff.

Copy link
Member Author

Choose a reason for hiding this comment

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

I mean we can't really identify any issues in a generated code, unless we run it locally. It's also skipped from analyzer.

https://github.com/GetStream/stream-video-flutter/blob/main/analysis_options.yaml#L15

Copy link
Contributor

Choose a reason for hiding this comment

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

True, and the analyzer makes sense. The thing is that we have some manual changes there that should be reapplied after regeneration. So it's good to have it in diff so that another pair of eyes can check if. by accident, some manual change wasn't removed.

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.

2 participants