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

Add quotes to description where required #86

Merged
merged 30 commits into from
Apr 11, 2020

Conversation

lukestringer90
Copy link
Contributor

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.

DivineDominion and others added 29 commits April 25, 2019 18:26
* compatible swift3

* Merge pull request swiftcsv#2 from phpmaple/master

* unify framework build settings for Xcode 8/Swift 3

* convert tests to Swift 3

* configure travis for Xcode 8

* lower deployment target

* Merge pull request #1 from DivineDominion/swift-3
    - fix Swift 3 conversion
* rename columns to namedColumns

* move public interface properties into CSV.swift

* move "named" field access to NamedView

The parse() helper method masked the fact that rows and columns
used to be lazily initialized; with NamedView as the base for both
computed properties, a lazy initializer works just as well.

* refactor enumerateAsArray into a static function

* change CSV.header to be computable in the initializer

The new static enumeration function helps make it possible to not
keep `header` as a mutable force-unwrapped optional.

* fix Swift documentation

* rename parsing elements

* refactor parse helpers

* extract parsing state machine

* rename CSV.rows to .namedRows

* add EnumeratedView as a complementary to hash-based storage
* update code to Swift 4

* update project settings to Swift 4.1

* update to Swift 4.2

* update Travis CI settings

* update newline detection for macOS
* update scheme names

* update Travis CI script

* make scheme names more canonical to platform names

* remove unused setting
* update project settings

* migrate to Swift 5

* add Swift 5 targets to travis

* add tvOS 3 to targeted device families

* use latest CocoaPods to support #swift_versions

* fix failing tests (unsorted dictionary keys)
* make ParsingState throw instead of fatalError'ing out

- extract enumerateAsDict as static
- extract "view" creation into static helpers

* extract view creation into initializer, adding a View protocol

* fix tests for throwing

* update README to show the API and errors

* include meta files in the project

* add commented-out test back in
* add SwiftPackageManager support.
* add resourcehelper's file reference to fix test error in SwiftPM
* remove unused Variant type

* disambiguate init(name:) to mean resource name, not file paths

Fixes swiftcsv#39
@lukestringer90 lukestringer90 marked this pull request as ready for review April 4, 2020 12:27
@codecov-io
Copy link

codecov-io commented Apr 4, 2020

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%) ⬇️
SwiftCSV/CSV.swift 71.42% <0.00%> (-0.67%) ⬇️
SwiftCSV/ParsingState.swift 96.87% <0.00%> (-0.05%) ⬇️
SwiftCSV/NamedView.swift 100.00% <0.00%> (ø)
SwiftCSV/EnumeratedView.swift 100.00% <0.00%> (ø)
SwiftCSV/Parser.swift 92.15% <0.00%> (+0.72%) ⬆️

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
Copy link
Contributor Author

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

@DivineDominion
Copy link
Contributor

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 DivineDominion merged commit 68f2d07 into swiftcsv:master Apr 11, 2020
@DivineDominion
Copy link
Contributor

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
Copy link
Contributor Author

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.

@lukestringer90 lukestringer90 deleted the description-with-quotes branch April 11, 2020 08:58
@lukestringer90 lukestringer90 mentioned this pull request Apr 12, 2020
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.

4 participants