csvlint.rb icon indicating copy to clipboard operation
csvlint.rb copied to clipboard

Fix foreign key row reporting and empty table checks

Open nickzoic opened this issue 8 years ago • 3 comments

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 avatar Dec 09 '16 02:12 nickzoic

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

nickzoic avatar Dec 09 '16 02:12 nickzoic

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

pezholio avatar Dec 09 '16 17:12 pezholio

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

veryrusty avatar Jun 02 '22 01:06 veryrusty