Data-Liberation-Front / csvlint.rb

The gem behind http://csvlint.io
MIT License
287 stars 87 forks source link

Fix foreign key row reporting and empty table checks #193

Open nickzoic opened 7 years ago

nickzoic commented 7 years ago

Fix foreign key row reporting

My previous PR added a 'row' to the FK error, but it turned out to be wrong in many cases as it was actually a count of how many unique FK refs there were: this version generates a separate error record per FK violation and thus gives better feedback. To do this is keeps a list of all rows which use a foreign key, which will use slightly more memory than before, but it also uses a hash to store the known values which should be somewhat quicker.

Run FK checks even if a table is empty

Previously, if any tables were empty (eg: a header but 0 rows) they wouldn't be marked as "valid" internally, so FK checks would not run. This PR fixes that by marking an empty table with a valid header as valid. This was originally PR #190 but these issues are entangled so I'm closing that one and submitting this merged PR.

nickzoic commented 7 years ago

Ummm, Travis CI doesn't seem to be working again ...

pezholio commented 7 years ago

Hmmm... That's weird. I can't replicate this locally. Will try and dig in to see what's going on...

veryrusty commented 2 years ago

Closing this; The :master branch in the remote repo has other changes beyond the original PR.