I'm currently developing for a Ruby on Rails application. I am on a windows machine, using ubuntu through WSL. We have rubocop setup to track formatting on git pushes, and I always run into the same issue. When adding this comment to the top of any file, I receive the error Layout/EndOfLine: Carriage return character detected
. The issue seems to be talked about here as well Layout/EndOfLine: Carriage return character detected. module TieConnector
# frozen_string_literal: true
The solution here seems to be to disable the warning, or manually convert the files before pushing.
Does anyone know if there is another solution here? I don't believe I can edit the rubocop settings as it is not my project. The converting method does work, but gets a bit tedious to do every time I make a new pull request.
Would there be a way to run the dox2unix convert when running git push
while targeting the files staged for commit? Or a way to force my machine to use the unix encoding by default?
Any help is appreciated, thank you