swiftcsv / SwiftCSV

CSV parser for Swift
MIT License
951 stars 191 forks source link

Add quotes to description where required #86

Closed lukestringer90 closed 4 years ago

lukestringer90 commented 4 years ago

Currently the description property on CSV does not add quotes to values that have commas in them. This gives an incorrect representation of the CSV data as commas appear in the incorrect places.

This PR adds double quotes around to values that have commas in them when generating the description.

codecov-io commented 4 years ago

Codecov Report

Merging #86 into master will decrease coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
- Coverage   92.57%   92.53%   -0.04%     
==========================================
  Files          14       14              
  Lines         431      402      -29     
==========================================
- Hits          399      372      -27     
+ Misses         32       30       -2     
Impacted Files Coverage Δ
SwiftCSV/Description.swift 100.00% <100.00%> (ø)
SwiftCSVTests/CSVTests.swift 100.00% <100.00%> (ø)
SwiftCSVTests/EnumeratedViewTests.swift 85.71% <0.00%> (-2.86%) :arrow_down:
SwiftCSV/CSV.swift 71.42% <0.00%> (-0.67%) :arrow_down:
SwiftCSV/ParsingState.swift 96.87% <0.00%> (-0.05%) :arrow_down:
SwiftCSV/NamedView.swift 100.00% <0.00%> (ø)
SwiftCSV/EnumeratedView.swift 100.00% <0.00%> (ø)
SwiftCSV/Parser.swift 92.15% <0.00%> (+0.72%) :arrow_up:

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 22dc4dd...0fdb38a. Read the comment docs.

lukestringer90 commented 4 years ago

@DivineDominion Is there anything I can do to improve this PR?

DivineDominion commented 4 years ago

Thanks for the PR, @lukestringer90! I saw the list of commits in the email and deferred the review until I had more time -- but apparently you did only change a very small portion of the code and the rest is just noise :) I wonder how that came about.

DivineDominion commented 4 years ago

Merged!

Thanks a lot for contributing to SwiftCSV! We've invited you to join the SwiftCSV GitHub organization – no pressure to accept! If you'd like more information on what that means, check out our contributor guidelines.

lukestringer90 commented 4 years ago

Thanks @DivineDominion for accepted my PR! I saw the big list of commits as well and I wasn't sure what happened as I only made a small change.