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

Define git attributes for renormalization. #8921

Merged
merged 2 commits into from Mar 15, 2023

Conversation

trivialfis
Copy link
Member

@trivialfis trivialfis commented Mar 15, 2023

Handle text line ending automatically.

All changes are made by git 2.39.2. Git will carry out the change automatically before you commit.

Document for the behavior: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

Comment on lines +3 to +12
*.c text eol=lf
*.h text eol=lf
*.cc text eol=lf
*.cuh text eol=lf
*.cu text eol=lf
*.py text eol=lf
*.txt text eol=lf
*.R text eol=lf
*.scala text eol=lf
*.java text eol=lf
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why convert to LF even on Windows?

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 think it's just a problem of picking one in a platform-independent manner, instead of having mixed newline symbols. I accidentally removed a carriage on the partition builder, and here is the warning from cpplint for using mixed newline symbol:

src/common/partition_builder.h:371:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:372:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:373:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:374:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:375:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:376:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:377:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:378:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:379:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:380:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:381:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
src/common/partition_builder.h:382:  Unexpected \r (^M) found; better to use only \n  [whitespace/newline] [1]
 ....

@trivialfis trivialfis merged commit 26209a4 into dmlc:master Mar 15, 2023
23 checks passed
@trivialfis trivialfis deleted the git-renormalize branch March 15, 2023 18:43
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.

None yet

2 participants