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

Obey gitattributes line endings when writing snapshots #90

Closed
skuzzle opened this issue Mar 23, 2023 · 1 comment
Closed

Obey gitattributes line endings when writing snapshots #90

skuzzle opened this issue Mar 23, 2023 · 1 comment
Labels
component: core enhancement New feature or request
Milestone

Comments

@skuzzle
Copy link
Owner

skuzzle commented Mar 23, 2023

Our current policy for line endings is: Snapshot serializers should produce system-independent line endings. This should, in theory to reproducible snapshots even on different systems.
There is an issue though when using git. Git has its own opinion about line endings on local machines. Depending on various settings, Git might convert line endings during checkout/checkin of files. This conversion might lead to unwanted failures during snapshot comparison.

As such, snapshot serializers should probably produce line endings in accordance to the local git repository settings.

Question remains whether we should introduce an extra dependency to handle the evaluation of git config or whether we want to implement it on our own.

See also: https://github.com/diffplug/spotless/blob/a92c7b04be4e2d1a896555c302505b903deae2fe/lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java#L65

@skuzzle
Copy link
Owner Author

skuzzle commented Mar 24, 2023

Relates to #44

@skuzzle skuzzle added the enhancement New feature or request label Mar 27, 2023
@skuzzle skuzzle added this to the 1.10.0 milestone Mar 27, 2023
skuzzle added a commit that referenced this issue Mar 27, 2023
@skuzzle skuzzle closed this as completed Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant