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

Some files have CRLF line endings #224

Closed
baconpaul opened this issue Jan 6, 2019 · 9 comments
Closed

Some files have CRLF line endings #224

baconpaul opened this issue Jan 6, 2019 · 9 comments
Labels
Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme

Comments

@baconpaul
Copy link
Collaborator

adding audio wav reader I noticed emacs was saying (DOS) in the corner. So

paul:~/dev/music/surge$ find src -not -type d -exec file "{}" ";" | grep CRLF
src/common/SampleLoadRiffWave.cpp: c program text, ASCII text, with CRLF, CR line terminators
src/common/SurgeStorageLoadWavetable.cpp: c program text, ASCII text, with CRLF, CR line terminators
src/common/gui/CParameterTooltip.h: C++ source text, ASCII text, with CRLF, CR line terminators
src/common/gui/CSwitchControl.cpp: c program text, ASCII text, with CRLF, CR line terminators
src/common/gui/CNumberField.cpp: c program text, ASCII text, with CRLF, CR line terminators
src/common/dsp/effect/RotarySpeakerEffect.cpp: c program text, ASCII text, with CRLF, CR line terminators
src/common/dsp/effect/VocoderEffect.cpp: c program text, ASCII text, with CRLF line terminators
src/common/dsp/LfoModulationSource.cpp: c program text, ASCII text, with CRLF line terminators
src/common/dsp/DspUtilities.h: C++ source text, ASCII text, with CRLF line terminators

someone want to dos2unix those one day?

@baconpaul baconpaul added the Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme label Jan 6, 2019
@esaruoho
Copy link
Collaborator

esaruoho commented Jan 6, 2019

@baconpaul i could try it, but how? does sublime editor help me do this stuff easily? :)

@baconpaul
Copy link
Collaborator Author

dos2unix is a command line that will do it. So

  • brew install dos2unix
  • git checkout -b crlf-fix-224
  • (foreach file) dos2unix -o file
  • run that find again to see if you got em all. If not more dos2unix.
  • check it builds look at diffs
  • commit, push to origin, pr

is basically the 20 minutes of work that needs done

@jarkkojs
Copy link
Collaborator

jarkkojs commented Jan 6, 2019

That kind of clean ups have the side-effect making git blame harder to use. Better check from upcoming commits that they don't have CRLF.

Better to do clean ups in small scale e.g. clean up only the code blocks that you do something actually useful.

@baconpaul
Copy link
Collaborator Author

Ugh except for “smart” tools which use crlf when crlf is present. And other smart tools which fix them for you everywhere when you edit one line. We can have one minute of blame pain and get over it

But I’m fine to not do this if you really object. Just makes my life mildly irritating in my toolchain while I’m doing wav file on Mac

@baconpaul
Copy link
Collaborator Author

Ahh and another bit of annoyance. Xcode (or really I guess clang) counts line numbers differently than emacs in crlf mixed mode so errors don’t match line Goto numbers between compiler and editor :(

Now my irritation and weird non alignment from yesterday makes sense!

@jarkkojs
Copy link
Collaborator

jarkkojs commented Jan 7, 2019

Came to other thoughts. Probably most CRLF's are from the original code dump so it should cause minimal irritation to do this. No objections.

@baconpaul
Copy link
Collaborator Author

Ok cool! I’m also glad the line number mystery from Saturday now makes sense!

@baconpaul
Copy link
Collaborator Author

screen shot 2019-01-07 at 9 06 04 am

Ha! Look at that. clang has different line numbers than emacs and nl. How odd.

@baconpaul
Copy link
Collaborator Author

ANyway, now they don't any more. Checked build all platforms and pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme
Projects
None yet
Development

No branches or pull requests

3 participants