kentcdodds / react-workshop-app

An abstraction for all my React workshops
https://kentcdodds.com/workshops
MIT License
149 stars 37 forks source link

fix: update regex to support carriage return #7

Closed marcosvega91 closed 4 years ago

marcosvega91 commented 4 years ago

What: Regex that checks title and extra title are not working as expected when using CRLF termination of line. This issue was discovered by @sleepyArpan as discussed on discord

Why: Because the string should end with a carriage return

How: I have update the regex to work also with carriage return by adding [\r]{0,1} at the end of the regex

Checklist:

codecov[bot] commented 4 years ago

Codecov Report

Merging #7 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #7   +/-   ##
=======================================
  Coverage   82.02%   82.02%           
=======================================
  Files           4        4           
  Lines          89       89           
  Branches       18       18           
=======================================
  Hits           73       73           
  Misses         13       13           
  Partials        3        3           
Impacted Files Coverage Δ
src/load-files.js 100.00% <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 5f3bb15...790da4a. Read the comment docs.

kentcdodds commented 4 years ago

Thanks for this! My preferred solution though is to add .gitattributes to reach repository so the line endings are consistent and we don't have other problems like this.

https://github.com/kentcdodds/react-workshop-app/blob/master/.gitattributes

Would you be interested in that?

marcosvega91 commented 4 years ago

Yes of course. I have closed this and I'll open a pr on the other side

kentcdodds commented 4 years ago

Thanks!