Commit Graph

6 Commits

Author SHA1 Message Date
Philippe Scorsolini d95d8e0cca tests: move FuzzParse to separate file
Co-authored-by: Lovro Sviben <46844730+lsviben@users.noreply.github.com>
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
2023-03-16 22:26:08 +01:00
Philippe Scorsolini 5a5939990b
tests(fuzz): add FuzzParse test case
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
2023-03-13 11:26:30 +01:00
hasheddan d76ee9b025
Ignore empty YAML documents in parser
If a document contains only whitespace and we are not able to decode it
into one of the supported schemas, we ignore it and continue. We want to
avoid skipping a type that does not have a registered schema so that we
do not silently ignore errors when package building, but we consider it
safe to assume that a YAML document with no content is safe to skip.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2021-06-09 10:56:24 -05:00
hasheddan 2d0e327a89
Add SkipEmpty FilterFn
The FsReadCloser claimed to implictly skip empty files, but this was
only true when the final file to be read was empty. This updates to add
a SkipEmpty option that will filter out empty files before even
attempting to read file contents.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-12-08 16:16:48 -06:00
hasheddan 94f307fb2a
Rename DefaultParser to PackageParser
DefaultParser is not descriptive of the Parser implementation's purpose.
PackageParser indicates the this parser is meant for parsing packages.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-10-03 09:56:13 -05:00
hasheddan 49da505413
Add package parser
Adds a package parser and a variety of backends that reads from a YAML
stream, accepting objects that are either part of the meta or object
runtime.Scheme and returning them as a Package.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-04 19:59:50 -05:00