SamuraiAku / SPDX.jl

Provides for the creation, reading and writing of SPDX files in multiple file formats. Written in pure Julia.
MIT License
5 stars 1 forks source link

Strip leading and trailing whitespace from single word fields #15

Closed SamuraiAku closed 1 year ago

SamuraiAku commented 2 years ago

For example SpdxAnnotationV2.Type can be REVIEW or OTHER and is just a string. When reading from a file, it's possible for the field to have leading or trailing whitespace that should be removed, especially in TagValue.

Fields that have multiple words in them (ex. SHA1: d6a770ba38583ed4bb4525bd96e50461655d2759 ) are processed by Regexes that look for and strip the extra whitespace already. These single word fields generally do not.

Possibly this is a good candidate for a macro.

SamuraiAku commented 1 year ago

Actually strip() should do the job.

SamuraiAku commented 1 year ago

Commits 5b301092 and db9457a8e resolve this issue for reading from JSON and TagValue files.

SamuraiAku commented 1 year ago

Also 0f9dee5d2bc