Skip to content

Fix detection of CRLF line endings #2357

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

Merged
merged 3 commits into from
Feb 18, 2020
Merged

Fix detection of CRLF line endings #2357

merged 3 commits into from
Feb 18, 2020

Conversation

3flex
Copy link
Member

@3flex 3flex commented Feb 17, 2020

Corrects logic to check that the character before the last '\n' is '\r', and if so, correctly report CRLF ("\r\n") line endings.

The current logic is checking the same character position that '\r' was found in also contains '\n' which always evaluates to false.

@codecov-io
Copy link

codecov-io commented Feb 17, 2020

Codecov Report

Merging #2357 into master will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2357      +/-   ##
============================================
+ Coverage     82.35%   82.37%   +0.01%     
  Complexity     2134     2134              
============================================
  Files           349      349              
  Lines          6058     6058              
  Branches       1110     1110              
============================================
+ Hits           4989     4990       +1     
  Misses          489      489              
+ Partials        580      579       -1
Impacted Files Coverage Δ Complexity Δ
...lin/io/gitlab/arturbosch/detekt/core/KtCompiler.kt 88.88% <0%> (+3.7%) 6 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7780548...54e36bb. Read the comment docs.

@arturbosch arturbosch added this to the 1.6.0 milestone Feb 18, 2020
@arturbosch arturbosch merged commit 1af1e34 into master Feb 18, 2020
@arturbosch arturbosch deleted the crlf_detection branch February 18, 2020 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants