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

Make Style/EndOfLine configurable #3800

Closed
jonas054 opened this issue Dec 19, 2016 · 5 comments
Closed

Make Style/EndOfLine configurable #3800

jonas054 opened this issue Dec 19, 2016 · 5 comments

Comments

@jonas054
Copy link
Collaborator

Based on discussions in #3401, I propose to add the following configuration option:

Style/EndOfLine:
  EnforcedStyle: lf
  SupportedStyles:
    - lf
    - crlf
    - native

The native option means crlf on Windows and lf on other platforms, and is the best choice for people running on Windows with core.autocrlf = true, if they are using git.

@poliva83
Copy link

poliva83 commented Jan 4, 2017

@jonas054, will lf be the default configuration?

@jonas054
Copy link
Collaborator Author

jonas054 commented Jan 4, 2017

I guess so. It's the rule in the style guide.

@poliva83
Copy link

poliva83 commented Jan 4, 2017

I'd propose native makes more sense as the default as that was the behaviour <= 0.42.0. But I can probably get by with just setting it to native in some .rubocop.yml boilerplate used by all my git projects.

@abotalov
Copy link

abotalov commented Jan 18, 2017

I think native should be default because core.autocrlf = true is said to be a recommended setting for Windows in Github docs and Git Book

native setting is fully compatible with the Ruby Style guide rule:

If you're using Git you might want to add the following configuration setting to protect your project from Windows line endings creeping in:
$ git config --global core.autocrlf true

(core.autocrlf = true replaces LF with CRLF in all files on Windows)

@jonas054
Copy link
Collaborator Author

@poliva83 @abotalov I agree. Having native as default makes sense. My computer is being repaired. I'll take a look at this when I get it back, unless somebody else beats me to it.

jonas054 added a commit to jonas054/rubocop that referenced this issue Jan 25, 2017
…efault

This style acts as crlf when RuboCop is run on Windows
and lf on other platforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants