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

changes.csv: check quoting #529

Open
tschmidtb51 opened this issue Apr 11, 2024 · 2 comments
Open

changes.csv: check quoting #529

tschmidtb51 opened this issue Apr 11, 2024 · 2 comments
Labels
csaf_checker enhancement New feature or request important investigation_needed This item needs investigation

Comments

@tschmidtb51
Copy link
Collaborator

Currently, the csaf_checker does not report if one of the fields in a changes.csv is not quoted. Can we change that to report this violation?

@tschmidtb51 tschmidtb51 added enhancement New feature or request csaf_checker investigation_needed This item needs investigation labels Apr 11, 2024
@lebogg
Copy link

lebogg commented Apr 25, 2024

Using the csv package from the standard library it is not possible to change that, I guess. These quotes are automatically being removed: "The beginning and ending quote are not part of the field" (see https://pkg.go.dev/encoding/csv).

One option would be to implement a io.Reader yourself. Or maybe you can build a wrapper around the CSV reader @oxisto?

@bernhardreiter
Copy link
Collaborator

@tschmidtb51 can you elaborate, why you see this as a violation?

In CSAF 2.0 there is no precise definition of the format of changes.csv, only an example file.

Assuming that other standards are a good choice to refer to, https://www.rfc-editor.org/rfc/rfc4180#page-2 is the IETF one and has

  1. Each field may or may not be enclosed in double quotes [..]

So some fields without double quotes are allowed by RFC4180. It depends on the field value.

Looking at a different standard body, e.g. https://www.w3.org/TR/sparql12-results-csv-tsv/#csv-terms has and example with fields without double quotes: https://www.w3.org/TR/sparql12-results-csv-tsv/#csv-example

As CSAF 2.0 does not add restrictions, having fields without double quotes is not a documented violation against it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csaf_checker enhancement New feature or request important investigation_needed This item needs investigation
Projects
None yet
Development

No branches or pull requests

3 participants