cuttle-cards / cuttle

A two-player battle card game for all ages, built with nodejs, sailsjs, and vuejs
MIT License
145 stars 115 forks source link

[DevEx]: Standardize line endings to use unix-style LF line endings #1082

Closed itsalaidbacklife closed 1 month ago

itsalaidbacklife commented 1 month ago

Improvement Summary

We should configure git to standardize the use of line endings so that both windows users and unix-system users create liens with LF line endings.

Detailed Description

Windows systems by default use CLLF line endings while mac + unix machines us just LF line endings. We should standardize the git config to ensure that all files are using LF and that windows systems do not change these to CRLF. To do so:

  1. Set the Git configuration for the repository: In the terminal or Git Bash, navigate to the repository directory and set the following Git config:

Set the Git configuration for the repository:

git config core.autocrlf false

Ensure all files in the repository use LF line endings:

To ensure all files are using LF line endings, you can refresh the working directory with correct line endings:

git rm --cached -r .
git reset --hard

This removes the cached version of all files, then checks them back out from the index with Unix-style LF line endings.

Add a .gitattributes file

Create a .gitattributes file in the root of your repository with the following content to explicitly enforce LF line endings for all files:

* text eol=lf

Summary: