-
Notifications
You must be signed in to change notification settings - Fork 40
Do not report CRLF sequences in Layout/TrailingWhitespace rule
#627
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,7 @@ module Ameba | |
| # source = Ameba::Source.new "a = 1\nb = 2", path | ||
| # source.lines # => ["a = 1", "b = 2"] | ||
| # ``` | ||
| getter lines : Array(String) { code.split('\n') } | ||
| getter lines : Array(String) { code.split(/\r?\n/) } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason not to use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, str = <<-TEXT
foo
bar\t
TEXT
str.lines # => ["foo ", "bar\t", ""]
str.split(/\r?\n/) # => ["foo ", "bar\t", "", ""]
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that really relevant, though?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On a related note, why the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think both interpretations are valid. There's no clear answer whether The documentation is certainly sparse on this, though.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. Having a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR to improve docs: crystal-lang/crystal#15894 |
||
|
|
||
| # Returns AST nodes constructed by `Crystal::Parser`. | ||
| # | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.