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

Fix inconsistent line endings #720

Merged
merged 2 commits into from Sep 29, 2022
Merged

Fix inconsistent line endings #720

merged 2 commits into from Sep 29, 2022

Conversation

DSchroer
Copy link
Contributor

Update the line endings across the project to be consistent.

Motivation

Some tools complain when dealing with mixed line endings. The project currently has a mix of Windows \r\n and Unix style \n.

@EdwardCooke
Copy link
Collaborator

I'm thinking a potentially better solution to this would be using .gitattributes to handle line endings. Maybe with the contents of something like this

*.sh EOL=lf
*.* EOL=crlf

I'm going off of memory here, so it may be incorrect values. But then, in theory, it'll be correct regardless of the platform (Linux aka Docker/Windows/etc) it is checked out on.

@DSchroer
Copy link
Contributor Author

Sure. Happy to add the adjusted gitattributes.

@EdwardCooke EdwardCooke merged commit 8a89745 into aaubry:master Sep 29, 2022
@aaubry
Copy link
Owner

aaubry commented Sep 29, 2022

This change broke the build - https://ci.appveyor.com/project/aaubry/yamldotnet/builds/44921032

You need to be very careful with line endings because Linux doesn't expect \r. Personally I would have preferred not touching the line endings as everything was working correctly.

@aaubry
Copy link
Owner

aaubry commented Sep 29, 2022

The the PR itself was building correctly - https://ci.appveyor.com/project/aaubry/yamldotnet/builds/44817924.
So this is probably a merge error.

@aaubry
Copy link
Owner

aaubry commented Sep 29, 2022

The run.sh file hasn't been modified. I guess it's .gitattributes that is causing the problem. I'm not familiar with this file. I always configure git to never modify my line endings. @EdwardCooke do you have an idea of how to fix this?

@EdwardCooke
Copy link
Collaborator

I'll get it fixed. Not sure why it would have failed either. gitattribes for .sh files was added a while ago.

@EdwardCooke
Copy link
Collaborator

Got it fixed. . was overriding the *.sh.

@EdwardCooke
Copy link
Collaborator

The . is going to cause additional problems I think. It looks like it may break some of the binary files, like yamldotnet.png. I think I'll remove the . and change it to *.cs to fix it for real. One second.

@EdwardCooke
Copy link
Collaborator

And when I just pushed up my changes to git attributes it pushed up the broken files, argh. Stupid gitattributes. Lesson learned there, don't do ..

@aaubry
Copy link
Owner

aaubry commented Oct 7, 2022

This feature has been released in version 12.0.2.

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

3 participants