Commit Graph

9 Commits

Author SHA1 Message Date
Nic Cope 0c7b1eb549 Bump golangci-lint, copy config from c/c
This copies the latest config from c/c and addresses all the linter
errors that config produces.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2024-02-20 03:45:27 -08:00
Aditya Sharma cd68866501 Fix lints
Signed-off-by: Aditya Sharma <git@adi.run>
2022-07-21 22:01:32 -07:00
Aditya Sharma 1deb753676 s/interface{}/any/g
Signed-off-by: Aditya Sharma <git@adi.run>
2022-07-21 21:46:18 -07:00
hasheddan a37f37a745
Write YAML document terminator on file end
YAML supports a document terminator (...) when reading files in a
stream. This allows for the reader to indicate that the current document
has ended without indicating that the stream is finished. Anything after
the document terminator is ignored by the consumer. Therefore, we write
the terminator at the end of a read file, then immediately follow with a
YAML document separator (---), which is mandatory according to the YAML
spec when using document terminators.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2021-06-09 10:49:36 -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 96e0fce629
Make FsReadCloser an AnnotatedReader
Adds the annotate method to FsReadCloser so that it can provide
additional context to parser about most recently read data in the event
of an error.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-12-08 16:16:20 -06:00
hasheddan a521e1178f
Note that FsReadCloser does not follow symlinks
Adds note to NewFsReadCloser to indicate that symbolic links will not be
honored when walking the filesystem.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-11-19 20:09:25 -06:00
Nic Cope 0a1513a2de Bump build package for new golangci-lint
Address a few (mostly) false positives introduced by the new linter.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-26 15:35:20 -07:00
hasheddan 76c547909e
Add FsReadCloser to implement io.ReadCloser for a filesystem
Implements io.ReadCloser for afero.Fs to allow passing it to a parser
that accepts an io.ReadCloser and reads from it.

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