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: unify line endings for all files for any new clone #2541

Merged
merged 2 commits into from
Mar 30, 2023
Merged

chore: unify line endings for all files for any new clone #2541

merged 2 commits into from
Mar 30, 2023

Conversation

ShuiRuTian
Copy link
Contributor

Summary

Motivation: To make .x file work under Linux.

What is changed: The files will be created with "LF" for any new clone, existing files will not be changed. About the details, please reference this great article about CRLF and LF: https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/

Have to say I am kind of confused, the CONTRIBUTING.md seems to be prepared for Linux, but ".x" is using CRLF as line endings, which make it complains "env: node\r: No such file". Note the strange "\r", which is the problem.

We cloud also add such content to .editorconfig to express intension better, I do not add it for now:

[*]
end_of_line = lf

This should not cause any problem in Windows, there is no "bat" or "cmd" file in the repo.

Related issue (if exists)

Types of changes

Not sure, I guess it's "refactoring"?

  • Docs change / Dependency upgrade
  • Bug fix
  • New feature / Improvement
  • Refactoring
  • Breaking change

Checklist

Does this change need to fill these checkbox?

  • I have added changeset via pnpm run changeset.
  • I have added tests to cover my changes.

@changeset-bot
Copy link

changeset-bot bot commented Mar 29, 2023

⚠️ No Changeset found

Latest commit: 1ff1087

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Mar 29, 2023

CLA assistant check
All committers have signed the CLA.

@hyf0
Copy link
Contributor

hyf0 commented Mar 30, 2023

IMO, we should enforce end_of_line = lf rather than auto. By the way, we are going to remove ./x, which causes too many cross-platform problems.

@hyf0
Copy link
Contributor

hyf0 commented Mar 30, 2023

Could you sign the CLA?

And after discussing with the @web-infra-dev/rspack, we think it's better to enforce the end of line with LF.

@ShuiRuTian
Copy link
Contributor Author

CLA Signed.

I still keep the change in .gitattributes, because in an editor like VSCode, you need an extension to make the file ".editorconfig" work. Then the change in .gitattributes provide a good default behavior.

.gitattributes Show resolved Hide resolved
@hyf0 hyf0 self-assigned this Mar 30, 2023
@hyf0
Copy link
Contributor

hyf0 commented Mar 30, 2023

Thanks for your contribution! Learn a lot about the line endings :).

@hyf0 hyf0 changed the title Unify line endings for all files for any new clone chore: unify line endings for all files for any new clone Mar 30, 2023
@hyf0 hyf0 merged commit ea689d4 into web-infra-dev:main Mar 30, 2023
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.

3 participants