Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

eclint gets confused by multiple line ending #159

Open
maxthiel opened this issue May 16, 2019 · 2 comments
Open

eclint gets confused by multiple line ending #159

maxthiel opened this issue May 16, 2019 · 2 comments

Comments

@maxthiel
Copy link

maxthiel commented May 16, 2019

When trying to fix a file that contains multiple type of line ending, eclint appears to get confused and remove a lot of content.

original
Content of the file:

using my.name.space;



namespace my.other.name.space

{

    public class MyClass : IMyInterface { }

    public class MyOtherClass : IMyInterface { }

    public class MyOtherOtherClass : IMyInterface { }
}

As you can see, copy pasting from notepad++ to github already messes with things.
Note that the file is also in UTF-8 + bom.

The .editorConfig is set this way:

[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

When doing eclint check the result are as follow:

testClass.cs
    01:01 ❌️ invalid charset: utf-8-bom, expected: utf-8
                                                         (EditorConfig charset                  https://goo.gl/hK94EO)
    01:01 ❌️ unexpected trailing whitespace             (EditorConfig trim_trailing_whitespace https://goo.gl/oo8iVb)
    02:01 ❌️ unexpected trailing whitespace             (EditorConfig trim_trailing_whitespace https://goo.gl/oo8iVb)
    03:01 ❌️ unexpected trailing whitespace             (EditorConfig trim_trailing_whitespace https://goo.gl/oo8iVb)
    06:01 ❌️ unexpected trailing whitespace             (EditorConfig trim_trailing_whitespace https://goo.gl/oo8iVb)
    07:01 ❌️ unexpected trailing whitespace             (EditorConfig trim_trailing_whitespace https://goo.gl/oo8iVb)
    09:01 ❌️ unexpected trailing whitespace             (EditorConfig trim_trailing_whitespace https://goo.gl/oo8iVb)

When doing eclint fix the fixed file looks like this:
fixed

The code itself:

{



    public class MyOtherOtherClass : IMyInterface { }

Attaching the files as well:
eclint_crlf_issue.zip

@nschonni
Copy link

end_of_line = crlflocal vm)

That doesn't look like a valid option. From editorconfig.org "end_of_line: set to "lf", "cr", or "crlf" to control how line breaks are represented."

@maxthiel
Copy link
Author

Indeed, thanks for spotting it!
That was a typo in my comment, the editorConfig was configured with crlf.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants