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

Normalize "\r\n" to "\n" to ensure ^ and $ match line boundaries #92

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

mgeisler
Copy link
Owner

@mgeisler mgeisler commented Jul 7, 2020

The regex crate only considers "\n" a line boundary, so ^ and $ don't
match "\r\n". This can be a problem if code is checked out on Windows
and Git helpfully rewrites your "\n" to "\r\n". I ran into this
problem when testing GitHub Actions on the textwrap repository.

See rust-lang/regex#244.

@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2020

Codecov Report

Merging #92 into master will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #92      +/-   ##
==========================================
+ Coverage   93.54%   93.64%   +0.09%     
==========================================
  Files           5        5              
  Lines         403      409       +6     
==========================================
+ Hits          377      383       +6     
  Misses         26       26              
Impacted Files Coverage Δ
src/contains_regex.rs 100.00% <100.00%> (ø)
src/helpers.rs 93.75% <100.00%> (ø)

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 f0d5eb7...fee29b2. Read the comment docs.

The regex crate only considers "\n" a line boundary, so ^ and $ don't
match "\r\n". This can be a problem if code is checked out on Windows
and Git helpfully rewrites your "\n" to "\r\n". I ran into this
problem when testing GitHub Actions on the textwrap repository.

See rust-lang/regex#244.
@mgeisler mgeisler merged commit ba00157 into master Jul 7, 2020
@mgeisler mgeisler deleted the windows-line-boundaries branch February 14, 2021 16:41
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.

None yet

2 participants